rivet-design 0.28.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,498 +0,0 @@
1
- var W8=t=>{throw TypeError(t)};var Y_=(t,e,n)=>e.has(t)||W8("Cannot "+n);var W=(t,e,n)=>(Y_(t,e,"read from private field"),n?n.call(t):e.get(t)),nt=(t,e,n)=>e.has(t)?W8("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ne=(t,e,n,r)=>(Y_(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Et=(t,e,n)=>(Y_(t,e,"access private method"),n);var B0=(t,e,n,r)=>({set _(s){Ne(t,e,s,n)},get _(){return W(t,e,r)}});function vH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const yH="modulepreload",_H=function(t){return"/"+t},K8={},t4=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=_H(d),d in K8)return;K8[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":yH,f||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),f)return new Promise((v,y)=>{m.addEventListener("load",v),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function A1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var X_={exports:{}},Ih={},Q_={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 q8;function wH(){if(q8)return Ot;q8=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function m(D){return D===null||typeof D!="object"?null:(D=h&&D[h]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,_={};function b(D,G,fe){this.props=D,this.context=G,this.refs=_,this.updater=fe||v}b.prototype.isReactComponent={},b.prototype.setState=function(D,G){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,G,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function x(){}x.prototype=b.prototype;function k(D,G,fe){this.props=D,this.context=G,this.refs=_,this.updater=fe||v}var C=k.prototype=new x;C.constructor=k,y(C,b.prototype),C.isPureReactComponent=!0;var P=Array.isArray,R=Object.prototype.hasOwnProperty,O={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function A(D,G,fe){var ie,ue={},he=null,we=null;if(G!=null)for(ie in G.ref!==void 0&&(we=G.ref),G.key!==void 0&&(he=""+G.key),G)R.call(G,ie)&&!I.hasOwnProperty(ie)&&(ue[ie]=G[ie]);var le=arguments.length-2;if(le===1)ue.children=fe;else if(1<le){for(var se=Array(le),be=0;be<le;be++)se[be]=arguments[be+2];ue.children=se}if(D&&D.defaultProps)for(ie in le=D.defaultProps,le)ue[ie]===void 0&&(ue[ie]=le[ie]);return{$$typeof:t,type:D,key:he,ref:we,props:ue,_owner:O.current}}function M(D,G){return{$$typeof:t,type:D.type,key:G,ref:D.ref,props:D.props,_owner:D._owner}}function L(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function z(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(fe){return G[fe]})}var $=/\/+/g;function q(D,G){return typeof D=="object"&&D!==null&&D.key!=null?z(""+D.key):G.toString(36)}function X(D,G,fe,ie,ue){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var we=!1;if(D===null)we=!0;else switch(he){case"string":case"number":we=!0;break;case"object":switch(D.$$typeof){case t:case e:we=!0}}if(we)return we=D,ue=ue(we),D=ie===""?"."+q(we,0):ie,P(ue)?(fe="",D!=null&&(fe=D.replace($,"$&/")+"/"),X(ue,G,fe,"",function(be){return be})):ue!=null&&(L(ue)&&(ue=M(ue,fe+(!ue.key||we&&we.key===ue.key?"":(""+ue.key).replace($,"$&/")+"/")+D)),G.push(ue)),1;if(we=0,ie=ie===""?".":ie+":",P(D))for(var le=0;le<D.length;le++){he=D[le];var se=ie+q(he,le);we+=X(he,G,fe,se,ue)}else if(se=m(D),typeof se=="function")for(D=se.call(D),le=0;!(he=D.next()).done;)he=he.value,se=ie+q(he,le++),we+=X(he,G,fe,se,ue);else if(he==="object")throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return we}function j(D,G,fe){if(D==null)return D;var ie=[],ue=0;return X(D,ie,"","",function(he){return G.call(fe,he,ue++)}),ie}function K(D){if(D._status===-1){var G=D._result;G=G(),G.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=G)}if(D._status===1)return D._result.default;throw D._result}var ee={current:null},H={transition:null},Q={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:H,ReactCurrentOwner:O};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ot.Children={map:j,forEach:function(D,G,fe){j(D,function(){G.apply(this,arguments)},fe)},count:function(D){var G=0;return j(D,function(){G++}),G},toArray:function(D){return j(D,function(G){return G})||[]},only:function(D){if(!L(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=k,Ot.StrictMode=r,Ot.Suspense=c,Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,Ot.act=B,Ot.cloneElement=function(D,G,fe){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ie=y({},D.props),ue=D.key,he=D.ref,we=D._owner;if(G!=null){if(G.ref!==void 0&&(he=G.ref,we=O.current),G.key!==void 0&&(ue=""+G.key),D.type&&D.type.defaultProps)var le=D.type.defaultProps;for(se in G)R.call(G,se)&&!I.hasOwnProperty(se)&&(ie[se]=G[se]===void 0&&le!==void 0?le[se]:G[se])}var se=arguments.length-2;if(se===1)ie.children=fe;else if(1<se){le=Array(se);for(var be=0;be<se;be++)le[be]=arguments[be+2];ie.children=le}return{$$typeof:t,type:D.type,key:ue,ref:he,props:ie,_owner:we}},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 G=A.bind(null,D);return G.type=D,G},Ot.createRef=function(){return{current:null}},Ot.forwardRef=function(D){return{$$typeof:l,render:D}},Ot.isValidElement=L,Ot.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:K}},Ot.memo=function(D,G){return{$$typeof:d,type:D,compare:G===void 0?null:G}},Ot.startTransition=function(D){var G=H.transition;H.transition={};try{D()}finally{H.transition=G}},Ot.unstable_act=B,Ot.useCallback=function(D,G){return ee.current.useCallback(D,G)},Ot.useContext=function(D){return ee.current.useContext(D)},Ot.useDebugValue=function(){},Ot.useDeferredValue=function(D){return ee.current.useDeferredValue(D)},Ot.useEffect=function(D,G){return ee.current.useEffect(D,G)},Ot.useId=function(){return ee.current.useId()},Ot.useImperativeHandle=function(D,G,fe){return ee.current.useImperativeHandle(D,G,fe)},Ot.useInsertionEffect=function(D,G){return ee.current.useInsertionEffect(D,G)},Ot.useLayoutEffect=function(D,G){return ee.current.useLayoutEffect(D,G)},Ot.useMemo=function(D,G){return ee.current.useMemo(D,G)},Ot.useReducer=function(D,G,fe){return ee.current.useReducer(D,G,fe)},Ot.useRef=function(D){return ee.current.useRef(D)},Ot.useState=function(D){return ee.current.useState(D)},Ot.useSyncExternalStore=function(D,G,fe){return ee.current.useSyncExternalStore(D,G,fe)},Ot.useTransition=function(){return ee.current.useTransition()},Ot.version="18.3.1",Ot}var G8;function HS(){return G8||(G8=1,Q_.exports=wH()),Q_.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 Y8;function bH(){if(Y8)return Ih;Y8=1;var t=HS(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,d){var f,h={},m=null,v=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(v=c.ref);for(f in c)r.call(c,f)&&!i.hasOwnProperty(f)&&(h[f]=c[f]);if(l&&l.defaultProps)for(f in c=l.defaultProps,c)h[f]===void 0&&(h[f]=c[f]);return{$$typeof:e,type:l,key:m,ref:v,props:h,_owner:s.current}}return Ih.Fragment=n,Ih.jsx=o,Ih.jsxs=o,Ih}var X8;function xH(){return X8||(X8=1,X_.exports=bH()),X_.exports}var S=xH();const SH="x-rivet-editor-token",Q8="editorToken",kH=["/api/account","/api/config","/api/auth/store","/api/auth/logout","/api/library/browser-launches","/api/integrations","/api/reference-profiles"],EH=/^\/api\/variants\/(?:[^/]+\/static\/|history\/[^/]+\/[^/]+\/(?:preview(?:\/|$)|site\/)|[^/]+\/[^/]+\/references\/[^/]+\/image\/?$)/,CH=(t,e="GET")=>{const n=t.split(/[?#]/)[0].toLowerCase();return/^\/api\/variants(?:\/|$)/.test(n)?!["GET","HEAD"].includes(e.toUpperCase())||!EH.test(n):kH.some(r=>n===r||n.startsWith(`${r}/`))},nb="rivet_editor_token";let rb;const PH=()=>{if(window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)),e=t.get(Q8);if(e===null)return;rb=e||null,t.delete(Q8);const n=t.toString();window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n?`#${n}`:""}`);try{e?window.sessionStorage.setItem(nb,e):window.sessionStorage.removeItem(nb)}catch{}},TH=()=>{if(rb!==void 0)return rb;try{return window.sessionStorage.getItem(nb)}catch{return null}};var g=HS();const Ce=A1(g),Zf=vH({__proto__:null,default:Ce},[g]);var RH={};const ce="u">typeof window?window:void 0,_s="u">typeof globalThis?globalThis:ce,Jr=_s==null?void 0:_s.navigator,Me=_s==null?void 0:_s.document,fn=_s==null?void 0:_s.location,Dp=_s==null?void 0:_s.fetch,US=_s!=null&&_s.XMLHttpRequest&&"withCredentials"in new _s.XMLHttpRequest?_s.XMLHttpRequest:void 0,J8=_s==null?void 0:_s.AbortController,AH=_s==null?void 0:_s.CompressionStream,Is=Jr==null?void 0:Jr.userAgent,Oh=typeof globalThis<"u"?globalThis:ce;Oh&&typeof self>"u"&&(Oh.self=Oh),Oh&&typeof File>"u"&&(Oh.File=function(){});const et=ce??{},IH="0.10.7",Ba={DEBUG:!1,LIB_VERSION:IH,LIB_NAME:"browser-common"};var Ho=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),sb=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const OH=["$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"],MH=["token"];function We(t,e){return t.indexOf(e)!==-1}const yf=function(t){return t.trim()},ib=function(t){return t.replace(/^\$/,"")};function n4(t){var e;const n=[];return(e=JSON.stringify(t,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&e!==void 0?e:"null"}const r4=Object.prototype,BS=r4.hasOwnProperty,I1=r4.toString,He=Array.isArray||function(t){return I1.call(t)==="[object Array]"},Vn=t=>typeof t=="function",ct=t=>t===Object(t)&&!He(t),Ks=t=>{if(ct(t)){for(const e in t)if(BS.call(t,e))return!1;return!0}return!1},de=t=>t===void 0,dt=t=>I1.call(t)=="[object String]",fp=t=>dt(t)&&t.trim().length===0,Nn=t=>t===null,ot=t=>de(t)||Nn(t),Yn=t=>I1.call(t)=="[object Number]"&&t==t,Ia=t=>Yn(t)&&t>0,Ms=t=>I1.call(t)==="[object Boolean]",NH=t=>We(OH,t),LH=t=>We(MH,t);function s4(t){return t===null||typeof t!="object"}function yv(t,e){return{}.toString.call(t)===`[object ${e}]`}function Wf(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return i4(t,Error)}}function ZS(t){return"u">typeof Event&&i4(t,Event)}function i4(t,e){try{return t instanceof e}catch{return!1}}const DH=[!0,"true",1,"1","yes"],J_=t=>We(DH,t),$H=[!1,"false",0,"0","no"];function eP(t,e,n,r,s,i,o){try{var l=t[i](o),c=l.value}catch(d){return void n(d)}l.done?e(c):Promise.resolve(c).then(r,s)}function pn(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(c){eP(i,r,s,o,l,"next",c)}function l(c){eP(i,r,s,o,l,"throw",c)}o(void 0)})}}const FH=["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"],Z0=new Map,tP=function(t,e=[]){if(!t)return!1;const n=(function(o,l){let c="";for(let d=0;l.length>d;d++){const f=l[d];c+=f.length+":"+f}return o.length+":"+o+"|"+l.length+":"+c})(t,e),r=Z0.get(n);if(r!==void 0)return r;const s=t.toLowerCase(),i=FH.concat(e).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>Z0.size||Z0.clear(),Z0.set(n,i),i};function Qo(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Yn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Qo(s??n,e,n,r))}var jH=class{constructor(t){this.C={},this.I=t.I,this.A=Qo(t.bucketSize,0,100,t.R),this.O=Qo(t.refillRate,0,this.A,t.R),this.$=Qo(t.refillInterval,0,864e5,t.R)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.$);n>0&&(t.tokens=Math.min(t.tokens+n*this.O,this.A),t.lastAccess=t.lastAccess+n*this.$)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.A,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const $p="Mobile",Fp="Android",ob="Tablet",o4="Android Tablet",a4="iPad",l4="Apple Watch",Lg="Safari",O1="BlackBerry",c4="Samsung Internet",Dg="Chrome",u4="Chrome iOS",d4="Internet Explorer",f4="Internet Explorer Mobile",h4="Opera",p4="Microsoft Edge",$g="Firefox",m4="Firefox iOS",_v="Nintendo",wv="PlayStation",M1="Xbox",g4="Android Mobile",v4="Mobile Safari",e2="Windows",y4="Windows Phone",nP="Nokia",ab="Ouya",_4="Generic tablet",lb="Konqueror",w4="Oculus Browser",b4="Vivaldi",x4="Yandex",S4="Whale",k4="DuckDuckGo",E4="Pale Moon",C4="Waterfox",cb="Brave",P4="Claude",T4="Codex",R4="ChatGPT",A4="Google Search App",t2=new RegExp("Version/(\\d+(\\.\\d+)?)"),n2=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),zH=new RegExp(M1,"i"),VH=new RegExp("PlayStation \\w+","i"),HH=new RegExp("Nintendo \\w+","i"),WS=new RegExp("BlackBerry|PlayBook|BB10","i"),UH={"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"},I4=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?cb:null})(n)||(r!=null&&r.detectGoogleSearchApp&&We(t,"GSA/")?A4:We(t," OPR/")&&We(t,"Mini")?"Opera Mini":We(t," OPR/")?h4:WS.test(t)?O1:We(t,"IEMobile")||We(t,"WPDesktop")?f4:We(t,"OculusBrowser")?w4:We(t,"SamsungBrowser")?c4:We(t,"Edge")||We(t,"Edg/")?p4:We(t,"Vivaldi/")?b4:We(t,"YaBrowser/")?x4:We(t,"Whale/")?S4:We(t,"DuckDuckGo/")||We(t,"Ddg/")?k4:We(t,"Claude/")?P4:We(t,"Codex/")?T4:We(t,"ChatGPT/")?R4:We(t,"FBIOS")?"Facebook Mobile":We(t,"UCWEB")||We(t,"UCBrowser")?"UC Browser":We(t,"CriOS")?u4:We(t,"CrMo")||We(t,Dg)?Dg:We(t,Fp)&&We(t,Lg)?g4:We(t,"FxiOS")?m4:We(t.toLowerCase(),lb.toLowerCase())?lb:We(t,"Brave/")?cb:((i,o)=>o&&We(o,"Apple")||(function(l){return We(l,Lg)&&!We(l,Dg)&&!We(l,Fp)})(i))(t,e)?We(t,$p)?v4:Lg:We(t,"PaleMoon/")?E4:We(t,"Waterfox/")?C4:We(t,$g)?$g:We(t,"MSIE")||We(t,"Trident/")?d4:We(t,"Gecko")?$g:"")},BH={[f4]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[p4]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Dg]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[u4]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[Lg]:[t2],[v4]:[t2],[h4]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[$g]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[m4]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[lb]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[O1]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),t2],[g4]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[c4]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[w4]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[b4]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[x4]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[S4]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[cb]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[P4]:[n2],[T4]:[n2],[R4]:[n2],[k4]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[E4]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[C4]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[A4]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[d4]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},ZH=function(t,e,n,r){const s=I4(t,e,n,r),i=BH[s];if(de(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},rP=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[M1,t&&t[1]||""]],[new RegExp(_v,"i"),[_v,""]],[new RegExp(wv,"i"),[wv,""]],[WS,[O1,""]],[new RegExp(e2,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[y4,""];if(new RegExp($p).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=UH[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[e2,r]}return[e2,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=de(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Fp,[t[2],t[3],t[4]||"0"].join(".")]:[Fp,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],O4=function(t){for(let e=0;rP.length>e;e++){const[n,r]=rP[e],s=n.exec(t),i=s&&(Vn(r)?r(s,t):r);if(i)return i}return["",""]},M4=function(t){return HH.test(t)?_v:VH.test(t)?wv:zH.test(t)?M1:new RegExp(ab,"i").test(t)?ab:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?y4:/iPad/.test(t)?a4:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?l4:WS.test(t)?O1:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(nP,"i").test(t)?nP:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp($p).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Fp:o4:new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(ob,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?_4:""},WH=function(t,e){var n;const r=M4(t);return r===a4||r===o4||r==="Kobo"||r==="Kindle Fire"||r===_4?ob:r===_v||r===M1||r===wv||r===ab?"Console":r===l4?"Wearable":r?$p:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?$p:ob:"Desktop";var s,i,o},r2=/\bFBAV\/(\d+(?:\.\d+)*)/i,sP=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",r2],[/\bFBAN\/EMA\b/i,"Facebook Lite",r2],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",r2],[/\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"]],ub="[Truncated]",Rm="[Unserializable]";function Kd(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function N4(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=Rm}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const s2=3e5;var L4=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,s2);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+s2))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(s2,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const KH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function iP(t,e){return typeof(n=t)=="string"&&KH.test(n)?t:e();var n}function D4(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function Xl(t){return t&&t.split("#")[0]}function oP(t){try{return t()}catch{return}}function $4(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function aP(t,e,n){return F4.apply(this,arguments)}function F4(){return(F4=pn(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=$4(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function hp(t){return hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hp(t)}function qH(t,e,n){return(e=(function(r){var s=(function(i){if(hp(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(hp(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return hp(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lP(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function V(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lP(Object(n),!0).forEach(function(r){qH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lP(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}let Mh,cP,uP,md;function GH(t){var e;const n=globalThis._posthogChunkIds,r=globalThis._debugIds;if(!n&&!r)return;const s=n?Object.keys(n):[],i=r?Object.keys(r):[];if(md&&dP(n,s,cP)&&dP(r,i,uP))return md;cP=n?V({},n):void 0,uP=r?V({},r):void 0,md={},(e=Mh)!==null&&e!==void 0||(Mh={});const o=(l,c)=>{for(const f of l){const h=c[f];if(!h)continue;const m=Mh==null?void 0:Mh[f];if(m){md[m]=h;continue}const v=t(f);for(let y=v.length-1;y>=0;y--){var d;const _=(d=v[y])===null||d===void 0?void 0:d.filename;if(_){md[_]=h,Mh[f]=_;break}}}};return r&&o(i,r),n&&o(s,n),md}function dP(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(r=>t[r]===n[r]):t===n}var YH=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return pn(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&He(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return V(V({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return pn(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const c=n.length,d=i===void 0?V(V({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:c}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:c,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,c,"cause");for(const h of(l=s.errors)!==null&&l!==void 0?l:[])r(h,c,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:GH(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Wf(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return He(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],c={},d=(m,v,y=0)=>{const _=f(v,y),b=_.apply;if(_.apply=O=>{l.push(m);try{return b(O)}finally{l.pop()}},y>4||y>0&&l.indexOf(m)!==-1)return this.coerceFallback(_);const x=typeof m=="object"&&m!==null||typeof m=="function";if(y===0&&r>=50||x&&o.has(m))return;x&&o.add(m),y===0&&r++;const k=this.getAggregateErrors(m);let C,P;i||(i=!!k);try{if(C=this.applyCoercers(m,_),!C)throw c}catch(O){if(O===c)return void(y===0&&r--);if(!i)throw O;C=this.coerceFallback(_)}if(!k||r>=50)return C;try{P=k.length}catch{return C}if(!Number.isInteger(P)||0>P||P>4294967295)return C;const R=[];for(let O=0;50>r&&1e3>s&&P>O;O++){let I;s++;try{I=_.next(k[O])}catch{r++,I=this.coerceFallback(f(v+1))}I&&R.push(I)}return V(V({},C),{},{errors:R})},f=(m,v=0)=>V(V({},e),{},{syntheticException:m==0?e.syntheticException:void 0,mechanism:m==0?t:{},apply(y){const _=d(y,m,v+1);if(!_)throw c;return _},next:y=>d(y,m+1)}),h=f(n);return V(V({},h),{},{apply:m=>{var v;return(v=d(m,n))!==null&&v!==void 0?v:this.coerceFallback(h)}})}};const XH=/^([a-z][a-z0-9.+-]+):/i,QH=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function JH(t){if(!t||t==="<anonymous>")return!1;const e=XH.exec(t);return!e||QH.includes(e[1].toLowerCase())}function db(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:JH(e)};return de(r)||(i.lineno=r),de(s)||(i.colno=s),i}const j4=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},eU=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tU=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nU=/\((\S*)(?::(\d+))(?::(\d+))\)/,rU=(t,e)=>{const n=eU.exec(t);if(n){const[,s,i,o]=n;return db(e,s,"?",+i,+o)}const r=tU.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=nU.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=j4(r[1]||"?",r[2]);return db(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},sU=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,iU=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oU=(t,e)=>{const n=sU.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=iU.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]=j4(s,r),db(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},fP=/\(error: (.*)\)/;function KS(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function aU(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!KS(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function lU(t,e){const n=e.start+e.length,r=V4(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function z4(t,e){let n=e.start;for(;n>0&&KS(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function V4(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&KS(t[r],t[r-e.length]);)r++;return r-n}function cU(t,e){const n=e[0];let r=t.length-(n?z4(t,n):0);for(const s of e)r-=V4(t,s);return r}function uU(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var dU=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=dt(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return yv(t,"DOMException")}isDOMError(t){return yv(t,"DOMError")}},fU=class{match(t){return Wf(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},hU=class{match(t){return!!yv(t,"ErrorEvent")&&(t.error!=null||this.yr(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return V(V({},r),{},{stack:(n=this.br(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}yr(t){return dt(t.message)&&t.message.length>0}br(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(dt(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
- at ${r.filename}:${s}:${i}`}};const pU=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var mU=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(pU);return r&&(e=r[1],n=r[2]),[e,n]}};const gU=["fatal","error","warning","log","info","debug"];function H4(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var vU=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(ZS(t))return t.constructor.name;const e="name"in t?t.name:void 0;return dt(e)&&!fp(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${H4(t)}`}isSeverityLevel(t){return dt(t)&&!fp(t)&&gU.indexOf(t)>=0}getStack(t){try{return dt(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:dt(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(Wf(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},yU=class{match(t){return ZS(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${H4(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},_U=class{match(t){return s4(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},wU=class{match(t){return yv(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!ZS(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return s4(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const bv="$message",xv="$timestamp",bU=new Set([bv,xv]),i2={enabled:!0,max_bytes:32768};function Sv(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:i2.enabled,max_bytes:SU(t.max_bytes,i2.max_bytes)}:V({},i2)}var xU=class{constructor(t){this.ns=[],this.ss=0,this.Fr=Sv(t)}setConfig(t){this.Fr=Sv(t),this.rs()}add(t){const e=(function(r){let s;try{s=n4(r)}catch{return}try{const i=JSON.parse(s);if(!ct(i))return;const o=i,l=o[bv],c=o[xv];return!dt(l)||l.trim().length===0||!dt(c)&&!Yn(c)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(e.json);n>this.Fr.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Fr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function SU(t,e){if(!Yn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const hP=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function pP(t){return typeof t=="string"||t}function mP(t){return typeof t=="string"?t:void 0}const kU=["$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"],U4="NativeGzipValidationError",fb=t=>t.length>=2&&t[0]===31&&t[1]===139,gP=(t,e)=>t===sb.GZipJS||e===sb.GZipJS||e==="gzip",vP=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let Nh;const W0=t=>{throw D4(U4,`Native gzip produced invalid output: ${t}`)},EU=(function(){var t=pn(function*(e,n){18>e.size&&W0("too-short");const r=new Uint8Array(yield e.slice(0,10).arrayBuffer());fb(r)&&r[2]===8||W0("invalid-header");const s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{const l=(()=>{if(Nh)return Nh;Nh=[];for(let d=0;256>d;d++){let f=d;for(let h=0;8>h;h++)f=1&f?3988292384^f>>>1:f>>>1;Nh[d]=f>>>0}return Nh})();let c=4294967295;for(let d=0;o.length>d;d++)c=l[255&(c^o[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&W0("invalid-crc");const i=n.length>>>0;s.getUint32(4,!0)!==i&&W0("invalid-size")});return function(e,n){return t.apply(this,arguments)}})();function hb(){return hb=pn(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=pn(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),c=new Response(i.readable).blob(),[d]=yield Promise.all([c,l]);return yield EU(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),hb.apply(this,arguments)}function B4(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var c={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;c[d]=o[d]}return c})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const vs="[redacted]",CU=/^[A-Za-z0-9+/\n\r]+=*$/,PU=/^[A-Za-z0-9_-]+={0,2}$/,TU=/[-_]/,RU=/^data:[^,\s]*;base64,/i,AU=/^[A-Za-z0-9+/_-]+={0,2}$/,IU=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,OU=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,Z4=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,MU=/[\s<>"]/,W4=new RegExp(Z4.source,"i"),K4=/[a-z][a-z0-9+.-]{0,63}:\/\//i,NU=new RegExp(`^${K4.source}`,"i"),LU=new RegExp(K4.source,"gi"),DU=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,$U=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,FU=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,jU=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,zU=/\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,VU=/(^|[^\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,HU=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,UU=/\b\d(?:[ ./-]?\d){12,}\b/g,yP=/\d+/g,BU=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,ZU=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function pb(t){return(function(e){return OU.test(e)})(t)||DU.test(t)||$U.test(t)}function o2(t){return t.split("&",129).length>128}function WU(t,e,n){return pb(t)||e.includes(";")&&(function(r){return r.split(";").some(s=>pb(s.split("=",1)[0]))})(e)?vs:W4.test(e)?n?qS(e,{allowNestedUrls:!1,stripPunctuation:!0}):vs:e}function q4(t,e){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(t)){const l=kv(i),c=kv(o);r||(r=l!==i||c!==o);const d=WU(l,c,e);r||(r=d!==c),s=pb(l)||d!==c,n.append(l,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function _P(t,e){if(!t.includes("="))return{value:KU(t,e),lastFieldSensitive:!1};const n=q4(t,e);return{value:n.changed?n.serialized:t,lastFieldSensitive:n.lastFieldSensitive}}function KU(t,e){return e?qS(t,{allowNestedUrls:!1,stripPunctuation:!0}):W4.test(t)?vs:t}function qU(t,e,n){return t==="#"?!e.fragment&&(e.fragment=!0):t==="?"&&(e.fragment?n!=="="&&!e.fragmentQuery&&(e.fragmentQuery=!0):!e.query&&(e.query=!0))}function a2(t,e){var n;if(t.length>8192&&NU.test(t))return vs;const{address:r,suffix:s}=e.stripPunctuation?(function(b){let x=b.length;for(;x>0&&".,;:!?)]}'".includes(b[x-1]);)x--;return{address:b.slice(0,x),suffix:b.slice(x)}})(t):{address:t,suffix:""};let i;try{i=new URL(r)}catch{return vs+s}const o=i.search.slice(1),l=i.hash!=="",c=(function(b){const x=b.slice(1),k=x.indexOf("?");return 0>k?{head:x,tail:null}:{head:x.slice(0,k),tail:x.slice(k+1)}})(i.hash);if(o2(o)||o2(c.head)||o2((n=c.tail)!==null&&n!==void 0?n:""))return vs+s;let d=!1;(i.username||i.password)&&(i.username=vs,i.password="",d=!0);const f=q4(o,e.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const h=_P(c.head,e.allowNestedUrls),m=c.tail===null?null:(v=c.tail,h.lastFieldSensitive?{value:v===""?"":vs,lastFieldSensitive:!0}:_P(v,e.allowNestedUrls));var v;const y=m===null?h.value:`${h.value}?${m.value}`;y!==i.hash.slice(1)&&(i.hash=y,d=!0);const _=l?m??h:f;return(d?kv(i.toString()):r)+(_.lastFieldSensitive?"":s)}function qS(t,e){return t.replace(Z4,n=>(function(r,s){const i=(function(c){if(!c.includes("://"))return[];const d=[...c.matchAll(LU)].map(_=>_.index),f=[],h={query:!1,fragment:!1,fragmentQuery:!1};let m=0,v=!1,y="";for(let _=0;c.length>_&&d.length>m;_++){d[m]===_&&(_>0&&y!=="="&&f.push(_),m++);const b=c[_];qU(b,h,y)?(y=b,v=!0):v&&"=&".includes(b)&&(y=b)}return f})(r);if(i.length===0)return a2(r,s);let o="",l=0;for(const c of i)o+=a2(r.slice(l,c),V(V({},s),{},{stripPunctuation:!1})),l=c;return o+a2(r.slice(l),s)})(n,V(V({},e),{},{stripPunctuation:e.stripPunctuation&&n.length!==t.length})))}function kv(t){return t.replace(IU,vs)}function G4(t,e){return(function(n){return n.length>=10240&&(CU.test(n)||(function(r){const s=RU.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return AU.test(i.replace(/[\r\n]/g,""))})(n)||TU.test(n)&&PU.test(n))})(t)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(n,r,s){const i=4*s.maxStringLength;if(n.length>i){const o=r(n.slice(0,(function(l,c){let d=c;for(;d>0&&!MU.test(l[d-1]);)d--;return d})(n,i)));if(o.length>=2*s.maxStringLength)return o+s.truncationSuffix}return r(n)})(t,n=>(function(r){return qS(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(FU," ");return s=s.replace(jU,vs),s=s.replace(zU,vs),s=s.replace(VU,`$1${vs}`),s=s.replace(UU,YU),s=s.replace(HU,vs),s=s.replace(BU,`$1${vs}`),s=s.replace(ZU,`$1${vs}`),s})(kv(n))),e)}function GU(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;if(0>s||s>9)return!1;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function YU(t){const e=[];for(let i=yP.exec(t);i!==null;i=yP.exec(t))e.push({digits:i[0],start:i.index,end:i.index+i[0].length});let n="",r=0,s=0;for(;e.length>s;){let i="",o=-1;for(let l=s;e.length>l&&(i+=e[l].digits,19>=i.length);l++)i.length>=13&&GU(i)&&(o=l);0>o?s++:(n+=t.slice(r,e[s].start)+vs,r=e[o].end,s=o+1)}return n+t.slice(r)}const XU={}.propertyIsEnumerable;function Ev(t,e){try{return Y4(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function GS(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:ub};if(n.remainingNodes--,Ms(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Kd(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:ub};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Kd(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return GS(s.call(t),e,n,r+1)}catch{}return He(t)?{arrayValue:{values:QU(t,e,n,r+1)}}:{kvlistValue:{values:Y4(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Kd(String(t))}}function QU(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(ot(l))continue;s.push(GS(l,e,n,r))}catch{s.push({stringValue:Rm})}return t.length>o&&s.push({stringValue:ub}),s}function Y4(t,e,n,r){const s=[];for(const i in t)if(XU.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(Nn(o)||de(o))continue;s.push({key:Kd(i),value:GS(o,e,n,r)})}catch{s.push({key:Kd(i),value:{stringValue:Rm}})}}return s}function X4(t,e,n){return V(V(V(V({},N4({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const JU=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Q4(t,e){const n=N4({},t),r={};for(const s of JU)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Ev(n,e),...Ev(r,e)]}const wP={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"},J4={text:"INFO",number:9},eB={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:J4,warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}};function tB(t){try{return Kd(String(t))}catch{return Rm}}function nB(t,e,n,r){const s=t.level||"info",{text:i,number:o}=eB[s]||J4,l=(function(m=Date.now()){return String(m)+"000000"})(Yn(r)?r:void 0),c={};e.distinctId&&(c.posthogDistinctId=e.distinctId),e.sessionId&&(c.sessionId=e.sessionId),e.windowId&&(c["window.id"]=e.windowId),ot(e.sessionStartTimestamp)||(c.sessionStartTimestamp=String(e.sessionStartTimestamp)),ot(e.lastActivityTimestamp)||(c.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(c["url.full"]=e.currentUrl),e.screenName&&(c["screen.name"]=e.screenName),e.appState&&(c["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(c.feature_flags=e.activeFeatureFlags);const d=V({},c),f=t.attributes;if(f){let m=[];try{m=Object.keys(f)}catch{m=[]}for(const v of m){let y;try{y=f[v]}catch{y=Rm}Object.defineProperty(d,v,{value:y,enumerable:!0,writable:!0,configurable:!0})}}const h={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:tB(t.body)},attributes:Ev(d,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),de(t.trace_flags)||(h.flags=t.trace_flags),h}function eM(t,e,n){return X4(t,e,n)}function tM(t,e,n,r){return{resourceLogs:[{resource:{attributes:Q4(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var nM=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.cs}arm(t){this.clear(),this.us=Date.now()+t,this.cs=$4(()=>{this.cs=void 0,this.ls()},t)}armNoEarlierThan(t){this.cs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function rM(){return .75+.5*Math.random()}function sM(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var rB=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Fr=e,this.R=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new nM(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new L4,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.As=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Ho.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(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Fs(t);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:nB(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.hs(),this.R,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Fs(t){const e=this.Fr.beforeSend;if(!e)return t;const n=He(e)?e:[e];let r=t;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 t=Date.now(),e=t-this.xs;return this.As>e&&e>=0||(this.xs=t,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 t=this;return pn(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return pn(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Ho.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const c=Math.min(n.length,t.Es),d=n.slice(0,c),f=tM(d.map(m=>m.record),t.js(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.qs(f);if(t._s!==l)return;if(h.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.R.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(h),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),h.kind==="retry-later"||(h.kind==="too-large"?t.R.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Fr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Fr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Ho.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,h.kind==="fatal"))throw h.error}})()}Bs(t){var e=this;return pn(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Ho.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ho.LogsQueue,s.slice(r)),yield e.vs()})()}js(){return eM(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Ho.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.R.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Ho.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(sM(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ps(){const t=this._instance.getPersistedProperty(Ho.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return pn(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield aP(n,t):yield n})()}flushWithTimeout(t){var e=this;return pn(function*(){const n=e.flush();yield aP(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=rM(),this.R.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Ps()&&this.ps.armNoEarlierThan(this.zs())})}};const sB=/^[0-9a-f]+$/;function bP(t,e,n){return typeof t=="string"&&t.length===e&&t!==n&&sB.test(t)}const iB=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,oB="00",K0=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function mb(t){return String(t)+"000000"}function l2(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var aB=class{constructor(t,e,n){this._instance=t,this.Fr=e,this.R=n,this.Hs=new Map,this.ps=new nM(()=>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 L4,this.ks=0,this.Ss=1,this.Zs=0}count(t,e=1,n){this.Ks({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Ks({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Ks({name:t,type:"histogram",value:e,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 t=this;const e=this.ys,n=(function(){var r=pn(function*(){e&&(yield e.catch(()=>{})),yield t.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 t=this.Hs;return this.Xs(),this._o(t)}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(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Fs(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.R.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.R.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type!=="count"&&e.type!=="gauge"&&e.type!=="histogram")return void this.R.warn(`Dropping metric '${e.name}': unknown type '${String(e.type)}'`);if(e.type==="count"&&0>e.value)return void this.R.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?V({},e.attributes):void 0,r=l2(e.type,e.name,e.unit,n)}catch(c){return void this.R.warn(`Dropping metric '${e.name}': attributes could not be serialized`,c)}let s,i=this.Hs.get(r);if(!i&&!this.ko()||e.type==="histogram"&&(s=this.So(e.name,e.unit,e.bounds),!s))return;i||(i={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now(),hist:s&&lB(s)},this.Hs.set(r,i));const o=this.Ws.get(e.name);o===void 0?this.Ws.set(e.name,e.type):o===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.R.warn(`Metric name '${e.name}' is already used as a ${o}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.xo(i,e.value);const l=this.$o();l&&(i.exemplar=V(V({},l),{},{value:e.value,timeMs:Date.now()})),this.Os()}$o(){try{var t,e;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const l=iB.exec(o.trim());if(!l)return;const[,c,d,f,h,m]=l;return c==="ff"||c==="00"&&m||!(function(v){return bP(v,32,"00000000000000000000000000000000")})(d)||!(function(v){return bP(v,16,"0000000000000000")})(f)?void 0:{version:c,traceId:d,spanId:f,flags:h}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":oB)};var i})((t=(e=this._instance).getActiveSpan)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.traceparent());if(n&&n.flags==="01")return{traceId:n.traceId,spanId:n.spanId}}catch{}}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(t,e,n){if(n!==void 0&&!(function(o){if(!He(o)||o.length===0)return!1;for(let l=0;o.length>l;l++)if(!Number.isFinite(o[l])||l>0&&o[l-1]>=o[l])return!1;return!0})(n))return void this.R.warn(`Dropping histogram '${t}': bounds must be a non-empty array of finite, strictly increasing numbers`);const r=l2("histogram",t,e,void 0),s=this.Gs.get(r);if(s)return this.Co(t,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&&!xP(n,K0)?void 0:K0;const i=n?n.slice():K0;return this.Gs.set(r,i),i}Co(t,e,n,r){xP(n,r??K0)||this.Qs.has(e)||(this.Qs.add(e),this.R.warn(`Histogram '${t}' already uses the bounds [${n.join(", ")}]; samples that pass different bounds are recorded in those buckets.`))}xo(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{const r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,r.bounds)]+=1;break}}}Fs(t){const e=this.Fr.beforeSend;if(!e)return t;const n=He(e)?e:[e];let r=t;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(sM(this.Fr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ys(){var t=this;return pn(function*(){if(t.ps.clear(),t.Hs.size===0)return;const e=t.Hs;t.Xs();const n=t.Zs,r=yield t._instance.To(t._o(e));if(n===t.Zs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=rM()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.zs()),r.kind){case"ok":return;case"retry-later":return t.Io(e),void t.ps.armNoEarlierThan(t.zs());case"too-large":return void t.R.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.R.error("Failed to send metrics batch:",r.error)}})()}_o(t){return e=this.Mo(t),n=(function(i,o,l){return X4(i,o,l)})(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Q4(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Mo(t){const e=mb(Date.now()),n=new Map;for(const o of t.values()){var r;const l=l2(o.type,o.name,o.unit,void 0);let c=n.get(l);c||(c=V({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?c.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?c.gauge={dataPoints:[]}:c.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,c));const d=Ev((r=o.attributes)!==null&&r!==void 0?r:{},this.R),f=mb(o.windowStartMs),h=cB(o.exemplar);if(o.type==="count"){var s;const m=V({attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0},h);c.sum.dataPoints.push(m)}else if(o.type==="gauge"){var i;const m=V({attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0},h);c.gauge.dataPoints.push(m)}else{const m=o.hist,v=V({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:m.count,sum:m.sum,min:m.min,max:m.max,bucketCounts:m.bucketCounts,explicitBounds:m.bounds},h);c.histogram.dataPoints.push(v)}}return Array.from(n.values())}Io(t){for(const[s,i]of t){var e;const o=this.Hs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.exemplar=(e=o.exemplar)!==null&&e!==void 0?e:i.exemplar,o.type){case"count":var n,r;o.total=((n=o.total)!==null&&n!==void 0?n:0)+((r=i.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":{const l=o.hist,c=i.hist;l.count+=c.count,l.sum+=c.sum,l.min=Math.min(l.min,c.min),l.max=Math.max(l.max,c.max);for(let d=0;l.bucketCounts.length>d;d++)l.bucketCounts[d]+=c.bucketCounts[d];break}}else this.ko()&&this.Hs.set(s,i)}}};function xP(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(t[n]!==e[n])return!1;return!0}function lB(t){return{bounds:t,count:0,sum:0,min:1/0,max:-1/0,bucketCounts:new Array(t.length+1).fill(0)}}function cB(t){return t?{exemplars:[{filteredAttributes:[],timeUnixNano:mb(t.timeMs),asDouble:t.value,traceId:t.traceId,spanId:t.spanId}]}:{}}const iM=(t,{debugEnabled:e}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&(Ba.DEBUG||i.POSTHOG_DEBUG||e)&&!de(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>iM(`${t} ${r}`,s)};return n},ve=iM("[PostHog.js]"),An=(t,e)=>ve.createLogger(t,e),uB=An("[ExternalScriptsLoader]"),Cv=t=>{const e=Me==null?void 0:Me.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},gd=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return uB.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=()=>{if(Me==null||Me.removeEventListener("DOMContentLoaded",r),t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");if(!Me)return n("document not found");let i=Me.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=c=>{i.__posthog_loading_callback_fired=!0,n(void 0,c)},i.onerror=c=>{i.__posthog_loading_error=c,n(c)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");const o=Cv(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 c=o.__posthog_loading_error;return c?n(c):(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(!Me.body)return s();if(t.config.external_scripts_inject_target==="head")Me.head.appendChild(i);else{const c=Me.querySelectorAll("body > script");var l;c.length>0?(l=c[0].parentNode)===null||l===void 0||l.insertBefore(i,c[0]):Me.body.appendChild(i)}},s=()=>{Me==null||Me.addEventListener("DOMContentLoaded",r)};Me!=null&&Me.body||Cv(e)?r():s()},c2={},SP=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};et.__PosthogExtensions__=et.__PosthogExtensions__||{},et.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void gd(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=c2[s];if(r==="fallback"&&i){if(Cv(i))return void gd(t,i,n);delete c2[s]}return void gd(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var c;const d=SP(t,e);c2[s]=d;const f=Cv(s);f==null||(c=f.parentNode)===null||c===void 0||c.removeChild(f),gd(t,d,n)}else n(void 0,l)}:n)}gd(t,SP(t,e),n)},et.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);gd(t,r,n)},Ba.DEBUG=!1,Ba.LIB_VERSION="1.447.3",Ba.LIB_NAME="web";var Ws=Ba;const gb="$early_access_features",Va="$active_feature_flags",_u="$feature_flag_details",jp="$feature_flag_errors",Ql="$feature_flag_evaluated_at",wu="$feature_flag_request_id",pp="$minimal_flag_called_events",_o="$enabled_feature_flags",Ul="$stored_group_properties",Bl="$stored_person_properties",qo="$flag_call_reported",Qh="$flag_call_reported_session_id",Zl="$feature_flag_payloads",Vo="$override_feature_flags",nu="$override_feature_flag_payloads",qd="visibilitychange",oM="$autocapture_disabled_server_side",Jh="$surveys",Pv="$surveys_loaded_at",vb="PostHog loadExternalDependency extension not found.",yb="$surveys_activated",Fg="$surveys_activated_session",jg="$surveys_activated_timestamps",dB="$people_distinct_id",Bi="distinct_id",YS="$device_id",u2="$device_model",Tv="__alias",fB="__cmpns",kP="$fbc",Gd="$fbc_persistence",EP="$fbp",mp="$fbp_persistence",_b="__timers",wb="$heatmaps_enabled_server_side",bb="$exception_capture_enabled_server_side",aM="$error_tracking_suppression_rules",xb="$error_tracking_capture_extension_exceptions",Sb="$web_vitals_enabled_server_side",XS="$dead_clicks_enabled_server_side",QS="$product_tours_enabled_server_side",lM="$logs_capture_enabled_server_side",cM="$web_vitals_allowed_metrics",gp="$session_recording_remote_config",hB="$session_recording_enabled_server_side",pB="$replay_sample_rate",mB="$replay_override_sampling",gB="$replay_override_linked_flag",vB="$replay_override_url_trigger",yB="$replay_override_event_trigger",Dd="$sesid",uM="$session_is_sampled",_B="$session_past_minimum_duration",wB="$session_recording_url_trigger_activated_session",bB="$session_recording_event_trigger_activated_session",xB="$debug_first_full_snapshot_timestamp",SB="$sess_rec_flush_size",dM="$groups",kb="ph_product_tours",kB="$product_tours_activated",EB="$product_tours_activated_session",CB="$conversations_widget_session_id",PB="$conversations_ticket_id",TB="$conversations_widget_state",RB="$conversations_user_traits",gs="$user_state",Eb="$client_session_props",fM="$capture_rate_limit",hM="$initial_campaign_params",pM="$initial_referrer_info",$d="$initial_person_info",JS="$epp",d2="$posthog_cookieless",mM="$cookieless_mode",gM="$sdk_debug_extensions_init_method",vM="$sdk_debug_extensions_init_time_ms",ek="$sdk_debug_recording_script_not_loaded",tk="$sdk_debug_replay_stale_config",yM="$sdk_debug_replay_event_trigger_status",_M="$sdk_debug_replay_linked_flag_trigger_status",wM="$sdk_debug_replay_matched_recording_trigger_groups",bM="$sdk_debug_replay_pending_trigger_conditions",xM="$sdk_debug_replay_remote_trigger_matching_config",SM="$sdk_debug_replay_trigger_groups_count",kM="$sdk_debug_replay_url_trigger_status",AB="$session_recording_start_reason",Ha="anonymous",zg="identified",EM="identified_only",Rv="beforeunload",nk="$pageview",CP="$pageleave",CM="$identify",PP="$groupidentify";function Fd(t,e){He(t)&&t.forEach(e)}function Wt(t,e){if(!ot(t))if(He(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)BS.call(t,n)&&e(t[n],n)}const _n=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function Vg(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const IB=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ve.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ve.critical(n)}}},rk=function(t){const e={};return Wt(t,function(n,r){(dt(n)&&n.length>0||Yn(n))&&(e[r]=n)}),e};function PM(t){const e=V({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const OB=["herokuapp.com","vercel.app","netlify.app"];function MB(t){const e=t==null?void 0:t.hostname;if(!dt(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of OB)if(n===r)return!1;return!0}function Lt(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function f2(t){return t.name==="ph_toolbar_internal"}const vp=t=>{if(Me){try{const e=t+"=",n=Me.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};var NB=class Cb{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new Cb(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Cb(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},LB=class{generate(){const t=this.generateOrAbort();if(!de(t))return t;{this.Tt=0;const e=this.generateOrAbort();if(de(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return Yn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Tt)this.Tt=t,this.It();else{if(this.Tt>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Tt++,this.It())}return NB.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 DB}};const TP=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let RP;var DB=class{nextUint32(){var t;return this.Rt.length>this.Et||(((t=RP)!==null&&t!==void 0?t:RP="u">typeof window&&!de(window.crypto)&&crypto.getRandomValues?e=>{try{return crypto.getRandomValues(e)}catch{return TP(e)}}:TP)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let AP;const wo=()=>$B().toString(),$B=()=>(AP||(AP=new LB)).generate();let Lh="";const FB=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let vd=null;const Sn={Ot(){if(!Nn(vd))return vd;if(vd=!1,Me)try{const t=`__ph_cookie_support_${wo()}`;Sn.$t(t,"xyz"),vd=vp(t)==='"xyz"',Sn.Dt(t)}catch{vd=!1}return vd},Pt(t){ve.error("cookieStore error: "+t)},Lt:vp,Ft(t){let e;try{e=JSON.parse(Sn.Lt(t))||{}}catch{}return e},$t(t,e,n,r,s){if(!Me)return!1;try{let i="",o="";const l=(function(d,f){if(f){let h=(function(m,v=Me){if(Lh)return Lh;if(!v||["localhost","127.0.0.1"].includes(m))return"";const y=m.split(".");let _=Math.min(y.length,8);const b="dmn_chk_"+wo();for(;!Lh&&_--;){const x=y.slice(_).join("."),k=b+"=1;domain=."+x+";path=/";v.cookie=k+";max-age=3",v.cookie.includes(b)&&(v.cookie=k+";max-age=0",Lh=x)}return Lh})(d);if(!h){const m=(v=>{const y=v.match(FB);return y?y[0]:""})(d);m!==h&&ve.info("Warning: cookie subdomain discovery mismatch",m,h),h=m}return h?"; domain=."+h:""}return""})(Me.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const c=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&ve.warn("cookieStore warning: large cookie, len="+c.length),Me.cookie=c,!0}catch{return!1}},Dt(t,e){if(Me!=null&&Me.cookie&&(!e||!Nn(vp(t))))try{Sn.$t(t,"",-1,e)}catch{return}}};let h2=null;const It={Ot(){if(!Nn(h2))return h2;let t=!0;if(de(ce))t=!1;else try{const e="__mplssupport__";It.$t(e,"xyz"),It.Lt(e)!=='"xyz"'&&(t=!1),It.Dt(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),h2=t,t},Pt(t){ve.error("localStorage error: "+t)},Lt(t){try{return ce==null?void 0:ce.localStorage.getItem(t)}catch(e){It.Pt(e)}return null},Ft(t){try{return JSON.parse(It.Lt(t))||{}}catch{}return null},$t(t,e){try{return ce==null||ce.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){It.Pt(n)}return!1},Dt(t){try{ce==null||ce.localStorage.removeItem(t)}catch(e){It.Pt(e)}}},p2=[Bl,Va,_o,_u,Zl,wu,Ql,jp,qo],ru=[YS,Bi,Dd,uM,JS,$d,Gd,gs],yp=t=>t+"_cpm",jB=["__proto__","constructor","prototype"],m2=t=>{if(!ct(t))return{};const e={};return Object.keys(t).forEach(n=>{jB.indexOf(n)===-1&&(e[n]=t[n])}),e},g2=(t,e=[])=>{const n={};return[...ru,...e].forEach(r=>{const s=t[r];de(s)||Nn(s)||s===""||(n[r]=s)}),n},TM=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},IP=(t,e)=>({p:e,f:TM(JSON.stringify(t))}),OP=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=Sn.Ft(yp(t)),r=(n==null?void 0:n.f)===TM(e)&&He(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},v2=(t,e)=>e+"|"+(Sn.Lt(yp(t))||""),yd={},Pb={Ot:()=>!0,Pt(t){ve.error("memoryStorage error: "+t)},Lt:t=>t in yd?yd[t]:null,Ft:t=>t in yd?yd[t]:null,$t:(t,e)=>(yd[t]=e,!0),Dt(t){delete yd[t]}};let Hc=null;const hn={Ot(){if(!Nn(Hc))return Hc;if(Hc=!0,de(ce))Hc=!1;else try{const t="__support__";hn.$t(t,"xyz"),hn.Lt(t)!=='"xyz"'&&(Hc=!1),hn.Dt(t)}catch{Hc=!1}return Hc},Pt(t){ve.error("sessionStorage error: ",t)},Lt(t){try{return ce==null?void 0:ce.sessionStorage.getItem(t)}catch(e){hn.Pt(e)}return null},Ft(t){try{return JSON.parse(hn.Lt(t))||null}catch{}return null},$t(t,e){try{return ce==null||ce.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){hn.Pt(n)}return!1},Dt(t){try{ce==null||ce.sessionStorage.removeItem(t)}catch(e){hn.Pt(e)}}};var zB=class{constructor(t){this._instance=t}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(t){this.Ll.$t(this.Nl,t?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:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get Dl(){const t=this.Ll.Lt(this.Nl);return J_(t)?1:We($H,t)?0:-1}get Ll(){const t=this.Fr.opt_out_capturing_persistence_type,e=t==="localStorage"?It:Sn,n=e.Ot()?e:Pb;if(!this.jl||this.jl!==n){this.jl=n;const r=t==="localStorage"?Sn:It;r.Lt(this.Nl)&&(this.jl.Lt(this.Nl)||this.optInOut(J_(r.Lt(this.Nl))),r.Dt(this.Nl,this.Fr.cross_subdomain_cookie))}return this.jl}Fl(){return!!this.Fr.respect_dnt&&[Jr==null?void 0:Jr.doNotTrack,Jr==null?void 0:Jr.msDoNotTrack,et.doNotTrack,Jr==null?void 0:Jr.globalPrivacyControl].some(t=>J_(t))}};function RM(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Vn(r))return e;try{const s=r(e);return dt(s)&&s?s:e}catch(s){return ve.error("Error in get_current_url, falling back to window.location.href",s),e}}function MP(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Xi(t){return!!t&&t.nodeType===1}function hr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function AM(t){return!!t&&t.nodeType===3}function Av(t){return!!t&&t.nodeType===11&&Xi(t.host)}function sk(t){return t?yf(t).split(/\s+/):[]}function NP(t,e){const n=(function(r){var s;const i=typeof window>"u"?void 0:window,o=i==null||(s=i.location)===null||s===void 0?void 0:s.href;return de(o)?void 0:RM(r,o)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function bu(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return sk(e)}function IM(t){return ot(t)?null:yf(t).split(/(\s+)/).filter(e=>Yd(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function zp(t){let e="";return Jl(t)&&!_f(t)&&t.childNodes&&t.childNodes.length&&Wt(t.childNodes,function(n){var r;AM(n)&&n.textContent&&(e+=(r=IM(n.textContent))!==null&&r!==void 0?r:"")}),yf(e)}function _p(t){var e;return de(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const ik=["a","button","form","input","select","textarea","label"];function ep(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function Tb(t,e){if(de(e))return!0;for(const n of t)if(e.some(r=>ep(n,r)))return!0;return!1}function OM(t){const e=t.parentNode;return!(!e||!Xi(e))&&e}const q0=[".ph-no-autocapture","[data-ph-no-autocapture]"],MM=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],ok=[...MM,"+","-","−","–"],LP=ok.length+10,VB=["button","a","input","select","textarea","label"],HB=["button","link","tab","menuitem","option"],DP=(t,e)=>/[a-z0-9]/i.test(e)?We(ok,e)?new RegExp(`\\b${e}\\b`).test(t):t.includes(e):t===e,UB=t=>We(VB,t.tagName.toLowerCase())||We(HB,(t.getAttribute("role")||"").toLowerCase());function y2(t){let e="",n="";const r=o=>{Xi(o)&&Jl(o)&&!_f(o)&&(e+=` ${zp(o)}`,n=n||o.getAttribute("aria-label")||"",Wt(o.childNodes,r))};r(t),e=yf(e.replace(/\s+/g," "));const s=(Yd(e)?e:"").toLowerCase(),i=t.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:yf(i).toLowerCase()}}const $P=[".ph-no-rageclick",".ph-no-capture"],BB=["","text","search","email","password","url","tel","number"];function NM(t,e){if(!(!(typeof window>"u")&&window)||ak(t))return!1;let n,r,s;var i,o;if(Ms(e)?(n=!!e&&$P,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:$P,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(c){return!(!c||!Xi(c))&&(!!hr(c,"textarea")||(hr(c,"input")?We(BB,(c.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const h=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return h==="true"||h===""})(c)))})(t))return!1;const{targetElementList:l}=LM(t,!1);return!(r&&(function(c,{safeText:d,ariaLabel:f}){let h;if(c===!0)h=MM;else{if(!He(c))return!1;if(c.length>LP)return ve.error(`[PostHog] content_ignorelist array cannot exceed ${LP} items. Use css_selector_ignorelist for more complex matching.`),!1;h=c.map(m=>m.toLowerCase())}return h.some(m=>DP(d,m)||DP(f,m))})(r,(function(c,d){for(const h of d)if(UB(h))return y2(h);for(const h of d){try{var f;if(((f=window)===null||f===void 0?void 0:f.getComputedStyle(h).getPropertyValue("cursor"))!=="pointer")break}catch{break}const m=y2(h);if(m.safeText||m.ariaLabel)return m}return y2(c)})(t,l))||Tb(l,n))}const ak=t=>!t||hr(t,"html")||!Xi(t),LM=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||ak(t))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const s=[t];let i=t;for(;i.parentNode&&!hr(i,"body");){if(Av(i.parentNode)){s.push(i.parentNode.host),i=i.parentNode.host;continue}const o=OM(i);if(!o)break;if(e||ik.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{const l=n.getComputedStyle(o);l&&l.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(o),i=o}return{parentIsUsefulElement:r,targetElementList:s}};function Jl(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!hr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=bu(i);if(We(o,"ph-sensitive")||We(o,"ph-no-capture"))return!1}if(We(bu(t),"ph-include"))return!0;const r=t.type||"";if(dt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!dt(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 _f(t){return!!(hr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||hr(t,"select")||hr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const FP=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}))$"),jP=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,ZB=[16,15,14,13],WB=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),zP=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),VP=/[0-9A-Za-z_]/;function KB(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function Yd(t,e=!0){return!(ot(t)||dt(t)&&(t=yf(t),(e?FP.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(jP.lastIndex=0;r=jP.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of ZB){const c=o+l;if(i.length>=c){const d=i.slice(o,c);if(FP.test(d)&&KB(d))return!0}}}return!1})(t))||(e?WB.test(t):(function(n){let r;for(zP.lastIndex=0;r=zP.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&VP.test(s)&&VP.test(i)))return!0}return!1})(t))))}function HP(t){let e=zp(t);return e=`${e} ${DM(t)}`.trim(),Yd(e)?e:""}function DM(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Wt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=zp(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${DM(n)}`.trim())}catch(s){ve.error("[AutoCapture]",s)}}),e}function UP(t){return t.replace(/"|\\"/g,'\\"')}function qB(t){const e=t.attr__class;if(e)return He(e)?e:sk(e)}const G0=An("[Dead Clicks]"),GB=()=>!0,YB=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(XS)),r=t.instance.config.capture_dead_clicks;return Ms(r)?r:!!ct(r)||n};var BP=class{get lazyLoadedDeadClicksAutocapture(){return this.ql}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[XS]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bl(()=>{this.zl()}):this.stop()}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?G0.error("failed to load script",s):t()})}zl(){var t;if(Me){if(!this.ql&&(!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=ct(this.instance.config.capture_dead_clicks)?V({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.ql=et.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ql.start(Me),G0.info("starting...")}}else G0.error("`document` not found. Cannot start.")}stop(){this.ql&&(this.ql.stop(),this.ql=void 0,G0.info("stopping..."))}};const Dh=An("[SegmentIntegration]");function ZP(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Vn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,c,d,f){const h=v=>{const y=()=>v.anonymousId()||wo();l.config.get_device_id=y,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:y()}),l.persistence.set_property(gs,zg)),d(f?void 0:v.anonymousId()||void 0)},m=c.user();"then"in m&&Vn(m.then)?m.then(h):h(m)})(t,s,l=>{s.register(((c,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||Dh.warn("This browser does not have Promise support, and can not use the segment integration");const h=(m,v)=>{if(!v)return m;const y=!!d&&m.event.anonymousId===d&&!m.event.userId;y||m.event.userId||m.event.anonymousId===c.get_distinct_id()||(Dh.info("No userId set, resetting PostHog"),c.reset()),y||(d=void 0),m.event.userId&&m.event.userId!==c.get_distinct_id()&&(Dh.info("UserId set, identifying with PostHog"),c.identify(m.event.userId));let _=c.calculateEventProperties(v,m.event.properties);if(!ot(f)){const b=m.event.properties||{},x={};for(const C of Object.keys(_))BS.call(b,C)||(x[C]=_[C]);const k=((C,P)=>{const R=He(C)?C:[C];let O=V({},P);for(const I of R)try{if(O=I(O),ot(O))return null}catch(A){return Dh.error("Error in Segment filterProperties:",A),null}return O})(f,x);if(ot(k))return m;_=k}return m.event.properties=Object.assign({},_,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return h(m,m.event.event)},page(m){return h(m,nk)},identify(m){return h(m,CM)},screen(m){return h(m,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},c=>{Dh.error("Failed to register the Segment integration",c),e()})},n)}const $M="posthog-js";function FM(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,c,d,f,h;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const m=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],y=v.map(x=>V(V({},x),{},{stacktrace:x.stacktrace?V(V({},x.stacktrace),{},{type:"raw",frames:(x.stacktrace.frames||[]).map(k=>V(V({},k),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((c=v[0])===null||c===void 0?void 0:c.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:y,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=v[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(h=v[0])===null||h===void 0?void 0:h.type,$sentry_tags:o.tags};var b;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((b=t.exceptions)===null||b===void 0||b.sendExceptionEvent(_)),o}}var XB=class{constructor(t,e,n,r,s,i){this.name=$M,this.setupOnce=function(o){o(FM(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},WP=class{constructor(t){this.Hl=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ve.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ul=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Wl()}Wl(){var t;this.Vl=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Hl)}destroy(){var t;(t=this.Vl)===null||t===void 0||t.call(this),this.Vl=void 0}doPageView(t,e){var n;const r=this.Gl(t,e);return this.Ul={pathname:(n=ce==null?void 0:ce.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Gl(t,(e=this.Ul)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Ul)===null||t===void 0?void 0:t.pageViewId}}Gl(t,e){const n=this.Ul;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:d,maxContentY:f}=s;if(!(de(i)||de(o)||de(l)||de(c)||de(d)||de(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f);const h=i>1?Qo(o/i,0,1,ve):1,m=i>1?Qo(l/i,0,1,ve):1,v=c>1?Qo(d/c,0,1,ve):1,y=c>1?Qo(f/c,0,1,ve):1;r=_n(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:y})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const $h=["flags","surveys"],QB={[dB]:{exposure:"hidden"},[Tv]:{exposure:"hidden"},[fB]:{exposure:"hidden"},[_b]:{exposure:"hidden"},[Gd]:{exposure:"hidden"},[mp]:{exposure:"hidden"},[oM]:{exposure:"event"},[wb]:{exposure:"hidden"},[lM]:{exposure:"hidden"},[bb]:{exposure:"event"},[aM]:{exposure:"hidden"},[xb]:{exposure:"event"},[Sb]:{exposure:"event"},[XS]:{exposure:"event"},[QS]:{exposure:"hidden"},[cM]:{exposure:"event"},[gp]:{exposure:"hidden"},[hB]:{exposure:"hidden"},[Dd]:{exposure:"hidden"},[uM]:{exposure:"event"},[pB]:{exposure:"event",shouldSkipFromEventProperties:t=>Nn(t)},[_B]:{exposure:"event"},[wB]:{exposure:"event"},[bB]:{exposure:"event"},[xB]:{exposure:"event"},[SB]:{exposure:"hidden"},[_o]:{exposure:"hidden",storageGroup:"flags"},[Va]:{exposure:"hidden",storageGroup:"flags"},[gb]:{exposure:"hidden"},[_u]:{exposure:"hidden",storageGroup:"flags"},[Zl]:{exposure:"hidden",storageGroup:"flags"},[wu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[pp]:{exposure:"hidden",storageGroup:"flags"},[Vo]:{exposure:"hidden"},[nu]:{exposure:"hidden"},[Bl]:{exposure:"hidden"},[Ul]:{exposure:"hidden"},[Jh]:{exposure:"hidden",storageGroup:"surveys"},[Pv]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[yb]:{exposure:"event"},[Fg]:{exposure:"hidden"},[jg]:{exposure:"hidden"},[kb]:{exposure:"hidden"},[kB]:{exposure:"hidden"},[EB]:{exposure:"hidden"},[CB]:{exposure:"event"},[PB]:{exposure:"event"},[TB]:{exposure:"event"},[RB]:{exposure:"event"},[qo]:{exposure:"hidden"},[Qh]:{exposure:"hidden"},[dM]:{exposure:"event"},[jp]:{exposure:"hidden"},[Ql]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[gs]:{exposure:"hidden"},[Eb]:{exposure:"hidden"},[fM]:{exposure:"hidden"},[hM]:{exposure:"hidden"},[pM]:{exposure:"hidden"},[$d]:{exposure:"hidden"},[JS]:{exposure:"hidden"},[mB]:{exposure:"event"},[gB]:{exposure:"event"},[vB]:{exposure:"event"},[yB]:{exposure:"event"},[gM]:{exposure:"event"},[vM]:{exposure:"event"},[ek]:{exposure:"hidden"},[tk]:{exposure:"hidden"},[yM]:{exposure:"hidden"},[_M]:{exposure:"hidden"},[wM]:{exposure:"hidden"},[bM]:{exposure:"hidden"},[xM]:{exposure:"hidden"},[SM]:{exposure:"hidden"},[kM]:{exposure:"hidden"},[AB]:{exposure:"event"}},JB=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Hr=t=>{const e=QB[t];if(e)return e;for(const[n,r]of JB)if(t.indexOf(n)===0)return r};function lk(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const oa=t=>{const e=typeof document>"u"?void 0:document,n=e==null?void 0:e.createElement("a");return de(n)?null:(n.href=t,n)},jM=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},zM=(t,e)=>t>=e&&jM(),VM=(t,e,n,r)=>{if(t===0){if(jM()){const s=e+1;return s===n&&r(),s}return e}return 0},jd=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Wf(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,PM(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return n4(t)}},wf=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split(/=(.*)/);if(i[0]===e){r=i;break}}if(!He(r)||2>r.length)return"";{let s=r[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch{ve.error("Skipping decoding for malformed query param: "+s)}return s}},Vp=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split(/#(.*)/),s=r[1],i=(r[0]||"").split(/\?(.*)/),o=i[1],l=i[0],c=(o||"").split("&"),d=[];for(let h=0;c.length>h;h++){const m=c[h].split("?");let v=0;for(;m.length>v&&!e.includes(m[v].split("=")[0]);)v++;d.push(m.length>v?m.slice(0,v).concat(m[v].split("=")[0]+"="+n).join("?"):c[h])}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},Iv=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},bf=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],eZ=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...bf],Hp="<masked>",tZ=["li_fat_id"];function HM(t,e,n){if(!Me)return{};const r=e?[...bf,...n||[]]:[],s=UM(Vp(Me.URL,r,Hp),t),i=(function(){const o={};return Wt(tZ,function(l){const c=vp(l);o[l]=c||null}),o})();return _n(i,s)}function UM(t,e){const n=eZ.concat(e||[]),r={};return Wt(n,function(s){const i=wf(t,s);r[s]=i||null}),r}function BM(t){const e=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Nn(e)){r.$search_engine=e;const s=Me?wf(Me.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function ZM(){return navigator.language||navigator.userLanguage}function nZ(){const t=ZM();return typeof t=="string"?t.split("-")[0]:void 0}const Ov="$direct";function WM(){return(Me==null?void 0:Me.referrer)||Ov}function KM(t,e,n=!1){const r=t?[...bf,...e||[]]:[],s=n?Xl(fn==null?void 0:fn.href):fn==null?void 0:fn.href,i=s==null?void 0:s.substring(0,1e3);return{r:WM().substring(0,1e3),u:i?Vp(i,r,Hp):void 0}}function qM(t,e=!1){var n;const{r,u:s}=t,i=e?Xl(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Ov?Ov:(n=oa(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=oa(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const c=UM(i);_n(o,c)}if(r){const l=BM(r);_n(o,l)}return o}function rZ(){try{return new Date().getTimezoneOffset()}catch{return}}const sZ={flags:Ql,surveys:Pv},iZ=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Y0=t=>`${t}_cookie_identity_change_pending`,X0=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},gr="main",Oa=[_o,Va,_u,Zl,wu,Ql,pp,Bl],_2=t=>Oa.indexOf(t)!==-1,GM=[Gd,mp],KP=t=>GM.indexOf(t)!==-1,kl=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},_d=t=>{if(!t)return{};const e=JSON.parse(t);return ct(e)?e:{}},qP=(t,e)=>{Wt(t,(n,r)=>{const s=Hr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var w2=class{constructor(t,e,n=!0,r=!t.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=t,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"})(t),this.fi=t.disable_persistence||!!e,this.Ll=this.uu(t),this.Kl=this.cu(t),this.load(r),this.hu(),t.debug&&ve.info("Persistence loaded",t.persistence,V({},this.props)),this.update_config(t,t,e),this.save(),ce){const s=()=>this.flush();Lt(ce,"beforeunload",s,{capture:!1}),Lt(ce,"pagehide",s,{capture:!1}),this.du=i=>{if(this.Jl&&(!i.storageArea||i.storageArea===(ce==null?void 0:ce.localStorage))&&i.key)if(i.key!==this.lu){if(this.Kl){const o=$h.find(l=>i.key===this.vu(l));o&&this.fu(i.key,o)}}else this.fu(i.key,gr)},Lt(ce,"storage",this.du)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.tu.get(e);if(!_2(e)||r===!0)return;if(n===!0)return void this.pu(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.pu(e,s)})}onCrossTabFeatureFlagChange(t){return this.ru.add(t),()=>this.ru.delete(t)}destroy(){this.du&&ce&&(ce.removeEventListener("storage",this.du),this.du=void 0),this.ru.clear()}fu(t,e,n=!0){if(this.fi)return!1;let r,s;try{if(s=It.Lt(t),Nn(s)){const l=this.gu(e);return l.storageValue=null,e!==gr&&(l.persisted=!1),!1}r=_d(s)}catch{return!1}const i=e===gr?r:It.Ft(this.lu);if(i&&this.mu(i))return!1;const o=this.yu(r,e,n);return e===gr&&this.Kl&&!kl(this.bu().main,r)||this._u(r,e,!0,s),o}mu(t){const e=this.props[Bi],n=t[Bi];return!de(e)&&!de(n)&&e!==n}_u(t,e,n,r){const s=this.gu(e);s.storageValue=r,e!==gr&&(s.persisted=n);try{s.fingerprint=this.wu(t,e)}catch{s.fingerprint=void 0}}yu(t,e,n){let r=!1;return Oa.forEach(s=>{var i;const o=(i=Hr(s))===null||i===void 0?void 0:i.storageGroup;if(e===gr&&this.Kl&&o||e!==gr&&o!==e)return;const l=s in t,c=this.ku(s,l?t[s]:void 0),d=this.tu.has(s)?s in this.props:l;d===s in this.props&&kl(c,this.props[s])||(d?this.Su(s,c,!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 t=It.Lt(this.lu),e=this.gu(gr);let n,r=!1,s=!1;if(t!==e.storageValue)if(Nn(t))e.storageValue=null;else{if(n=_d(t),this.nu=!this.iu&&this.mu(n),this.nu)return!1;s=this.yu(n,gr,!1),!this.Kl||kl(this.bu().main,n)?this._u(n,gr,!0,t):e.storageValue=t,r=!0}return this.Kl&&$h.forEach(i=>{const o=It.Lt(this.vu(i)),l=this.gu(i),c=n||{},d=r&&Oa.some(h=>{var m;return((m=Hr(h))===null||m===void 0?void 0:m.storageGroup)===i&&h in c});if(o===l.storageValue&&!d)return;if(Nn(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this.yu(c,i,!1)||s));const f=_d(o);s=this.yu(f,i,!1)||s,this._u(f,i,!0,o)}),s}catch{return!1}}pu(t,e){this.tu.set(t,e);const n=Hr(t);n!=null&&n.volatile||(this.gu((this.Kl?n==null?void 0:n.storageGroup:void 0)||gr).fingerprint=void 0,this.Cu(t))}Tu(){Oa.forEach(t=>this.tu.set(t,!0))}hu(){if(this.Jl)try{const t=It.Lt(this.lu),e=_d(t);this.gu(gr).storageValue=t,Oa.forEach(n=>{var r;const s=this.Kl?(r=Hr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?It.Lt(this.vu(s)):null;if(s){const l=this.gu(s);l.storageValue=i,l.persisted=!Nn(i)}const o=s&&!Nn(i)?_d(i):e;n in this.props?this.Iu(n,o[n],this.props[n]):n in o&&this.pu(n,!0)})}catch{}}ku(t,e){const n=this.tu.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(He(e)?e:[]),o=new Set(He(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=ct(e)?V({},e):{},s=ct(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Iu(t,e,n){if(!_2(t))return;const r=this.tu.get(t);if(r===!0)return;let s=e;if(this.Jl)try{var i;const l=this.Kl?(i=Hr(t))===null||i===void 0?void 0:i.storageGroup:void 0,c=l?this.vu(l):this.lu;s=_d(It.Lt(c))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!de(e)&&!He(e)||!de(s)&&!He(s)||!He(n))return void this.pu(t,!0);const l=new Set(e||[]),c=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(f=>{l.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{c.has(f)===d.has(f)&&o.delete(f)})}else{if(!ct(n))return void(kl(s,n)?this.tu.delete(t):this.pu(t,!0));{if(!de(e)&&!ct(e)||de(e)&&Ks(n)&&de(s))return void this.pu(t,!0);const l=ct(e)?e:{},c=ct(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&kl(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in c==d in n&&kl(c[d],n[d])&&o.delete(d)})}}o.size?this.pu(t,o):this.tu.delete(t)}Mu(){var t;const e=(t=this.Fr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Yn(e)&&e>0?e:0}Eu(t){if(this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=g2(t,this.Fr.cookie_persisted_properties||[]),n=IP(e,this.Fr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=Sn.Lt(this.lu)||void 0;s&&v2(this.lu,s)===r&&(this.Au=r,this.Ru=s)}catch{}else try{const e=Sn.Lt(this.lu)||void 0;this.Au=e?v2(this.lu,e):void 0,this.Ru=e}catch{}}syncCookieProperties(){return this.Pu(this.Fr)}Pu(t,e=!1){if(this.fi&&!e||this.Xl||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=Sn.Lt(this.lu)||void 0}catch{}if(!n||n===this.Ru)return!1;const r=v2(this.lu,n);let s;try{s=m2(JSON.parse(n))}catch{return!1}if((Sn.Lt(this.lu)||void 0)!==n)return!1;this.Au=r,this.Ru=n;const i=OP(this.lu,n),o=[...ru,...i.properties],l={};if(Object.keys(s).forEach(_=>{const b=s[_];(de(b)||Nn(b)||b===""||_==="$user_state"&&b!=="anonymous"&&b!=="identified")&&(l[_]=!0,delete s[_])}),Ks(s))return!1;const c="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[Bi],h=d[gs],m=_n({},d);[...ru,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(c||_!=="distinct_id"&&_!=="$user_state")){const b=m[_];(i.isValid||ru.indexOf(_)===-1||b!==!1&&b!==0)&&delete m[_]}}),this.props=_n(m,s),Oa.forEach(_=>{const b=_ in this.props;_ in d===b&&kl(d[_],this.props[_])||(b?this.Iu(_,d[_],this.props[_]):this.pu(_,!0))}),!c||"$user_state"in s||"$user_state"in this.props||this.Su(gs,Ha);const v=this.props[Bi],y=this.props[gs];return!c||v===f&&y===h||(this.iu=!0,this.Yl=!0,hn.$t(Y0(this.lu),!0),this.xu(Bl),this.xu(Va),this.xu(_o),this.xu(_u),this.xu(Zl),this.xu(wu),this.xu(Ql),this.xu(jp),this.xu(qo),y!=="anonymous"||h!=="identified"&&s.$user_state!=="anonymous"&&(de(f)||v===f)||(qP(this.props,s),this.xu(Ul)),y==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.xu(Tv)),!0}consumeCookieIdentityChange(){const t=Y0(this.lu),e=this.Yl||!!hn.Lt(t);return this.Yl=!1,e&&hn.Dt(t),e}Ou(t=!1){return!(this.Xl||this.fi&&!t||!this.Fr.cookieWinsOnConflict||this.Fr.persistence.toLowerCase()!=="localstorage+cookie"||(this.Xl=!0,0))}Fu(){this.Xl&&(de(this.Du)||(clearTimeout(this.Du),this.Du=void 0),delete this.Ql[gr],this.Lu(!0))}Nu(t=!0){if(this.Xl)try{t?this.Fu():de(this.Du)||(clearTimeout(this.Du),this.Du=void 0)}finally{this.Xl=!1}}isDisabled(){return!!this.fi}uu(t){iZ.indexOf(t.persistence.toLowerCase())===-1&&(ve.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,c=()=>!1)=>{const d=[...ru,...o];return V(V({},It),{},{ju(f){return[Sn.Lt(f),Sn.Lt(yp(f)),It.Lt(f)].join("\0")},Ft(f){try{let m,v={};try{m=Sn.Lt(f)||void 0,v=m?m2(JSON.parse(m)):{}}catch{}const y=JSON.parse(It.Lt(f)||"{}");let _;if(l){const b=OP(f,m),x=[...ru,...b.properties],k={};Object.keys(v).forEach(P=>{const R=v[P];Nn(R)||R===""||P==="$user_state"&&R!=="anonymous"&&R!=="identified"||(k[P]=R)});const C="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var h;const P=y[Bi],R=(h=y.$user_state)!==null&&h!==void 0?h:Ha;d.forEach(O=>{if(x.indexOf(O)!==-1&&!(O in v)&&(C||O!=="distinct_id"&&O!=="$user_state")){const I=y[O];(b.isValid||ru.indexOf(O)===-1||I!==!1&&I!==0)&&delete y[O]}}),!C||"$user_state"in v||"$user_state"in y||(y[gs]=Ha),!C||("distinct_id"in k?k[Bi]:y[Bi])===P&&("$user_state"in k?k[gs]:y[gs])===R||(p2.forEach(O=>delete y[O]),k.$user_state==="identified"&&"distinct_id"in k?y.$user_id=k[Bi]:delete y.$user_id,k.$user_state!=="identified"&&(delete y[dM],delete y[Ul]),delete y.__alias)}_=_n(y,k)}else _=_n(v,y);return c()||It.$t(f,_),_}catch{}return null},$t(f,h,m,v,y,_){const b=It.$t(f,h,void 0,void 0,_);try{const x=g2(h,o);if(Object.keys(x).length){if(l){const k=yp(f),C=IP(x,o);if(Sn.$t(k,C,m,v,y,_),Sn.Lt(k)!==JSON.stringify(C)){Sn.Dt(k,v);const P=g2(h);return Sn.$t(f,P,m,v,y,_),b}}Sn.$t(f,x,m,v,y,_)}}catch(x){It.Pt(x)}return b},Dt(f,h){try{ce==null||ce.localStorage.removeItem(f),Sn.Dt(f,h),Sn.Dt(yp(f),h)}catch(m){It.Pt(m)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.fi);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&It.Ot()?(n=It,s=!0):i==="localstorage+cookie"&&e.Ot()?(n=e,s=!0,r=!0):i==="sessionstorage"&&hn.Ot()?n=hn:i==="memory"?n=Pb:i==="cookie"&&Sn.Ot()?(n=Sn,r=!0):e.Ot()?(n=e,s=!0,r=!0):Sn.Ot()?(n=Sn,r=!0):n=Pb,this.Jl=s,this.Zl=r,n}vu(t){return`${this.lu}__${t}`}cu(t){return this.Jl&&!!t.split_storage}properties(){const t={};return Wt(this.props,(e,n)=>{const r=Hr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.fi&&!t)return;const e=this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie",n=e?It.Ft(this.lu):null;let r={};if(e)try{r=m2(Sn.Ft(this.lu)),Wt(r,(l,c)=>{(de(l)||Nn(l)||l==="")&&delete r[c]})}catch{}const s=this.Ll.Ft(this.lu);if(s&&(this.props=_n({},s)),this.Kl&&this.qu(),e&&s){var i,o;const l=n==null?void 0:n[Bi],c=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Ha,d=s[Bi],f=(o=s.$user_state)!==null&&o!==void 0?o:Ha;if(d!==l||f!==c){this.Yl=!0,this.fi||hn.$t(Y0(this.lu),!0);const h=_n({},this.props);p2.forEach(v=>delete h[v]),f!=="anonymous"||c!=="identified"&&r.$user_state!=="anonymous"&&(de(l)||d===l)||(qP(h,r),delete h[Ul]),this.props=h;const m=new Set;p2.forEach(v=>{var y;const _=(y=Hr(v))===null||y===void 0?void 0:y.storageGroup;_&&m.add(_)}),m.forEach(v=>{if(this.fi)return;const y={};Wt(this.props,(_,b)=>{var x;((x=Hr(b))===null||x===void 0?void 0:x.storageGroup)===v&&(y[b]=_)}),Ks(y)?(It.Dt(this.vu(v)),this.Ql[v]={}):It.$t(this.vu(v),y)&&(this.Ql[v]={persisted:!0,fingerprint:this.wu(y,v)})})}}hn.Lt(Y0(this.lu))&&(this.Yl=!0)}qu(){for(const t of $h){const e=It.Ft(this.vu(t));if(e&&!Ks(e)){const n=this.gu(t);n.persisted=!0,this.Bu(t)||(n.fingerprint=this.wu(e,t)),this.zu(t,e)||_n(this.props,e)}}}Bu(t){return Object.keys(this.props).some(e=>{var n;return((n=Hr(e))===null||n===void 0?void 0:n.storageGroup)===t})}zu(t,e){const n=sZ[t];if(!n)return!1;const r=e[n],s=this.props[n];return Yn(r)&&Yn(s)&&s>r}refreshKey(t){this.Hu([t])}Hu(t){if(this.fi)return;let e,n=!1;const r=()=>(n||(e=this.Ll.Ft(this.lu),n=!0),e);t.forEach(s=>{var i;if(this.su.has(s))return;const o=this.Kl?(i=Hr(s))===null||i===void 0?void 0:i.storageGroup:void 0,l=o?It.Ft(this.vu(o)):r();if(l&&s in l)this.Su(s,l[s],!1);else{if(o){const c=r();if(c&&s in c)return void this.Su(s,c[s],!1)}this.xu(s,!1)}})}refreshMetaIdentifiers(){if(this.fi)return;const t=this.Uu();(de(t)||t!==this.Wu)&&(this.Hu(GM),this.Vu(t))}Vu(t=this.Uu()){this.Wu=this.su.size===0?t:void 0}Uu(){const t=this.Ll.ju?this.Ll.ju(this.lu):this.Ll.Lt(this.lu);return dt(t)?t:void 0}save(){if(this.fi)return;const t=this.Mu();t>0?de(this.Du)&&(this.Du=setTimeout(()=>{this.Du=void 0,this.Lu()},t)):this.Lu()}flush(){de(this.Du)||(clearTimeout(this.Du),this.Du=void 0,this.Lu())}Lu(t=!1){if(this.fi||this.Xl&&!t)return;t||(this.syncCookieProperties(),this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie"||this.refreshMetaIdentifiers());const e=!t&&!this.eu;e||(this.nu=!1);const n=!!e&&this.$u();if(this.nu)return void(this.Fr.debug&&ve.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,gr);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:t,groups:e}=this.bu(),n=this.Qu(this.Ll,this.lu,t,gr);n==="written"&&this.Eu(t),n!=="failed"&&(this.iu=!1,this.su.clear(),Oa.forEach(s=>{var i;!((i=Hr(s))===null||i===void 0)&&i.storageGroup||this.tu.delete(s)})),n==="written"&&this.Vu();for(const s of $h){var r;const i=e[s];if(Ks(i)&&!(!((r=this.Ql[s])===null||r===void 0)&&r.persisted)){Oa.forEach(l=>{var c;((c=Hr(l))===null||c===void 0?void 0:c.storageGroup)===s&&this.tu.delete(l)});continue}const o=this.Qu(It,this.vu(s),i,s);o!=="failed"&&Oa.forEach(l=>{const c=Hr(l);(c==null?void 0:c.storageGroup)!==s||o!=="written"&&c.volatile||this.tu.delete(l)})}}bu(){const t={},e={flags:{},surveys:{}};return Wt(this.props,(n,r)=>{var s;const i=(s=Hr(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}wu(t,e){if(e===gr)return JSON.stringify(t)+"|"+this.Ju+"|"+this.Zu+"|"+this.Ku;const n={};return Wt(t,(r,s)=>{var i;n[s]=!((i=Hr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Qu(t,e,n,r){const s=this.gu(r);if(r!==gr&&!s.dirty&&!de(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 t.$t(e,n,this.Ju,this.Zu,this.Ku,this.Fr.debug)?(s.dirty=!1,r!==gr&&(s.persisted=!0),de(i)||(s.fingerprint=i),this.Jl&&(s.storageValue=It.Lt(e)),"written"):(this.Fr.debug&&ve.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Tu(),de(this.Du)||(clearTimeout(this.Du),this.Du=void 0),this.Ll.Dt(this.lu,!1),this.Ll.Dt(this.lu,!0),!t&&this.ou)for(const e of $h)It.Dt(this.vu(e));t?delete this.Ql[gr]:this.Ql={},this.Au=void 0,this.Ru=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(ct(t)){this.syncCookieProperties(),de(e)&&(e="None"),this.Ju=de(n)?this.Yu:n;let r=!1;if(Wt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Su(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(ct(t)){this.syncCookieProperties(),this.Ju=de(e)?this.Yu:e;let n=!1;if(Wt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||ct(r)||He(r))&&(this.Su(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.xu(r),n=!0);n&&this.save()}update_campaign_params(){const t=Me==null?void 0:Me.URL;if(t===this.au)return;const e=HM(this.Fr.custom_campaign_params,this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties),n=!Ks(rk(e));return n&&this.register(e),this.au=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=Me==null?void 0:Me.referrer;return t?BM(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:WM(),$referring_domain:(Me==null?void 0:Me.referrer)&&((t=oa(Me.referrer))===null||t===void 0?void 0:t.host)||Ov},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=KM(this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties,this.Fr.disable_capture_url_hashes);this.register_once({[$d]:this.Zl?{r:X0(t.r),u:t.u?X0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Wt([pM,hM],n=>{const r=this.props[n];r&&Wt(r,function(s,i){t["$initial_"+ib(i)]=s})});const e=this.props[$d];if(e){const n=(function(r,s=!1){const i=qM(r,s),o={};return Wt(i,function(l,c){o[`$initial_${ib(c)}`]=l}),o})(e,this.Fr.disable_capture_url_hashes);_n(t,n)}return t}safe_merge(t){return Wt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,y)=>{if(v.length!==y.length)return!1;const _=[...v].sort(),b=[...y].sort();return _.every((x,k)=>x===b[k])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,c=!!this.fi&&!l;l||this.Pu(e,c),this.Fr=t,!l&&(r||s||o)&&(this.Au=void 0,this.Ru=void 0,this.Pu(V(V({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),c));const d=i||o?this.uu(t):this.Ll;this.Xu();const f=this.cu(t),h=i||f!==this.Kl,m=!l&&(h||t.cross_subdomain_cookie!==this.Zu||t.secure_cookie!==this.Ku)&&this.Ou(c);this.eu=h;try{if(this.Yu=this.Ju=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),h){const v=this.props;this.clear(),this.Ll=d,this.Kl=f,this.props=v,this.save()}else o&&(this.Ll=d,l||(delete this.Ql[gr],this.Lu()))}finally{this.eu=!1,m&&this.Nu()}}Xu(){const t=this.props[$d];if(!this.Zl||!ct(t)||typeof t.r!="string")return;const e=X0(t.r),n=typeof t.u=="string"?X0(t.u):t.u;e===t.r&&n===t.u||this.Su($d,V(V({},t),{},{r:e,u:n}))}set_disabled(t){this.fi=t,this.fi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Zu&&(this.Zu=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ku&&(this.Ku=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.Su(_b,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return de(n)||(delete e[t],this.Su(_b,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.Su(t,e),this.save()}Su(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.iu=!0),KP(t)&&!kl(s,e)&&this.su.add(t),this.Iu(t,s,e),!((r=Hr(t))===null||r===void 0)&&r.volatile||this.Cu(t))}xu(t,e=!0){delete this.props[t],e&&(_2(t)&&this.pu(t,!0),KP(t)&&this.su.add(t),this.Cu(t))}Cu(t){var e;const n=(e=Hr(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.gu(n).dirty=!0)}gu(t){return this.Ql[t]||(this.Ql[t]={})}};const _i={GZipJS:"gzip-js",Base64:"base64"},Fh={Activation:"events",Cancellation:"cancelEvents"},b2={Popover:"popover",API:"api",Widget:"widget"},yi={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},x2={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Rb={Popover:"popover",Inline:"inline"};function Q0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Vn(n.then)&&n.then(void 0,()=>{})}}}}const oZ={SHOWN:"product tour shown"},GP={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},YP=An("[RateLimiter]");var aZ=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{YP.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void YP.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.tc().tokens}clientRateLimitContext(t=!1){var e;const n=this.tc(),r=1>n.tokens;if(r||t||(n.tokens=Math.max(0,n.tokens-1)),r&&!t){const s=(Yn(n.dropped)?n.dropped:0)+1;n.dropped=s,!this.lastEventRateLimited&&this.ec(s)&&(n.dropped=0)}return this.lastEventRateLimited=r,(e=this.instance.persistence)===null||e===void 0||e.set_property("$capture_rate_limit",n),{isRateLimited:r,remainingTokens:n.tokens}}tc(){var t;const{captureEventsBurstLimit:e,captureEventsPerSecond:n}=this,r=new Date().getTime(),s=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(fM),i=s?V({},s):{tokens:e,last:r};return i.tokens+=Math.max(0,r-i.last)/1e3*n,i.last=Math.max(i.last,r),i.tokens>e&&(i.tokens=e),i}nc(t){const e=this.instance.config.property_denylist;return!He(e)||!e.includes(t)}sc(){var t;if(this.nc("$current_url")&&this.nc("$pathname")&&(fn!=null&&fn.pathname))return`${(t=fn.origin)!==null&&t!==void 0?t:""}${fn.pathname}`}ec(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.sc(),o=this.nc("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const El=An("[RemoteConfig]");var YM=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=et._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}rc(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}oc(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return El.info("Using preloaded remote config",this.remoteConfig),void this.ac(this.remoteConfig);if(this._instance.lc())return void El.warn("Remote config is disabled. Falling back to local config.");this.rc(t=>{if(!t)return El.info("No config found after loading remote JS config. Falling back to JSON."),void this.oc(e=>{this.ac(e.json,e)});this.ac(t)})}catch(t){El.error("Error loading remote config",t),this.ac()}}ac(t,e){!t&&e&&(e.statusCode===0?e.error||El.warn("Failed to fetch remote config from PostHog."):El.error("Failed to fetch remote config from PostHog."));try{this._instance.ac(t?{ok:!0,config:t}:{ok:!1})}catch(r){El.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){El.error("Error loading feature flags",r)}}},Qi=Uint8Array,Gs=Uint16Array,xf=Uint32Array,ck=new Qi([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]),uk=new Qi([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]),XP=new Qi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),XM=function(t,e){for(var n=new Gs(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new xf(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]},QM=XM(ck,2),Ab=QM[1];QM[0][28]=258,Ab[258]=28;for(var QP=XM(uk,0)[1],JM=new Gs(32768),Ln=0;32768>Ln;++Ln){var wd=(43690&Ln)>>>1|(21845&Ln)<<1;JM[Ln]=((65280&(wd=(61680&(wd=(52428&wd)>>>2|(13107&wd)<<2))>>>4|(3855&wd)<<4))>>>8|(255&wd)<<8)>>>1}var wp=function(t,e,n){for(var r=t.length,s=0,i=new Gs(e);r>s;++s)++i[t[s]-1];var o,l=new Gs(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Gs(r),s=0;r>s;++s)o[s]=JM[l[t[s]-1]++]>>>15-t[s];return o},Mu=new Qi(288);for(Ln=0;144>Ln;++Ln)Mu[Ln]=8;for(Ln=144;256>Ln;++Ln)Mu[Ln]=9;for(Ln=256;280>Ln;++Ln)Mu[Ln]=7;for(Ln=280;288>Ln;++Ln)Mu[Ln]=8;var Mv=new Qi(32);for(Ln=0;32>Ln;++Ln)Mv[Ln]=5;var lZ=wp(Mu,9),cZ=wp(Mv,5),e5=function(t){return(t/8|0)+(7&t&&1)},t5=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Gs?Gs:t instanceof xf?xf:Qi)(n-e);return r.set(t.subarray(e,n)),r},Ea=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},jh=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},S2=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new Qi(0),0];if(s==1){var o=new Qi(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(R,O){return R.f-O.f}),n.push({s:-1,f:25001});var l=n[0],c=n[1],d=0,f=1,h=2;for(n[0]={s:-1,f:l.f+c.f,l,r:c};f!=s-1;)l=n[n[h].f>n[d].f?d++:h++],c=n[d!=f&&n[h].f>n[d].f?d++:h++],n[f++]={s:-1,f:l.f+c.f,l,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var v=new Gs(m+1),y=Ib(n[f-1],v,0);if(y>e){r=0;var _=0,b=y-e,x=1<<b;for(i.sort(function(R,O){return v[O.s]-v[R.s]||R.f-O.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;_+=x-(1<<y-v[k]),v[k]=e}for(_>>>=b;_>0;){var C=i[r].s;e>v[C]?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var P=i[r].s;v[P]==e&&(--v[P],++_)}y=e}return[new Qi(v),y]},Ib=function(t,e,n){return t.s==-1?Math.max(Ib(t.l,e,n+1),Ib(t.r,e,n+1)):e[t.s]=n},JP=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Gs(++e),r=0,s=t[0],i=1,o=function(c){n[r++]=c},l=1;e>=l;++l)if(t[l]==s&&l!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[l]}return[n.subarray(0,r),e]},zh=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Ob=function(t,e,n){var r=n.length,s=e5(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},e3=function(t,e,n,r,s,i,o,l,c,d,f){Ea(e,f++,n),++s[256];for(var h=S2(s,15),m=h[0],v=h[1],y=S2(i,15),_=y[0],b=y[1],x=JP(m),k=x[0],C=x[1],P=JP(_),R=P[0],O=P[1],I=new Gs(19),A=0;k.length>A;++A)I[31&k[A]]++;for(A=0;R.length>A;++A)I[31&R[A]]++;for(var M=S2(I,7),L=M[0],z=M[1],$=19;$>4&&!L[XP[$-1]];--$);var q,X,j,K,ee=d+5<<3,H=zh(s,Mu)+zh(i,Mv)+o,Q=zh(s,m)+zh(i,_)+o+14+3*$+zh(I,L)+(2*I[16]+3*I[17]+7*I[18]);if(H>=ee&&Q>=ee)return Ob(e,f,t.subarray(c,c+d));if(Ea(e,f,1+(H>Q)),f+=2,H>Q){q=wp(m,v),X=m,j=wp(_,b),K=_;var B=wp(L,z);for(Ea(e,f,C-257),Ea(e,f+5,O-1),Ea(e,f+10,$-4),f+=14,A=0;$>A;++A)Ea(e,f+3*A,L[XP[A]]);f+=3*$;for(var D=[k,R],G=0;2>G;++G){var fe=D[G];for(A=0;fe.length>A;++A)Ea(e,f,B[ie=31&fe[A]]),f+=L[ie],ie>15&&(Ea(e,f,fe[A]>>>5&127),f+=fe[A]>>>12)}}else q=lZ,X=Mu,j=cZ,K=Mv;for(A=0;l>A;++A)if(r[A]>255){var ie;jh(e,f,q[257+(ie=r[A]>>>18&31)]),f+=X[ie+257],ie>7&&(Ea(e,f,r[A]>>>23&31),f+=ck[ie]);var ue=31&r[A];jh(e,f,j[ue]),f+=K[ue],ue>3&&(jh(e,f,r[A]>>>5&8191),f+=uk[ue])}else jh(e,f,q[r[A]]),f+=X[r[A]];return jh(e,f,q[256]),f+X[256]},uZ=new xf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),dZ=(function(){for(var t=new xf(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),k2=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function fZ(t,e){e===void 0&&(e={});var n=(function(){var h=4294967295;return{p(m){for(var v=h,y=0;m.length>y;++y)v=dZ[255&v^m[y]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=t.length;n.p(t);var s,i,o,l,c,d=(l=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(h,m,v,y,_,b){var x=h.length,k=new Qi(y+x+5*(1+Math.floor(x/7e3))+_),C=k.subarray(y,k.length-_),P=0;if(!m||8>x)for(var R=0;x>=R;R+=65535){var O=R+65535;x>O?P=Ob(C,P,h.subarray(R,O)):(C[R]=b,P=Ob(C,P,h.subarray(R,x)))}else{for(var I=uZ[m-1],A=I>>>13,M=8191&I,L=(1<<v)-1,z=new Gs(32768),$=new Gs(L+1),q=Math.ceil(v/3),X=2*q,j=function(Ct){return(h[Ct]^h[Ct+1]<<q^h[Ct+2]<<X)&L},K=new xf(25e3),ee=new Gs(288),H=new Gs(32),Q=0,B=0,D=(R=0,0),G=0,fe=0;x>R;++R){var ie=j(R),ue=32767&R,he=$[ie];if(z[ue]=he,$[ie]=ue,R>=G){var we=x-R;if((Q>7e3||D>24576)&&we>423){P=e3(h,C,0,K,ee,H,B,D,fe,R-fe,P),D=Q=B=0,fe=R;for(var le=0;286>le;++le)ee[le]=0;for(le=0;30>le;++le)H[le]=0}var se=2,be=0,Se=M,$e=ue-he&32767;if(we>2&&ie==j(R-$e))for(var kt=Math.min(A,we)-1,tn=Math.min(32767,R),nn=Math.min(258,we);tn>=$e&&--Se&&ue!=he;){if(h[R+se]==h[R+se-$e]){for(var xt=0;nn>xt&&h[R+xt]==h[R+xt-$e];++xt);if(xt>se){if(se=xt,be=$e,xt>kt)break;var Dt=Math.min($e,xt-2),un=0;for(le=0;Dt>le;++le){var Kt=R-$e+le+32768&32767,Le=Kt-z[Kt]+32768&32767;Le>un&&(un=Le,he=Kt)}}}$e+=(ue=he)-(he=z[ue])+32768&32767}if(be){K[D++]=268435456|Ab[se]<<18|QP[be];var Qe=31&Ab[se],Ae=31&QP[be];B+=ck[Qe]+uk[Ae],++ee[257+Qe],++H[Ae],G=R+se,++Q}else K[D++]=h[R],++ee[h[R]]}}P=e3(h,C,b,K,ee,H,B,D,fe,R-fe,P)}return t5(k,0,y+e5(P)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,c,!0)),f=d.length;return(function(h,m){var v=m.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>m.level?4:m.level==9?2:0,h[9]=3,m.mtime!=0&&k2(h,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),v){h[3]=8;for(var y=0;v.length>=y;++y)h[y+10]=v.charCodeAt(y)}})(d,e),k2(d,f-8,n.d()),k2(d,f-4,r),d}const hZ=!!US||!!Dp,n5=new WeakMap,r5="text/plain";let E2=0,Hg=!1;const s5=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},N1=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=V({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[h,m]=d.split("="),v=n&&(f=o[h])!==null&&f!==void 0?f:m;return delete o[h],`${h}=${v}`}))!==null&&r!==void 0?r:[],c=(function(d,f="&"){let h,m;const v=[];return Wt(d,function(y,_){de(y)||de(_)||_==="undefined"||(h=encodeURIComponent((b=>b instanceof File)(y)?y.name:y.toString()),m=encodeURIComponent(_),v[v.length]=m+"="+h)}),v.join(f)})(o);return c&&l.push(c),l.length>0?`${s}?${l.join("&")}`:s},C2=t=>{if(t.cr)return t.cr;const{data:e,compression:n}=t;if(!e)return;if(n===_i.GZipJS){const s=fZ((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Qi(i.length+(i.length>>>1)),c=0,d=function(v){l[c++]=v},f=0;o>f;++f){if(c+5>l.length){var h=new Qi(c+8+(o-f<<1));h.set(l),l=h}var m=i.charCodeAt(f);128>m?d(m):2048>m?(d(192|m>>>6),d(128|63&m)):m>55295&&57344>m?(d(240|(m=65536+(1047552&m)|1023&i.charCodeAt(++f))>>>18),d(128|m>>>12&63),d(128|m>>>6&63),d(128|63&m)):(d(224|m>>>12),d(128|m>>>6&63),d(128|63&m))}return t5(l,0,c)})(jd(e)),{mtime:0});return{contentType:r5,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===_i.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,c)=>String.fromCharCode(parseInt(c,16))))})(jd(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:jd(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=jd(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},i5=t=>{const e=()=>t.transport==="sendBeacon"?{url:N1(t.url,{compression:_i.Base64}),encodedBody:C2(V(V({},t),{},{compression:_i.Base64,cr:void 0}))}:{url:s5(t.url,"compression"),encodedBody:C2(V(V({},t),{},{compression:void 0,cr:void 0}))};let n;try{n=C2(t)}catch(s){if(gP(t.compression,wf(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&gP(t.compression,wf(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?fb(new Uint8Array(r)):ArrayBuffer.isView(r)&&fb(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Hg=!0,e()):{url:t.url,encodedBody:n};var r},o5=t=>{try{return i5(t)}catch(n){var e;return ve.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},pZ=(function(){var t=pn(function*(e){const n=yield(function(s){return hb.apply(this,arguments)})(jd(e.data),Ws.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return V(V({},e),{},{cr:{contentType:r5,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),a5=t=>D4("AbortError","PostHog request timed out"+(t?` after ${t}ms`:"")),mZ=/Failed to fetch|NetworkError|Load failed/i,l5=t=>(t==null?void 0:t.name)==="TypeError"&&mZ.test((t==null?void 0:t.message)||""),c5=t=>{try{const e=(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 l=/^\w{3} \w{3} /.test(o)?o+" GMT":o,c=Date.parse(l)-r;return Number.isFinite(c)&&c>0?Math.min(c,s):void 0})(t());return de(e)?void 0:Math.min(e,3e4)}catch{return}},u5=t=>{const e=o5(t);if(!e)return;const n=new US;n5.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Wt(t.headers,function(c,d){n.setRequestHeader(d,c)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout);let l=!1;n.ontimeout=()=>{l=!0},n.onloadend=()=>{var c;if(l){var d;const h=a5(t.timeout);return ve.warn(h),void((d=t.callback)===null||d===void 0||d.call(t,{statusCode:0,error:h}))}const f={statusCode:n.status,text:n.responseText};if(n.status===200)try{f.json=JSON.parse(n.responseText)}catch{}(c=t.callback)===null||c===void 0||c.call(t,f,c5(()=>n.getResponseHeader("Retry-After")))},n.send(o)},d5=t=>{const e=o5(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Wt(t.headers,function(y,_){l.append(_,y)}),s&&l.append("Content-Type",s);let c=null,d=!1;if(J8){const y=new J8;c={signal:y.signal,timeout:setTimeout(()=>{d=!0;try{y.abort(a5(t.timeout))}catch(_){h(_)}},t.timeout)}}let f=!1;const h=y=>{var _;f||(f=!0,d&&(y==null?void 0:y.name)==="AbortError"||l5(y)?ve.warn(y):ve.error(y),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:y}))};let m=0;const v=()=>{E2-=m,m=0,c&&clearTimeout(c.timeout)};try{const y=V({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:c==null?void 0:c.signal},t.fetchOptions),_=o??(de(i)?0:void 0);y.keepalive=y.method==="POST"&&!t.Ol&&y.keepalive!==!1&&y.body===i&&!de(_)&&_>=0&&52428.8>E2+_,y.keepalive&&(m=_,E2+=m),Dp(n,y).then(b=>b.text().then(x=>{var k;if(f)return;const C={statusCode:b.status,text:x};if(b.status===200)try{C.json=JSON.parse(x)}catch(P){ve.error(P)}f=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,C,c5(()=>b.headers.get("Retry-After")))})).catch(b=>{v(),h(b)}).finally(v)}catch(y){v(),h(y)}},Mb=t=>{try{var e;const{url:n,encodedBody:r}=i5(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Jr.sendBeacon(n,l))return;const c=He(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(He(c)&&c.length>1&&(o??0)>16384){const d=Math.ceil(c.length/2),f=h=>He(t.data)?h:V(V({},t.data),{},{batch:h});return Mb(V(V({},t),{},{data:f(c.slice(0,d))})),void Mb(V(V({},t),{},{data:f(c.slice(d))}))}ve.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${Dp?"fetch":"XHR"}`),Dp?d5(V(V({},t),{},{Ol:!0})):u5(t)}catch(n){ve.warn("Beacon send failed",n)}},t3=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return N1(n===_i.GZipJS?s5(t,"compression"):t,V(V({},s?{[s]:Date.now().toString()}:{}),n===_i.GZipJS?{}:{compression:n}))},gZ=(()=>{const t=[];return Dp&&t.push({transport:"fetch",method:d5}),US&&t.push({transport:"XHR",method:u5}),Jr!=null&&Jr.sendBeacon&&t.push({transport:"sendBeacon",method:Mb}),t})();let f5=!hZ&&(Is==null?void 0:Is.indexOf("MSIE"))===-1&&(Is==null?void 0:Is.indexOf("Mozilla"))===-1;function h5(t,e,n){var r,s,i,o;n&&(e=V(V({},e),{},{callback:l=>n(l)})),t.__loaded?f5?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=V(V({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(de(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,(s=e.onDispatch)===null||s===void 0||s.call(e),((l,c)=>{var d,f,h;const m=V(V({},l),{},{callback:c??(x=>{var k;return(k=l.callback)===null||k===void 0?void 0:k.call(l,x)})});m.timeout=m.timeout||6e4;const v=(d=m.transport)!==null&&d!==void 0?d:"fetch";v==="sendBeacon"&&de(m.compression)&&m.data&&(m.compression=_i.Base64),m.method==="POST"&&m.data&&(m.timestampMode==="capture-body"?m.data=(x=>{var k,C;const P=(He(x)?x:[x]).map(O=>V(V({},O),O.timestamp instanceof Date&&!isNaN(O.timestamp.getTime())?{timestamp:O.timestamp.toISOString()}:{})),R=P[0];return{api_key:(k=R==null||(C=R.properties)===null||C===void 0?void 0:C.token)!==null&&k!==void 0?k:R==null?void 0:R.token,batch:P,sent_at:new Date().toISOString()}})(m.data):m.timestampMode==="body"&&(m.data=((x,k=new Date().toISOString())=>He(x)?x.map(C=>V(V({},C),{},{sent_at:k})):V(V({},x),{},{sent_at:k}))(m.data))),m.url=t3(m.url,m.method,m.compression,m.timestampMode);const y=gZ.filter(x=>!m.disableTransport||!x.transport||!m.disableTransport.includes(x.transport)),_=(f=(h=(function(x,k){for(let C=0;x.length>C;C++)if(k(x[C]))return x[C]})(y,x=>x.transport===v))===null||h===void 0?void 0:h.method)!==null&&f!==void 0?f:y[0].method;if(!_)throw new Error("No available transport method");const b=x=>{try{_(x)}catch(C){var k;l5(C)?ve.warn(C):ve.error(C),(k=m.callback)===null||k===void 0||k.call(m,{statusCode:0,error:C})}};v!=="sendBeacon"&&!m.preferSyncCompression&&m.data&&m.compression===_i.GZipJS&&AH&&typeof Promise<"u"&&!Hg?pZ(m).then(x=>{b(x)}).catch(x=>{if(vP(x))return Hg=!0,void b(V(V({},m),{},{compression:void 0,url:t3(l.url,l.method,void 0,l.timestampMode)}));(k=>{if(!k||typeof k!="object")return!1;const C="name"in k?String(k.name):"";return vP(k)||C===U4})(x)&&(Hg=!0),b(m)}):b(m)})(e,(l,c)=>{var d,f,h;t.rateLimiter.checkForLimiting(l),400>l.statusCode||(d=(f=t.config).on_request_error)===null||d===void 0||d.call(f,l),n?n(l,c):(h=e.callback)===null||h===void 0||h.call(e,l)})):e.fireCallbackOnDrop&&((o=e.callback)===null||o===void 0||o.call(e,{statusCode:0}))}var vZ=class{constructor(t,e){this.uc=!0,this.cc=[],this.hc=Qo((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ve.createLogger("flush interval"),3e3),this.dc=t}enqueue(t){this.cc.push(t),this.vc||this.fc()}unload(){this.gc();const t=this.cc.length>0?this.mc():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.yc(V(V({},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 t=this.mc();for(const e in t)this.yc(t[e])}}yc(t,e){try{this.dc(t,e)}catch(n){ve.error(n)}}gc(){clearTimeout(this.vc),this.vc=void 0}mc(){const t={},e={};Wt(this.cc,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");de(t[i])&&(t[i]=V(V({},s),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),e[i]=[]),(r=t[i].data)===null||r===void 0||r.push(s.data),s.callback&&e[i].push(s.callback)});for(const n in e){const r=e[n];r.length&&(t[n].callback=s=>{for(const i of r)i(s)})}return this.cc=[],t}};const yZ=["retriesPerformedSoFar"];var _Z=class{constructor(t){this._instance=t,this._c=!1,this.wc=3e3,this.cc=[],this.cc=[],this.kc=!0,this.resume()}resume(){if(!de(ce)&&"onLine"in ce.navigator){if(this.kc=ce.navigator.onLine,this.Sc)return;this.Sc=()=>{this.kc=!0,this.bc()},this.xc=()=>{this.kc=!1},Lt(ce,"online",this.Sc),Lt(ce,"offline",this.xc)}}get length(){return this.cc.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=B4(t,yZ);Ia(n)&&(r.url=N1(r.url,{retry_count:n})),h5(this._instance,e?V(V({},r),{},{transport:e}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ls(V({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ve.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${n??0} retries.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),c=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-c);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.cc.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ve.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 t=Date.now(),e=[],n=this.cc.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.cc=e,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,de(ce)||(this.Sc&&(ce.removeEventListener("online",this.Sc),this.Sc=void 0),this.xc&&(ce.removeEventListener("offline",this.xc),this.xc=void 0));for(const{requestOptions:t}of this.cc)try{this._instance._send_request(V(V({},t),{},{callback:He(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){ve.error(e)}this.cc=[]}},wZ=class{constructor(t){this._instance=t,this.Tc=()=>{var e,n,r,s;this.Ic||(this.Ic={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,c=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,(e=this.Ic.maxScrollY)!==null&&e!==void 0?e:0),this.Ic.maxScrollHeight=Math.max(l,(n=this.Ic.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ic.lastContentY=c,this.Ic.maxContentY=Math.max(c,(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 t=this.Ic;return this.Ic=void 0,setTimeout(this.Tc,0),t}startMeasuringScrollPosition(){Lt(ce,"scroll",this.Tc,{capture:!0}),Lt(ce,"scrollend",this.Tc,{capture:!0}),Lt(ce,"resize",this.Tc)}scrollElement(){if(this.Mc){const n=He(this.Mc)?this.Mc:[this.Mc];for(const r of n){var t;const s=ce==null||(t=ce.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return ce==null||(e=ce.document)===null||e===void 0?void 0:e.documentElement}Ec(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.Mc){const s=this.scrollElement();return s&&s[r]||0}return ce?t==="y"?ce.scrollY||ce.pageYOffset||((e=ce.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:ce.scrollX||ce.pageXOffset||((n=ce.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 bZ=t=>KM(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);var n3=class{constructor(t,e,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({[Eb]:o})},this._instance=t,this.Oc=e,this.Pc=n,this.Rc=r||bZ,this.Oc.onSessionId(this.je)}Ac(){return this.Pc.props[Eb]}getSetOnceProps(){var t;const e=(t=this.Ac())===null||t===void 0?void 0:t.props;return e?"r"in e?qM(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return Wt(rk(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${ib(n)}`]=e}),t}},Nv=class{on(t,e){return this.Eo[t]||(this.Eo[t]=[]),this.Eo[t].push(e),()=>{this.Eo[t]=this.Eo[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.Eo[t]||[])n(e);for(const n of this.Eo["*"]||[])n(t,e)}constructor(){this.Eo={}}};const bd=An("[SessionId]"),r3=864e5;var s3=class{on(t,e){return this.Fc.on(t,e)}constructor(t,e,n){var r;if(this.Dc=null,this.Lc=null,this.Nc=[],this.jc=void 0,this.qc=!1,this.Fc=new Nv,this.Bc=(i,o)=>!(!Ia(i)||!Ia(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Fr=t.config,this.Pc=t.persistence,this.Be=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.zc=void 0,this._sessionActivityTimestamp=null,this.Hc=e||wo,this.Uc=n||wo;const s=this.Fr.persistence_name||this.Fr.token;if(this._sessionTimeoutMs=1e3*Qo(this.Fr.session_idle_timeout_seconds||1800,60,36e3,bd.createLogger("session_idle_timeout_seconds"),1800),t.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=hn.Ft(this.Vc),o=hn.Ft(this.Gc);i&&!o?this.Be=i:hn.Dt(this.Vc),hn.$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(t){return de(this.Nc)&&(this.Nc=[]),this.Nc.push(t),this.Xt&&t(this.Xt,this.Be),()=>{this.Nc=this.Nc.filter(e=>e!==t)}}Qc(){return this.Fr.persistence!=="memory"&&!this.Pc.fi&&hn.Ot()}Zc(t){t!==this.Be&&(this.Be=t,this.Qc()&&hn.$t(this.Vc,t))}Kc(){return this.Be?this.Be:this.Qc()?hn.Ft(this.Vc):null}Yc(t){const e=this.Dc;return!Nn(e)&&!Nn(t)&&5e3>Math.abs(t-e)}Xc(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Yc(e)||(this.Dc=e,this.Pc.register({[Dd]:[e,t,n]}))}eh(){var t;const e=(t=this.Fr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Ia(e)&&e>0}ih(){this.eh()?this.Pc.refreshKey(Dd):(this.Pc.flush(),this.Pc.load())}nh(){var t;if(Nn(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Dc)return;this.ih();const[,e,n]=this.sh();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Dc=this._sessionActivityTimestamp,this.Pc.register({[Dd]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Pc.flush())}rh(){const[t]=this.sh(),e=Ia(t)?t:0,n=Ia(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}oh(t){return this.ih(),this.Bc(t,this.rh())}sh(){const t=this.Pc.props[Dd];return He(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Dc=null,this.zc=void 0,clearTimeout(this.ah),this.ah=void 0,this.Xc(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void bd.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void bd.error("Invalid sessionID in bootstrap",i)}})(t);return!de(n)&&(e?this.zc={sessionId:t,sessionStartTimestamp:n}:this.Xc(t,new Date().getTime(),n),!0)}destroy(){this.qc=!0,this.nh(),clearTimeout(this.ah),this.ah=void 0,this.jc&&ce&&(ce.removeEventListener(Rv,this.jc,{capture:!1}),this.jc=void 0),this.Nc=[]}Jc(){this.jc=()=>{this.nh(),this.Qc()&&hn.Dt(this.Gc)},Lt(ce,Rv,this.jc,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Fr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.Lc=r;else if(Nn(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[,l,c]=this.sh();const d=!de(s)&&l!==s,f=this.rh();let h=this.Kc();const m=this.zc,v=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>r3),y=m?v:Ia(c)&&Math.abs(r-c)>r3;let _=!1,b=d,x=!l||!!m;const k=l;let C=!x&&!t&&this.Bc(r,f);if(C&&(C=this.oh(r),C||bd.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,c]=this.sh(),C||(x=!l||!!m)),x||C||y){b=!1;const I=m&&!v;l=I?m.sessionId:this.Hc(),h=this.Uc(),bd.info("new session ID assigned",{sessionId:l,windowId:h,bootstrapped:!!I,changeReason:{noSessionId:x,activityTimeout:C,sessionPastMaximumLength:y}}),c=I?m.sessionStartTimestamp:r,this.zc=void 0,_=!0}else h||(h=this.Uc(),_=!0),b=b||l!==k,b&&(bd.info("adopted cross-tab session id",{sessionId:l,windowId:h}),_=!0);const P=Ia(f)&&t&&!y?f:r,R=Ia(c)?c:new Date().getTime();this.Zc(h),this.Xc(l,P,R),t||this.Wc();const O={noSessionId:x,activityTimeout:C,sessionPastMaximumLength:y,crossTabAdoption:b};return _&&this.Nc.forEach(I=>I(l,h,O)),{sessionId:l,windowId:h,sessionStartTimestamp:R,changeReason:_?O:void 0,lastActivityTimestamp:f}}Wc(){this.qc||(clearTimeout(this.ah),this.ah=setTimeout(()=>{if(!this.qc)if(this.oh(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Fc.emit("forcedIdleReset",{idleSessionId:t})}else this.Wc()},1.1*this.sessionTimeoutMs))}};const i3=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),p5=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&tP(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>tP(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function m5(){return(m5=pn(function*(){const t=Jr==null?void 0:Jr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return dt(n)&&n.length>0?n:void 0}catch(e){return void ve.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function xZ(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function g5(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Lv=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},J0=t=>t.toLowerCase(),v5={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>Lv(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Lv(n,r))),icontains:(t,e)=>e.map(J0).some(n=>t.map(J0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(J0).every(n=>t.map(J0).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function y5(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=v5[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function P2(t,e,n){return jd({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const Nb="custom",o3="i.posthog.com",SZ=/^\/static\//,kZ=["/s/","/e/","/i/"];var EZ=class{constructor(t){this.uh={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${o3}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}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":Nb),this.uh[this.apiHost]}hh(t){if(!SZ.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}dh(t){const e=oa(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}fh(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=oa(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&kZ.some(o=>e.indexOf(o)===0)){const o=this.dh(r);if(o){const l=this.apiHost;let c=this.ph;(c==null?void 0:c.apiHost)===l&&c.rewriteRequestPath===s||(c={apiHost:l,rewriteRequestPath:s,urls:new Set},this.ph=c),c.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.ph,n=this.dh(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.fh(t,e,this.uiHost+e);if(t==="flags")return this.fh(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.hh(e);if(r)return this.fh(t,e,`${r}${e}`)}if(this.region===Nb)return this.fh(t,e,this.apiHost+e);const n=o3+e;switch(t){case"assets":return this.fh(t,e,`https://${this.region}-assets.${n}`);case"api":return this.fh(t,e,`https://${this.region}.${n}`)}}};const Zt=An("[Surveys]"),_5=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){Zt.error("Failed to persist survey seen state",e)}},CZ=[b2.Popover,b2.Widget,b2.API],PZ={ignoreConditions:!1,ignoreDelay:!1,displayType:Rb.Popover},TZ=An("[PostHog ExternalIntegrations]"),RZ={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var AZ=class{constructor(t){this._instance=t}Bl(t,e){var n,r;(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return TZ.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=et.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.Bl(RZ[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())}}},w5=class{constructor(t){this.disabled=t===!1;const e=ct(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const Lb=()=>typeof window>"u"?void 0:window,Vh=()=>typeof document>"u"?void 0:document,T2="$copy_autocapture",IZ=["password","hidden","file","checkbox","button","submit","reset","image"],eg=An("[AutoCapture]");function R2(t,e){return e.length>t?e.slice(0,t)+"...":e}function OZ(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Xi(e));return e}function MZ(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,c;if(!Xi(t))return{props:{}};const d=[t],f=new Set([t]);let h=t;for(;h.parentNode&&!hr(h,"body")&&1e3>d.length;){if(Av(h.parentNode)){const O=h.parentNode.host;if(f.has(O))break;f.add(O),d.push(O),h=O;continue}if(!Xi(h.parentNode)||f.has(h.parentNode))break;f.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}const m=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(O=>hr(O,"button")||hr(O,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(O=>!Jl(O)||_f(O)));const v=[],y={};let _,b=!1,x=!1;if(Wt(d,O=>{const I=Jl(O);if(hr(O,"a")&&!n&&!(s!=null&&s.includes("href"))){const A=O.getAttribute("href");b=!!(I&&A&&Yd(A))&&(o?Xl(A):A)}We(bu(O),"ph-no-capture")&&(x=!0),v.push((function(A,M,L,z,$=!1){const q=A.tagName.toLowerCase(),X={tag_name:q};ik.indexOf(q)>-1&&!L&&(X.$el_text=q.toLowerCase()==="a"||q.toLowerCase()==="button"?R2(1024,HP(A)):R2(1024,zp(A)));const j=bu(A);M||z!=null&&z.includes("class")||0>=j.length||(X.classes=j.filter(function(Q){return Q!==""})),Wt(A.attributes,function(Q){var B;if((!_f(A)||["name","id","class","aria-label"].indexOf(Q.name)!==-1)&&!(z!=null&&z.includes(Q.name))&&!M&&Yd(Q.value)&&(!dt(B=Q.name)||B.substring(0,10)!=="_ngcontent"&&B.substring(0,7)!=="_nghost")){let D=Q.value;Q.name==="class"&&(D=sk(D).join(" ")),X["attr__"+Q.name]=R2(1024,Q.name==="href"&&$?Xl(D):D)}});let K=1,ee=1,H=A;for(;H=OZ(H);)K++,H.tagName===A.tagName&&ee++;return X.nth_child=K,X.nth_of_type=ee,X})(O,n,r,s,o)),Wt((function(A){if(!Jl(A))return{};const M={};return Wt(A.attributes,function(L){if(L.name&&L.name.indexOf("data-ph-capture-attribute")===0){const z=L.name.replace("data-ph-capture-attribute-",""),$=L.value;z&&$&&Yd($)&&(M[z]=$)}}),M})(O),(A,M)=>{({}).hasOwnProperty.call(y,M)||(y[M]=A)})}),x)return{props:{},explicitNoCapture:x};if(m>0&&(t=d[m],v.splice(0,m)),r||(v[0].$el_text=hr(t,"a")||hr(t,"button")?HP(t):zp(t)),b){var k,C;v[0].attr__href=b;const O=(k=oa(b))===null||k===void 0?void 0:k.host,I=(C=Lb())===null||C===void 0||(C=C.location)===null||C===void 0?void 0:C.host;O&&I&&O!==I&&(_=b)}return{props:_n((R=e.type,{$event_type:R,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(P=v,He(P)?(function(O){return O.map(I=>{var A,M;let L="";if(I.tag_name&&(L+=I.tag_name),I.attr_class){I.attr_class.sort();for(const q of I.attr_class)L+=`.${q.replace(/"/g,"")}`}const z=V(V(V(V({},I.text?{text:I.text}:{}),{},{"nth-child":(A=I.nth_child)!==null&&A!==void 0?A:0,"nth-of-type":(M=I.nth_of_type)!==null&&M!==void 0?M:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),$={};return Vg(z).sort(([q],[X])=>(function(j,K){return K>j?-1:j>K?1:0})(q,X)).forEach(([q,X])=>$[UP(q.toString())]=UP(X.toString())),L+=":",L+=Vg($).map(([q,X])=>`${q}="${X}"`).join(""),L}).join(";")})((function(O){return O.map(I=>{var A,M;const L={text:(A=I.$el_text)===null||A===void 0?void 0:A.slice(0,400),tag_name:I.tag_name,href:(M=I.attr__href)===null||M===void 0?void 0:M.slice(0,2048),attr_class:qB(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return Vg(I).filter(([z])=>z.indexOf("attr__")===0).forEach(([z,$])=>L.attributes[z]=$),L})})(P)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(c=v[0])===null||c===void 0?void 0:c.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},y),target:t};var P,R}const b5="autocapture";var NZ=class{vl(){this.fl=void 0,clearTimeout(this.pl),this.pl=void 0}gl(t){var e;if(!Jl(t))return!0;const n=(e=this.ml().css_selector_ignorelist)!==null&&e!==void 0?e:q0,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=bu(i);if(We(o,"ph-no-capture")||We(o,"ph-sensitive")||_f(i)||n.some(c=>ep(i,c)))return!0;const l=s.parentNode;s=Av(l)?l.host:l&&Xi(l)?l:null}return!1}yl(t){if(!this.isEnabled||t.type==="pointercancel")return void this.vl();if(t.type==="pointerdown"){var e;this.vl();const r=_p(t);return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Xi(r)&&(this.fl={target:r,excluded:this.gl(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.Fa)===null||e===void 0?void 0:e.distinctId}))}const n=this.fl;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.vl():t.type==="pointerup"&&(n.released=!0,this.pl=setTimeout(()=>this.vl(),0)))}bl(t){var e;const n=this.fl;this.vl();const r=_p(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.Fa)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(hr(r,"html")||hr(r,"body"))){var s,i,o;if(n.excluded)return null;const l=(s=this.ml().css_selector_ignorelist)!==null&&s!==void 0?s:q0;return[r,(i=Vh())===null||i===void 0?void 0:i.documentElement,(o=Vh())===null||o===void 0?void 0:o.body].some(c=>{if(!c)return!1;const d=bu(c);return We(d,"ph-no-capture")||We(d,"ph-sensitive")||!Jl(c)||_f(c)||l.some(f=>ep(c,f))})?null:n.target}}constructor(t){this.Na=t,this.name=b5,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 w5(this.Fr.rageclick),this.$l=null}setup(t){this.Cl(),this.Fa=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Ti?e.dispose():(this.Za=e,this.startIfEnabled())}dispose(){var t;this.Ti||(this.Ti=!0,this.Fa=void 0,(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,this.Sl.clear(),this.$l=null,this.Tl())}ml(){return this.Na.refresh(this.Fr),this.Fr}Cl(){var t,e;return this.ml(),this.Fr.url_allowlist=(t=this.Fr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Fr.url_ignorelist=(e=this.Fr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Fr}Il(){const t=Lb(),e=Vh();if(!this.isBrowserSupported())return void eg.info("Disabling Automatic Event Collection because this browser is not supported");if(!t||!e)return;this.Ml=t,this.El=e;const n=this.Al=r=>{r=r||(t==null?void 0:t.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(Nn(s))return;this.Rl(r,"$autocapture",s)}catch(s){eg.error("Failed to capture event",s)}};if(Lt(t,"blur",n),Lt(e,"submit",n,{capture:!0}),Lt(e,"change",n,{capture:!0}),Lt(e,"click",n,{capture:!0}),Wt(["pointerdown","pointermove","pointerup","pointercancel"],r=>{Lt(e,r,n,{capture:!0})}),this.ml().capture_copied_text){const r=this.Pl=s=>{s=s||(t==null?void 0:t.event);try{this.Rl(s,T2)}catch(i){eg.error("Failed to capture clipboard event",i)}};Lt(e,"copy",r,{capture:!0}),Lt(e,"cut",r,{capture:!0}),Lt(e,"paste",r,{capture:!0})}}Tl(){const t=this.Ml,e=this.El;this.vl(),this.Al&&(t==null||t.removeEventListener("blur",this.Al),Wt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{e==null||e.removeEventListener(n,this.Al,!0)}),e==null||e.removeEventListener("submit",this.Al,!0),e==null||e.removeEventListener("change",this.Al,!0),e==null||e.removeEventListener("click",this.Al,!0),this.Al=void 0),this.Pl&&(e==null||e.removeEventListener("copy",this.Pl,!0),e==null||e.removeEventListener("cut",this.Pl,!0),e==null||e.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(t){if(this.Ti)return;if(this.kl=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.xl=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Ms(n)&&((r=this.Fa)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.wl=n),this.startIfEnabled()}setElementSelectors(t,e=this){if(this.Ti)return;t.size?this.Sl.set(e,new Set(t)):this.Sl.delete(e);const n=new Set;this.Sl.forEach(r=>{r.forEach(s=>n.add(s))}),this.$l=n}getElementSelectors(t,e){var n;const r=[];return(n=this.$l)===null||n===void 0||n.forEach(s=>{var i;const o=(i=Vh())===null||i===void 0?void 0:i.querySelectorAll(s);o==null||o.forEach(l=>{t!==l&&e!==l||We(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Ti)return!1;const n=(t=this.Fa)===null||t===void 0?void 0:t.kv.get(oM),r=this.wl,s=this.ml();if(!s.remoteRequestsDisabled&&!this.kl)return!1;const i=s.remoteRequestsDisabled&&!this.kl;if(Nn(r)&&!Ms(n)&&!i)return!1;const o=(e=this.wl)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Rl(t,e="$autocapture",n){if(!this.isEnabled)return void this.vl();let r=n||_p(t);AM(r)&&(r=r.parentNode||null);const s=this.Cl();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&NM(r,s.rageclick)&&this.Rl(t,"$rageclick",n);const o=e===T2,l=o?V(V({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(m,v,y,_,b,x){var k;const C=typeof window>"u"?void 0:window;if(!C||ak(m)||y!=null&&y.url_allowlist&&!NP(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&NP(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){const I=y.dom_event_allowlist;if(I&&!I.some(A=>v.type===A))return!1}const{parentIsUsefulElement:P,targetElementList:R}=LM(m,_);if(!(function(I,A){const M=A==null?void 0:A.element_allowlist;if(de(M))return!0;for(const L of I)if(M.some(z=>L.tagName.toLowerCase()===z))return!0;return!1})(R,y)||!Tb(R,y==null?void 0:y.css_selector_allowlist)||Tb(R,(k=y==null?void 0:y.css_selector_ignorelist)!==null&&k!==void 0?k:q0))return!1;try{const I=C.getComputedStyle(m);if(I&&I.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 P?(b||["click"]).indexOf(v.type)>=0:(b||["click"]).indexOf(v.type)>=0&&(ik.indexOf(O)>-1||m.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var c;const{props:m,explicitNoCapture:v,target:y}=MZ(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.xl,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(v)return!1;const _=this.getElementSelectors(r,y);if(_&&_.length>0&&(m.$element_selectors=_),e===T2){const b=t.type||"clipboard";if(b!=="paste"){var d,f;const x=(d=Lb())===null||d===void 0||(d=d.getSelection())===null||d===void 0?void 0:d.toString(),k=IM(x);if(!k)return!1;m.$selected_content=k,m.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}m.$copy_type=b}if(e==="$autocapture"&&t.type==="change"&&s.capture_value_css_selector_allowlist&&!s.maskAllText&&(hr(h=r,"input")?!We(IZ,h.type):hr(h,"textarea")||hr(h,"select")&&!h.multiple)&&(function(b,x){var k;if(!Jl(b))return!1;const C=(k=x.css_selector_ignorelist)!==null&&k!==void 0?k:q0,P=new Set;let R=b;for(hr(b,"select")&&(R=b.options[b.selectedIndex]||b);R;){const O=R,I=bu(O);if(P.size>=1e3||P.has(R)||We(I,"ph-sensitive")||We(I,"ph-no-capture")||C.some(M=>ep(O,M)))return!1;P.add(R);const A=R.assignedSlot||R.parentNode;R=Av(A)?A.host:A&&Xi(A)?A:null}return!0})(r,s)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){const b=s.capture_value_css_selector_allowlist;let x=!1;try{x=Vn(b)?!!b(r):He(b)&&b.some(k=>ep(r,k))}catch(k){eg.error("capture_value_css_selector_allowlist threw",k)}x&&(m.$input_value=r.value)}return(c=this.Fa)===null||c===void 0||c.capture(e,m),!0}var h}isBrowserSupported(){var t;return Vn((t=Vh())===null||t===void 0?void 0:t.querySelectorAll)}};const x5="featureFlags",S5="logs",Up=()=>{var t;return!(ce==null||(t=ce.performance)===null||t===void 0)&&t.now?ce.performance.now():Date.now()},LZ=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4];var DZ=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);de(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}},$Z=class{constructor(t){this.instance=t,this.R=ve,this.kv=new DZ(t),this.onSession=e=>Q0(this.instance.onSessionId(n=>{try{e(n)}catch(r){this.R.error("Browser extension session listener failed",r)}})),this.onEvent=e=>Q0(this.instance._addCaptureHook((n,r)=>{if(r)try{e({event:n,properties:r.properties})}catch(s){this.R.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=e=>{const n=s=>{try{e(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),Q0(r)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(YS);return typeof t=="string"?t:void 0}get library(){return{name:Ws.LIB_NAME,version:Ws.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r,s;const i=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=i==null?void 0:i.sessionId)!==null&&e!==void 0?e:"",windowId:(n=i==null?void 0:i.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=i==null?void 0:i.sessionStartTimestamp)!==null&&r!==void 0?r:0,lastActivityTimestamp:(s=i==null?void 0:i.lastActivityTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return Vn(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!!(!((t=this.instance.rateLimiter)===null||t===void 0)&&t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case x5:case"featureFlagsCommon":e=this.instance.featureFlags;break;case S5:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case b5:e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return this.pr(this.instance.capture(t,e));const r=V({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(t,e,r))}pr(t){var e;return!de(t)||!(!((e=this.instance.rateLimiter)===null||e===void 0)&&e.lastEventRateLimited)}registerDynamicEventProperties(t){return Q0(this.instance.mr(t))}sendRequest(t){var e=this;return pn(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=r.query?N1(n,r.query):n,l=e.instance.requestRouter.endpointFor(i,o),c={method:r.method,url:l,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?sb.Base64:void 0,timestampMode:r.sentAt};return i==="api"&&n==="/i/v1/logs"&&(c.batchKey="logs"),r.transport==="sendBeacon"?(e.instance._send_request(c),{statusCode:202}):new Promise(d=>{var f;if(c.callback=d,i==="flags"&&((f=e.instance.config.metrics)===null||f===void 0?void 0:f.flags)){let h;c.onDispatch=()=>{h=Up()},c.callback=m=>{de(h)||e.gr(l,m,Up()-h),d(m)}}e.instance._send_request(c)})}).apply(this,arguments)}gr(t,e,n){try{var r,s,i;const o=e.statusCode||void 0,l={"server.address":((r=(s=oa(t))===null||s===void 0?void 0:s.hostname)!==null&&r!==void 0?r:t).replace(/^\[(.*)\]$/,"$1")};o&&(l["http.response.status_code"]=o);const c=((f,h)=>f?400>f?void 0:String(f):(h==null?void 0:h.name)==="AbortError"?"timeout":"_OTHER")(o,e.error);c&&(l["error.type"]=c);const d=lk();d&&(l["client.timezone"]=d),(i=this.instance.metrics)===null||i===void 0||i.histogram("posthog.flags.request.duration",n,{unit:"ms",attributes:l,bounds:LZ})}catch(o){ve.error("Failed to record the /flags request duration",o)}}};const bp={};let A2=0;const xp=()=>{},a3='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',xd="Surveys module not available",l3="sanitize_properties is deprecated. Use before_send instead",k5="Invalid value for property_denylist config: ",FZ=["$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"],jZ=["$feature_flag_called","$$heatmap","$snapshot"],c3=t=>t.charAt(0)==="$"&&!We(jZ,t),zZ=/^[A-Za-z0-9_-]{1,400}$/,u3=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,d3=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,VZ=["token","distinct_id",mM],tp="posthog",HZ=[...i3].sort()[i3.length-1],UZ=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},I2=t=>{var e;return V({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:MB(Me==null?void 0:Me.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:xp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:fn&&dt(fn==null?void 0:fn.search)&&fn.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:(ce==null||(e=ce.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){ve.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:EM,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:xp},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:ok,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:UZ(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},BZ=[["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"]],f3=t=>{const e={};for(const[s,i]of BZ)de(t[s])||(e[i]=t[s]);const n=_n({},e,t),r=t.__preview_external_dependency_versioned_paths;return de(r)||(de(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),dt(r)&&de(t.asset_host)&&(n.asset_host=r)),He(t.property_blacklist)&&(de(t.property_denylist)?n.property_denylist=t.property_blacklist:He(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(k5+t.property_denylist)),n};var ZZ=class{constructor(){this.__forceAllowLocalhost=!1}get gh(){return this.__forceAllowLocalhost}set gh(t){ve.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Sp=class Tl{mh(e){if(!e)return;const n=this.yh.indexOf(e);n!==-1&&this.yh.splice(n,1)}bh(e,n){var r;return this.mh(e),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 e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.Sh)return;let n,r,s;e?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.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 e=this.persistence;if(!e||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()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(wo());this.register({distinct_id:r,$device_id:r}),e.set_property(gs,Ha)}this.Ch()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.Mh=!1,this.Eh=!1,this.webPerformance=new ZZ,this.Ah=!1,this.version=Ws.LIB_VERSION,this.Rh=new Set,this.Ph="",this.dr=new Nv,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=I2(),this.SentryIntegration=XB,this.sentryIntegration=r=>(function(s,i){const o=FM(s,i);return{name:$M,processEvent:l=>o(l)}})(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 wZ(this),this.pageViewManager=new WP(this),this.rateLimiter=new aZ(this),this.requestRouter=new EZ(this),this.consent=new zB(this),this.externalIntegrations=new AZ(this);const n=(e=Tl.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=dt(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=dt(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ve.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==tp){var s;const i=(s=bp[r])!==null&&s!==void 0?s:new Tl;return i._init(e,n,r),bp[r]=i,bp[tp][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=dt(e)?e.trim():"";if(!l)return ve.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var c;if(this.__loaded)return l!==((c=this.config)===null||c===void 0?void 0:c.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=I2(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=I2(n.defaults),f=f3(n),h=_n({},d,f,{name:r,token:l});ct(d.rageclick)&&ct(f.rageclick)&&(h.rageclick=_n({},d.rageclick,f.rageclick)),ct(d.session_recording)&&ct(f.session_recording)&&(h.session_recording=_n({},d.session_recording,f.session_recording)),this.set_config(h),this.config.on_xhr_error&&ve.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:_i.GZipJS;const m=this.Ih(),v=!this._h();if(this.persistence=new w2(this.config,m,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w2(V(V({},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&&hn.Ot()){const k=hn.Ft(this.Ph);He(k)&&k.forEach(C=>{dt(C)&&this.Rh.add(C)})}else hn.Dt(this.Ph);const y=V({},this.persistence.props),_=V({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Hh=new vZ((k,C)=>this.Uh(k,C),this.config.request_queue_config),this.Wh=new _Z(this),this.__request_queue=[];const b=this._h();b||(this.sessionManager=new s3(this),this.sessionPropsManager=new n3(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,C,P)=>{(P!=null&&P.activityTimeout||P!=null&&P.sessionPastMaximumLength||P!=null&&P.crossTabAdoption)&&this.Vh()})),this.Gh(),this.config.__preview_deferred_init_extensions?(ve.info("Deferring extension initialization to improve startup performance"),this.Qh=setTimeout(()=>{this.Qh=void 0,this.Jh(b)},0)):(ve.info("Initializing extensions synchronously"),this.Jh(b)),Ws.DEBUG=Ws.DEBUG||this.config.debug,Ws.DEBUG&&ve.info("Starting in debug mode",{this:this,config:n,thisC:V({},this.config),p:y,s:_}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=V(V({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const x=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.Sh=!!x&&!fp(x),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const k=n.bootstrap.distinctID,C=this.get_distinct_id(),P=this.persistence.get_property(gs);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P==="identified")ve.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 R=this.config.get_device_id(wo()),O=n.bootstrap.isIdentifiedID?R:k;this.persistence.set_property(gs,n.bootstrap.isIdentifiedID?zg:Ha),this.register({distinct_id:k,$device_id:O})}}if(b)this.register_once({distinct_id:d2,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(wo());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(gs,Ha)}return Lt(ce,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Lt(ce,"pageshow",k=>{if(this.Mh=!1,!this.Eh){var C;if(k.persisted&&this.persistence){const P=this.persistence.get_property(Bi),R=this.persistence.get_property(gs);this.persistence.load(),this.Zh()||P===this.persistence.get_property("distinct_id")&&R===this.persistence.get_property("$user_state")||this.Kh()}(C=this.Wh)===null||C===void 0||C.resume()}}),n.segment?ZP(this,()=>this.Yh()):this.Yh(),Vn(this.config._onCapture)&&this.config._onCapture!==xp&&(ve.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),this.config.ip&&ve.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 m5.apply(this,arguments)})().then(k=>{k&&this.register({[u2]:k})}).catch(xp),this}Xh(e){const n=e;return dt(n.name)&&Vn(n.setup)}ed(e,n){var r=this;this.Xh(e)?n.push(pn(function*(){try{yield e.setup(r.nd())}catch(i){ve.error(`Failed to set up extension "${e.name}"`,i);try{var s;yield(s=e.dispose)===null||s===void 0?void 0:s.call(e)}catch(o){ve.error(`Failed to dispose extension "${e.name}"`,o)}}})):this.yh.push(e)}Gh(){var e,n,r,s=this;const i=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=Tl.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,l,c;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)),Vn(this.featureFlags.onReloading)&&Vn(this.featureFlags.setup)){if(!this.sd){this.sd=this.featureFlags.onReloading(()=>{this.dr.emit("featureFlagsReloading",!0)});const d=this.featureFlags;pn(function*(){try{yield d.setup(s.nd())}catch(f){ve.error("Failed to set up feature flags",f);const h=s.sd;s.sd=void 0;try{h==null||h()}catch(m){ve.error("Failed to unsubscribe feature flag reloading",m)}try{yield d.dispose()}catch(m){ve.error("Failed to dispose feature flags",m)}}})()}}else(l=(c=this.featureFlags).initialize)===null||l===void 0||l.call(c)}Jh(e){const n=performance.now(),r=V(V({},Tl.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,c,d,f,h,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&&!e&&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=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.yh.push(this.metrics=(c=this.metrics)!==null&&c!==void 0?c: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,YB)),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=(h=this.experiments)!==null&&h!==void 0?h: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 y;(y=v.initialize)===null||y===void 0||y.call(v)})}),s.push(()=>{if(this.rd){const v=this.rd;this.rd=void 0,this.yh.forEach(y=>{var _;return(_=y.onRemoteConfig)===null||_===void 0?void 0:_.call(y,v)})}}),this.od(s,n)}od(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void(this.Qh=setTimeout(()=>{this.Qh=void 0,this.od(e,n)},0));const s=e.shift();if(s)try{s()}catch(i){ve.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[gM]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[vM]:r}),this.config.__preview_deferred_init_extensions&&ve.info(`PostHog extensions initialized (${r}ms)`)}ac(e){if(!Me||!Me.body)return ve.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.ac(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.rd=e),this.vr=e,this.compression=void 0,e.ok){var n;const r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=We(r.supportedCompression,_i.GZipJS)?_i.GZipJS:We(r.supportedCompression,_i.Base64)?_i.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:EM}),this.dr.emit("extensionsRemoteConfig",e),this.yh.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,e)})}Yh(){try{this.config.loaded(this)}catch(e){ve.critical("`loaded` function failed",e)}if(this.ad(),this.config.internal_or_test_user_hostname&&(fn==null?void 0:fn.hostname)){const e=fn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this._h())&&this.ld()},1),this.ud=new YM(this),this.ud.load()}ad(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Hh)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&Fd(this.__request_queue,e=>this.Uh(e)),this.__request_queue=[],this.ad()}_handle_unload(){var e,n,r,s,i,o;this.Mh=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.hd()&&this.capture(CP),(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(CP,null,{transport:"sendBeacon"})}_send_request(e){h5(this,e)}Uh(e,n){this.Wh?this.Wh.retriableRequest(e,n):this._send_request(n?V(V({},e),{},{transport:n}):e)}_execute_array(e){A2++;try{let n;const r=[],s=[],i=[];Fd(e,l=>{if(l)if(n=l[0],He(n))i.push(l);else if(Vn(l))try{l.call(this)}catch(c){ve.error("Error executing queued PostHog call",l,c)}else He(l)&&n==="alias"?r.push(l):He(l)&&n.indexOf("capture")!==-1&&Vn(this[n])?i.push(l):s.push(l)});const o=function(l,c){Fd(l,function(d){try{if(He(d[0])){let f=c;Wt(d,function(h){f=f[h[0]].apply(f,h.slice(1))})}else c[d[0]].apply(c,d.slice(1))}catch(f){ve.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{A2--}}push(e){if(A2>0&&He(e)&&dt(e[0])){const n=Tl.prototype[e[0]];return void(Vn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get dd(){return{property:kP,persistenceKey:Gd,cookieName:"_fbc",pattern:u3,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Gd]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Gd)}}}get vd(){return{property:EP,persistenceKey:mp,cookieName:"_fbp",pattern:d3,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[mp]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(mp)}}}fd(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return dt(r)&&e.pattern.test(r)?{value:r,delivered:!1}:ct(r)&&dt(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}pd(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}gd(e){if(!this.config.save_campaign_params||this._h())return;const n=vp(e.cookieName);return dt(n)&&e.pattern.test(n)?n:void 0}md(e,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 dt(n)&&u3.test(n)?this.pd(i,n,o):void i.unregister();const l=dt(e)&&zZ.test(e)?e:void 0,c=this.gd(i);return c&&((d,f,h)=>{const m=d.split(".");if(f)return m[3]===f;if(!h)return!0;const v=h.value.split(".");return m[3]===v[3]||Number(m[2])>Number(v[2])})(c,l,o)?this.pd(i,c,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.pd(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}yd(e,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 dt(e)&&d3.test(e)?this.pd(s,e,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(e,n){if(!this.persistence)return;this.persistence.refreshMetaIdentifiers();const r=this.fd(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i,o;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Hh))return void ve.uninitializedWarning("posthog.capture");if(!this.is_capturing())return void ve.info(`Event "${e}" was not captured because capturing is disabled (opted out or consent pending).`);if(de(e)||!dt(e))return void ve.error("No event name provided to posthog.capture");if(this.xh(),e==="$snapshot"&&this._h())return;const l=!this.config.opt_out_useragent_filter&&this._is_bot();if(l&&!this.config.__preview_capture_bot_pageviews)return void ve.info(`Event "${e}" was not captured because the user agent looks like a bot. Set \`opt_out_useragent_filter: true\` to capture it.`);const c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c!=null&&c.isRateLimited)return void ve.critical("This capture call is ignored due to client rate limiting.");let d;n!=null&&n.$current_url&&!dt(n==null?void 0:n.$current_url)&&(ve.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r._d||ve.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,h=(r==null?void 0:r.timestamp)||f,m=iP(r==null?void 0:r.uuid,wo);let v={uuid:m,event:e,properties:this.calculateEventProperties(e,n||{},h,m)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&l&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),c&&(v.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);const y=e==="$feature_flag_called"&&v.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!y&&(v.$set=r==null?void 0:r.$set);const _=ct(n==null?void 0:n.$set)?n.$set:void 0,b=He(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],k=j=>{var K;const ee=!!(r!=null&&r.$set)&&j in r.$set;return{hasProvided:ee||!!_&&j in _,provided:ee?r==null||(K=r.$set)===null||K===void 0?void 0:K[j]:_==null?void 0:_[j],unset:b.indexOf(j)!==-1||x.indexOf(j)!==-1}},C=k(kP),P=k(EP),R=[{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:P.hasProvided,update:this.yd(P.provided,P.hasProvided,P.unset)}];for(const{channel:j,hasProvided:K,update:ee}of R)ee&&v.properties.$process_person_profile===!0&&ee.pending&&!K&&!y&&(v.$set=V({[j.property]:ee.value},v.$set));const O=r==null?void 0:r.$unset;O&&(v.$unset=O);const I=y?void 0:this.wd(r==null?void 0:r.$set_once,e!==PP,e===CM);if(I&&(v.$set_once=I),r!=null&&r._noTruncate||(A=this.config.properties_string_max_length,v=(function(j,K){const ee=new Set;return(function H(Q,B){if(Q!==Object(Q))return K?K(Q):Q;if(ee.has(Q))return;let D;if(ee.add(Q),He(Q))D=[],Fd(Q,G=>{D.push(H(G))});else{const G={};Wt(Wf(Q)?PM(Q):Q,(fe,ie)=>{ee.has(fe)||(G[ie]=H(fe))}),D=G}return D})(j)})(v,j=>dt(j)?j.slice(0,A):j)),v.timestamp=h,de(r==null?void 0:r.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=f),y&&(v.properties=((j,K=[])=>{const ee={},H=Q=>{j[Q]!==void 0&&(ee[Q]=j[Q])};return kU.forEach(H),K.forEach(H),ee})(v.properties,VZ)),e===yi.DISMISSED||e===yi.SENT){const j=n==null?void 0:n[x2.SURVEY_ID],K=n==null?void 0:n[x2.SURVEY_ITERATION];_5({id:j,current_iteration:K}),v.$set=V(V({},v.$set),{},{[xZ({id:j,current_iteration:K},e===yi.SENT?"responded":"dismissed")]:!0})}else e===yi.SHOWN&&(v.$set=V(V({},v.$set),{},{[x2.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var A;if(e===oZ.SHOWN){const j=n==null?void 0:n[GP.TOUR_TYPE];j&&(v.$set=V(V({},v.$set),{},{[`${GP.TOUR_LAST_SEEN_DATE}/${j}`]:new Date().toISOString()}))}const M=V(V({},v.properties.$set),v.$set);if(Ks(M)||this.setPersonPropertiesForFlags(M),!ot(this.config.before_send)){const j=this.Fs(v);if(!j)return;v=j,v.uuid=iP(v.uuid,wo)}this.sessionRecording&&!this.Fh&&c3(e)&&(this.Fh=!0,setTimeout(()=>this.Fh=!1,3e4));const L=R.filter(({channel:j,update:K})=>{var ee,H,Q;const B=(ee=(H=v.$set)===null||H===void 0?void 0:H[j.property])!==null&&ee!==void 0?ee:ct((Q=v.properties)===null||Q===void 0?void 0:Q.$set)?v.properties.$set[j.property]:void 0;return(K==null?void 0:K.pending)&&B===K.value});this.dr.emit("eventCaptured",v);const z=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),$=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(z),q=V(V(V({method:"POST",url:z,data:v,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:$?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},$&&(!((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}:{}),L.length?{fireCallbackOnDrop:!0,callback:j=>{if(j.statusCode>=200&&300>j.statusCode)for(const{channel:K,update:ee}of L)this.bd(K,ee.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var X;let j;!q.transport&&!q.callback&&Ks((X=this.config.request_headers)!==null&&X!==void 0?X:{})&&this.Mh&&(j="sendBeacon"),this.Uh(q,j)}else this.Hh.enqueue(q);return(o=this.featureFlags)===null||o===void 0||o.sendFlagCallsPendingCapture(),v}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.kd)===null||n===void 0?void 0:n.getExtension(e)}nd(){var e;return(e=this.kd)!==null&&e!==void 0?e:this.kd=new $Z(this)}mr(e){this.Oh.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Oh.indexOf(e);r!==-1&&this.Oh.splice(r,1)}}Zh(e=!0){var n;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Kh(e),!0)}Kh(e=!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(),e&&this.reloadFeatureFlags()}calculateEventProperties(e,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(e);let l=V({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults==="latest"?HZ:this.config.defaults,this._h()&&(l[mM]=!0),e==="$snapshot"){const k=V(V({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!dt(l.distinct_id)&&!Yn(l.distinct_id)||fp(l.distinct_id))&&ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const c=(function(k,C,P,R=!1){var O,I,A,M;if(!Is)return{};const L=k?[...bf,...C||[]]:[],[z,$]=O4(Is),[q,X]=(function(ie){for(let ue=0;sP.length>ue;ue++){const[he,we,le]=sP[ue],se=ie.match(he);if(se){const be=le&&ie.match(le)||se;return[we,(be==null?void 0:be[1])||""]}}return["",""]})(Is),j=(function(){const ie="u">typeof navigator?navigator:void 0;return ie!=null&&ie.brave?{brave:!0}:{}})(),K={};de(P)||(K.detectGoogleSearchApp=P);const ee={},H=(O=navigator)===null||O===void 0||(O=O.userAgentData)===null||O===void 0?void 0:O.platform,Q=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,B=ce==null||(A=ce.screen)===null||A===void 0?void 0:A.width,D=ce==null||(M=ce.screen)===null||M===void 0?void 0:M.height,G=ce==null?void 0:ce.devicePixelRatio;de(H)||(ee.userAgentDataPlatform=H),de(Q)||(ee.maxTouchPoints=Q),de(B)||(ee.screenWidth=B),de(D)||(ee.screenHeight=D),de(G)||(ee.devicePixelRatio=G);const fe=_n(rk({$os:z,$os_version:$,$browser:I4(Is,navigator.vendor,j,K),$webview_app:q,$webview_app_version:X,$device:M4(Is),$device_type:WH(Is,ee),$timezone:lk(),$timezone_offset:rZ()}),{$current_url:Vp(R?Xl(fn==null?void 0:fn.href):fn==null?void 0:fn.href,L,Hp),$host:fn==null?void 0:fn.host,$pathname:fn==null?void 0:fn.pathname,$raw_user_agent:Is.length>1e3?Is.substring(0,997)+"...":Is,$browser_version:ZH(Is,navigator.vendor,j,K),$browser_language:ZM(),$browser_language_prefix:nZ(),$screen_height:ce==null?void 0:ce.screen.height,$screen_width:ce==null?void 0:ce.screen.width,$viewport_height:ce==null?void 0:ce.innerHeight,$viewport_width:ce==null?void 0:ce.innerWidth,$lib:Ba.LIB_NAME,$lib_version:Ba.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ba.SDK_DIST_CHANNEL&&(fe.$sdk_dist_channel=Ba.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:k,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=k,l.$window_id=C}this.sessionPropsManager&&_n(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const k=this.sessionRecording.sdkDebugProperties,C=!this.Fh&&c3(e);for(const P in k)(C||We(FZ,P))&&(l[P]=k[P])}l.$sdk_debug_retry_queue_size=(d=this.Wh)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let f;if(this.requestRouter.region===Nb&&(l.$lib_custom_api_host=this.config.api_host),f=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=_n(l,f),e==="$pageview"&&Me&&(l.title=Me.title),!de(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}Is&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const h=this.persistence.properties(),m=this.sessionPersistence.properties(),v=l.$groups,y=h.$groups;ct(v)&&!Ks(v)&&(l.$groups=V(V({},ct(y)?y:{}),v)),Wt(["$referrer","$referring_domain"],k=>{k in h&&delete m[k]});const _={};if(this.Oh.length>0)for(const k of this.Oh.slice())try{_n(_,k())}catch(C){ve.error("Failed to produce browser extension event properties",C)}l=_n({},c,h,m,V(V({},_),l)),l.$is_identified=this._isIdentified(),He(this.config.property_denylist)?Wt(this.config.property_denylist,function(k){delete l[k]}):ve.error(k5+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const b=this.config.sanitize_properties;b&&(ve.error(l3),l=b(l,e));const x=this.xd();return l.$process_person_profile=x,x&&!i&&this.$d("_calculate_event_properties"),l}wd(e,n=!0,r=!1){var s;if(!this.persistence||!this.xd()||this.Ah&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=_n({},i,o||{},e||{});const c=this.config.sanitize_properties;return c&&(ve.error(l3),l=c(l,"$set_once")),n&&(this.Ah=!0),Ks(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.Zh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Rh.add(s)),this.Sd()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Rh.delete(e),this.Sd()}Cd(e,n){this.register({[e]:n})}Vh(){this.Rh.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Rh.clear(),this.Sd()}Sd(){var e;if(!this.Ph)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.fi||!hn.Ot())return void hn.Dt(this.Ph);const n=[];this.Rh.forEach(r=>n.push(r)),n.length>0?hn.$t(this.Ph,n):hn.Dt(this.Ph)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.dr.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:xd}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:xd})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:xd})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:xd}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=PZ){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:xd}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:xd})}Td(e){return!e||fp(e)?(ve.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ve.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ve.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return ve.uninitializedWarning("posthog.identify");if(Yn(e)&&(e=e.toString(),ve.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(e)||!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),l=this.persistence.Ou();let c=!1;try{const f=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),e!==f&&e!==this.get_property("__alias")&&(this.unregister(Tv),this.register({distinct_id:e}));const h=(this.persistence.get_property("$user_state")||"anonymous")===Ha,m=e!==f,v=!m&&h;if(m&&h){var d;const y=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(gs,zg),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$identify",y,{$set:n||{},$set_once:r||{}})&&(this.jh=P2(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(gs,zg);const y=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:y,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$set",{$set:y,$set_once:_})&&(this.jh=P2(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(qo)):v&&(n||r)&&this.reloadFeatureFlags(),c=!0}finally{l&&this.persistence.Nu(c)}}setPersonProperties(e,n){if(!e&&!n||!this.$d("posthog.setPersonProperties"))return;const r=P2(this.get_distinct_id(),e,n);this.jh!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.jh=r)):ve.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(He(e)?e:[e]).filter(s=>dt(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(e,n,r){var s;if(!e||!n)return void ve.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[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:V(V({},i),{},{[e]:n})}),(o||r)&&this.xd()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(PP,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.$d("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=Ms(e)?e:e==null?void 0:e.resetDeviceID,r=Ms(e)||e==null?void 0:e.bootstrap;this.Id(n,!1,r)}Id(e,n=!1,r){var s,i,o,l,c,d;if(ve.info("reset"),!this.__loaded)return ve.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 h=this.get_property(YS),m=this.get_property(u2),v=this.get_property(gp);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const y=this.is_capturing();n||this.consent.reset(),n||!y||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 _=(c=this.persistence)===null||c===void 0||(d=c.Ou)===null||d===void 0?void 0:d.call(c),b=this.$h;this.$h=b||n;let x=!1;try{var k,C,P,R,O,I,A,M,L,z,$,q,X;if((k=this.persistence)===null||k===void 0||k.clear(),(C=this.sessionPersistence)===null||C===void 0||C.clear(),this.Rh.clear(),this.Sd(),de(v)||(z=this.persistence)===null||z===void 0||z.register({$session_recording_remote_config:v}),(P=this.surveys)===null||P===void 0||P.reset(),(R=this.featureFlags)===null||R===void 0||R.reset(),(O=this.conversations)===null||O===void 0||O.reset(),(I=this.logs)===null||I===void 0||I.reset(),(A=this.metrics)===null||A===void 0||A.reset(),(M=this.persistence)===null||M===void 0||M.set_property("$user_state","anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this.jh=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:d2,$device_id:null},"");else{const H=this.config.get_device_id(wo());this.register_once({distinct_id:H,$device_id:e?H:h},""),e||de(m)||this.register({[u2]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this._h()&&((X=this.persistence)===null||X===void 0||X.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),($=this.featureFlags)===null||$===void 0||$.initialize(),!ot(f)&&!(!((q=this.sessionManager)===null||q===void 0)&&q.setBootstrapSessionId(f,!0)))){const H=V({},r);delete H.sessionID,this.config.bootstrap=H}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,x=!0}finally{var j,K;this.$h=b,_&&((j=this.persistence)===null||j===void 0||(K=j.Nu)===null||K===void 0||K.call(j,x))}var ee;this.vr&&((ee=this.conversations)===null||ee===void 0||ee.onRemoteConfig(this.vr)),this.reloadFeatureFlags()}shutdown(e){var n=this;return pn(function*(){if(!n.__loaded)return void ve.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&&Vn(i.then)&&i.then(void 0,o=>{ve.error("Error during shutdown",o)})}catch(i){ve.error("Error during shutdown",i)}})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.Md()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.Ed()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(ve.critical("Attempting to create alias for existing People user - aborting."),-2):this.$d("posthog.alias")?(de(n)&&(n=this.get_distinct_id()),e!==n?(this.Cd(Tv,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ve.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=V({},this.config);if(ct(e)){var r,s,i,o,l,c,d,f,h,m,v,y,_,b;_n(this.config,f3(e));const R=this.Ih();if(this.persistence){const I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var x,k;if(I&&this.sessionPersistence!==this.persistence&&((x=this.sessionPersistence)===null||x===void 0||x.remove(),(k=this.sessionPersistence)===null||k===void 0||k.destroy()),this.persistence.update_config(this.config,n,R),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new w2(V(V({},this.config),{},{persistence:"sessionStorage"}),R,!1);else{var C;(C=this.sessionPersistence)===null||C===void 0||C.update_config(V(V({},this.config),{},{persistence:"sessionStorage"}),V(V({},n),{},{persistence:"sessionStorage"}),R)}}const O=this.qh(this.config.debug);var P;Ms(O)&&(this.config.debug=O),Ms(this.config.debug)&&(this.config.debug?(Ws.DEBUG=!0,It.Ot()&&It.$t("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:V({},this.config)})):(Ws.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(),(l=this.metrics)===null||l===void 0||l.onConfigChange(),(c=this.webMCP)===null||c===void 0||c.startIfEnabled(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(h=this.autocapture)===null||h===void 0||h.startIfEnabled(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((P=this.historyAutocapture)===null||P===void 0||P.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(y=this.deadClicksAutocapture)===null||y===void 0||y.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.Ch(),(b=this.externalIntegrations)===null||b===void 0||b.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&ZP(this,xp,!1)}}_overrideSDKInfo(e,n){Ws.LIB_NAME=e,Ws.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,c;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)===null||c===void 0||c.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(V(V({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:Tl.Ad}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:tp;return n!==tp&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}xd(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ks(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}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(e){return this.config.person_profiles==="never"?(ve.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.wh(),this.Cd(JS,!0),!0)}Ih(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}Ch(){var e,n;const r=this.Ih();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.Rd(),((e=this.persistence)===null||e===void 0?void 0:e.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(e){var n,r,s;if(this.config.cookieless_mode==="always")return void ve.warn(a3);if(this._h()){var i,o,l,c,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(),(l=this.pageViewManager)===null||l===void 0||l.destroy(),this.sessionManager=new s3(this),this.pageViewManager=new WP(this),this.persistence&&(this.sessionPropsManager=new n3(this,this.sessionManager,this.persistence));const x=(c=(d=this.config.__extensionClasses)===null||d===void 0?void 0:d.sessionRecording)!==null&&c!==void 0?c:(f=Tl.__defaultExtensionClasses)===null||f===void 0?void 0:f.sessionRecording;var h,m;x&&(this.sessionRecording=this.bh(this.sessionRecording,new x(this)),this.vr&&((h=this.sessionRecording)===null||h===void 0||(m=h.onRemoteConfig)===null||m===void 0||m.call(h,this.vr)))}const v=this.consent.consent===1;var y,_,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"&&((y=this.surveys)===null||y===void 0||y.loadIfEnabled(),(_=this.conversations)===null||_===void 0||_.loadIfEnabled()),v||!de(e==null?void 0:e.captureEventName)&&!(e!=null&&e.captureEventName)||this.capture((b=e==null?void 0:e.captureEventName)!==null&&b!==void 0?b:"$opt_in",e==null?void 0:e.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()):ve.warn(a3)}Th(){var e,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:d2,$device_id:null}),this.mh(r),this.sessionRecording=void 0,(e=this.sessionManager)===null||e===void 0||e.destroy(),(n=this.pageViewManager)===null||n===void 0||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ld(),this.ad()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return!this.$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 Jr?p5(Jr,this.config.custom_blocked_useragents):void 0}ld(){Me&&(Me.visibilityState==="visible"?this.Dh||(this.Dh=!0,this.capture(nk,{title:Me.title},{send_instantly:!0}),this.Lh&&(Me.removeEventListener(qd,this.Lh),this.Lh=null)):this.Lh||(this.Lh=this.ld.bind(this),Lt(Me,qd,this.Lh)))}debug(e){e===!1?(ce==null||ce.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ce==null||ce.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 e=this.Bh||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ve.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,o){const l=r in n&&!ot(n[r]),c=s in n&&!ot(n[s]);return l?n[r]:!!c&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,ve)}Fs(e){var n;if(ot(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(LH),s=He(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),ot(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return NH(e.event)?ve.warn(`${l}. This can cause unexpected behavior.`):ve.info(l),null}i.properties&&!Ks(i.properties)||ve.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ve.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&ot(i.properties[o]))return ve.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Ul)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}qh(e){const n=Ms(e)&&!e,r=It.Ot()&&It.Lt("ph_debug")==="true";return!n&&(!!r||e)}};Sp.__defaultExtensionClasses={},Sp.Ad=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=IB(t.prototype[e[n]])})(Sp,["identify"]);const WZ=["[data-ph-capture-value]"];var KZ=class{constructor(t){this._instance=t}refresh(t){var e;const n=this._instance.config,r=ct(n.autocapture)?n.autocapture:void 0;t.enabled=!!n.autocapture,t.rageclick=n.rageclick,t.maskAllElementAttributes=n.mask_all_element_attributes,t.maskAllText=n.mask_all_text,t.disableCaptureUrlHashes=n.disable_capture_url_hashes,t.getCurrentUrl=n.get_current_url,t.remoteRequestsDisabled=this._instance.lc(),t.url_allowlist=r==null?void 0:r.url_allowlist,t.url_ignorelist=r==null?void 0:r.url_ignorelist,t.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,t.element_allowlist=r==null?void 0:r.element_allowlist,t.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,t.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,t.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,t.capture_copied_text=r==null?void 0:r.capture_copied_text,t.capture_value_css_selector_allowlist=(e=r==null?void 0:r.capture_value_css_selector_allowlist)!==null&&e!==void 0?e:WZ}};const Hh=An("[ExceptionAutocapture]"),h3=()=>{},p3=t=>{var e;if(Vn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function Sf(t,e,n){try{if(!(e in t))return h3;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Vn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=p3(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=p3(i)}}}catch{return h3}}const qZ=An("[TracingHeaders]"),Uc=An("[Web Vitals]"),m3=9e5,g3=["CLS","FCP","INP","LCP"],GZ=["INP","LCP"],YZ=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],O2="disabled",v3="lazy_loading",Ca=An("[SessionRecording]"),XZ=[ek,tk,yM,_M,wM,bM,xM,SM,kM],QZ=An("[Heatmaps]");function M2(t){return ct(t)&&"clientX"in t&&"clientY"in t&&Yn(t.clientX)&&Yn(t.clientY)}const tg=An("[Product Tours]"),N2=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(QS))},JZ=["$set_once","$set"],$o=An("[SiteApps]"),y3="Error while initializing PostHog app with config id ";function Sd(t,e,n){if(ot(t))return!1;switch(n){case"exact":return t===e;case"contains":{const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var eW=class{constructor(t){this.$i=t,this.Ao=new Set,this.Ro=new Set,this.Po=new Nv,this.Oo=(e,n)=>this.Fo(e,n)&&this.Do(e,n)&&this.Lo(e,n)&&this.No(e,n),this.Fo=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;de((t=this.$i)===null||t===void 0?void 0:t.subscribeCapture)||(this.jo=(e=this.$i)===null||e===void 0?void 0:e.subscribeCapture((n,r)=>{this.on(n,r)}))}dispose(){var t,e,n;(t=this.jo)===null||t===void 0||t.call(this),this.jo=void 0,(e=this.$i)===null||e===void 0||(n=e.setElementSelectors)===null||n===void 0||n.call(e,new Set,this),this.Po=new Nv}register(t){var e,n;if(!de((e=this.$i)===null||e===void 0?void 0:e.subscribeCapture)&&(t.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(t){this.Ao.clear(),this.Ro.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.Ro.has(t)||this.Ro.has(e.event))&&this.Ao.forEach(n=>{this.qo(e,n)&&this.Po.emit("actionCaptured",n.name)})}Bo(t){this.onAction("actionCaptured",e=>t(e))}qo(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.Oo(t,n))return!0;return!1}onAction(t,e){return this.Po.on(t,e)}Do(t,e){if(e!=null&&e.url){var n;let i=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!(t!=null&&t.properties)||!("$current_url"in t.properties))try{var r,s;i=(r=this.$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"||!Sd(i,e.url,e.url_matching||"contains"))return!1}return!0}Lo(t,e){return!!this.zo(t,e)&&!!this.Ho(t,e)&&!!this.Uo(t,e)}zo(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.Wo(t);if(r.length>0)return r.some(i=>Sd(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&Sd((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}Ho(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.Wo(t);if(r.length>0)return r.some(c=>Sd(c.text,e.text,e.text_matching||"exact")||Sd(c.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(c){const d=[],f=/(?::|")text="(.*?)"/g;let h;for(;!ot(h=f.exec(c));)d.includes(h[1])||d.push(h[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(c=>Sd(c,o,l)));var i,o,l}Uo(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{}return!1}Wo(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}No(t,e){return!(e!=null&&e.properties)||e.properties.length===0||y5(e.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},{}),t==null?void 0:t.properties)}},tW=class{constructor(t,e){this.Vo=e,this.Go=[],this.$i=t,this.Qo=new Map,this.Jo=new Map,this.Zo=new Map}Ko(){var t,e;this.Yo=(t=(e=this.$i).subscribeSession)===null||t===void 0?void 0:t.call(e,n=>this.Xo(n))}ta(t){return!1}ea(){return null}ia(t){}na(){}sa(t,e){return!!t&&y5(t.propertyFilters,e==null?void 0:e.properties)}ra(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}oa(t,e,n){const r=(n===Fh.Activation?this.Qo:this.Jo).get(t);let s=[];return this.aa(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(c=>c.name===t);return this.sa(l,e)})}register(t){this.la(t,!1)}replace(t){this.la(t,!0)}la(t,e){de(this.$i.subscribeCapture)||(this.ua(t,e),this.ca(t,e))}ca(t,e){const n=t.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(e&&this.Zo.clear(),n.length===0)return void(e&&((r=this.ha)===null||r===void 0||r.replace([])));this.ha||(this.ha=new eW(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(l=>{if(s.push(l),l.name){var c;const d=(c=this.Zo.get(l.name))!==null&&c!==void 0?c:[];d.includes(i.id)||d.push(i.id),this.Zo.set(l.name,d)}})}),e?this.ha.replace(s):this.ha.register(s)}da(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}ua(t,e){var n,r,s;const i=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((h=d.conditions)===null||h===void 0||(h=h.events)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),o=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((h=d.conditions)===null||h===void 0||(h=h.cancelEvents)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),l=this.ra(t,Fh.Activation),c=this.ra(t,Fh.Cancellation);e?(this.Qo=l,this.Jo=c):(this.da(this.Qo,l),this.da(this.Jo,c)),(i.length!==0||o.length!==0||t.some(d=>{var f;return(f=d.conditions)===null||f===void 0||(f=f.actions)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length}))&&((n=this.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(t,e){var n,r;const s=this.va(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.fa(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.pa([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.ga(i),void this.ma([i])}if(this.Jo.has(t)){const l=this.oa(t,e,Fh.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(c=>c.id)}),this.pa(l.map(c=>c.id)),l.forEach(c=>this.ya(c.id)))}if(!this.Qo.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.Qo.get(t)});const o=this.oa(t,e,Fh.Activation);this.ba(o.map(l=>l.id))}onAction(t){this.Zo.has(t)&&this.ba(this.Zo.get(t)||[])}ba(t){if(t.length===0)return;const e=!!this.$i.getSessionId(),n=[];for(const r of t)e&&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(t){this.Go=this.Go.filter(n=>n!==t);const e=this.ka();return!e.includes(t)&&(this.Sa([...e,t]),this.xa(),!0)}pa(t){const e=new Set(t);this.Go=this.Go.filter(s=>!e.has(s));const n=this.$a(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Sa(r),r.length===0&&this.Ca()),this.ma(t),this.wa()}wa(){try{var t;(t=this.Vo)===null||t===void 0||t.call(this)}catch(e){this.va().error("Error while handling activated items change",e)}}Ta(){const t=this.ea();if(!t)return{};const e=this.$i.getProperty(t);return e&&typeof e=="object"?e:{}}_a(t){if(!this.ea())return;const e=this.Ta();this.ia(V(V({},e),{},{[t]:Date.now()}))}ma(t){if(!this.ea())return;const e=this.Ta(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Ks(n)?this.na():this.ia(n))}Ia(){this.ea()&&this.na()}getActivationTimestamp(t){if(!this.ka().includes(t))return;const e=this.Ta()[t];return Yn(e)?e:void 0}$a(){const t=this.Ma();return this.$i.getProperty(t)||[]}ka(){const t=this.$a();if(t.length===0)return[];const e=this.$i.getProperty(this.Ea()),n=this.$i.getSessionId();return n&&e===n?t:[]}xa(){const t=this.$i.getSessionId();t&&this.Aa(t)}Ca(){this.Ra()}Xo(t){const e=this.$i.getProperty(this.Ea());if(e&&e!==t){const n=this.$a(),r=this.Ta();n.length>0&&(this.Sa([]),n.filter(s=>Yn(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(t=>!this.Pa(t))}dispose(){var t,e,n;(t=this.Yo)===null||t===void 0||t.call(this),this.Yo=void 0,(e=this.jo)===null||e===void 0||e.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}},nW=class extends tW{constructor(t,e,n,r){var s;super({subscribeCapture(i){const o=t.onEvent(l=>i(l.event,l));return()=>o.dispose()},subscribeSession(i){const o=t.onSession(i);return()=>o.dispose()},getSessionId(){var i;return(i=t.session)===null||i===void 0?void 0:i.sessionId},getProperty:i=>t.kv.get(i),getActionUrl:n==null?void 0:n.getActionUrl,setElementSelectors:(s=n==null?void 0:n.setElementSelectors)!==null&&s!==void 0?s:(i,o)=>{var l;return(l=t.getExtension("autocapture"))===null||l===void 0?void 0:l.setElementSelectors(i,o)}},r),this.Fa=t,this.Da=e,this.Ko()}Ma(){return yb}Ea(){return Fg}ea(){return jg}ia(t){this.Fa.kv.set({[jg]:t})}na(){this.Fa.kv.remove(jg)}ta(t){var e;let n;this.aa(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return Yn(r)&&r>0}La(){return yi.SHOWN}aa(t){this.Da.getSurveys(t)}ya(t){this.Da.cancelPendingSurvey(t)}va(){return Zt}Sa(t){this.Fa.kv.set({[yb]:t})}Aa(t){this.Fa.kv.set({[Fg]:t})}Ra(){this.Fa.kv.remove(Fg)}Pa(){return!1}fa(t,e,n){var r;if(t===yi.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===e)}),!s||(function(i){var o;return g5(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===yi.SHOWN?"consume":"ignore":t===yi.SHOWN?"persist":t===yi.DISMISSED||t===yi.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};const dk=(t,e)=>t!=null&&t.then?t.then(e):e(t),kd="SDK is not enabled or survey functionality is not yet loaded",_3="Disabled. Not loading surveys.";var rW=class{constructor(t){this.Na=t,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=e=>{if(this.Ti||this.Fr.disableSurveys)return;if(!e.ok)return this.qa=!0,this.Va({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Zt.warn("Remote config unavailable. Not loading surveys.");const n=e.config.surveys;if(ot(n))return Zt.warn("Flags not loaded yet. Not loading surveys.");this.Ga=Ms(n)?n:n.length>0,Zt.info(`flags response received, isSurveysEnabled: ${this.Ga}`),this.loadIfEnabled()},this.Va=e=>{this.za.slice().forEach(n=>this.Qa(n,e))}}setup(t){if(!this.Ti)return this.Ja=t,dk(t.kv.initialize(),()=>{if(this.Ja!==t||this.Ti)return;this.Ja=void 0,this.Fa=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Ti?e.dispose():(this.Za=e,this.loadIfEnabled())})}dispose(){var t,e,n,r,s;this.Ti||(this.Ti=!0,this.Ja=void 0,this.Fa=void 0,(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.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 t=this;return{client:this.Fa,get config(){return t.Fr},surveys:t}}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}this.Va()}loadIfEnabled(){if(this.Ti||!this.Fa)return;const t=this.Fr;if(this._surveyManager)return;if(this.ja)return void Zt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Zt.info(_3);if(t.cookielessMode&&this.Fa.isOptedOut)return void Zt.info("Not loading surveys in cookieless mode without consent.");const e=this.Na.getExtensions();if(!e)return void this.Ya("PostHog Extensions not found.");if(de(this.Ga)&&!t.advancedEnableSurveys)return;const n=this.Ga||t.advancedEnableSurveys;this.ja=!0,this.qa=!1;try{const r=e.generateSurveys;if(r)return this.Xa(r,n),void(this.ja=!1);const s=e.loadExternalDependency;if(!s)return this.Ya(vb),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(t,e){var n;if(this.Ti)return;this._surveyManager=t(e),this._surveyEventReceiver=this.tl(this.Fa,this.Va);const r=(n=this.Fa)===null||n===void 0?void 0:n.kv.get(Jh);r&&this.el(r),Zt.info("Surveys loaded successfully"),this.il(),this.Va(),this.nl({isLoaded:!0})}tl(t,e){return new nW(t,this,void 0,e)}Ya(t,e){this.qa=!0,Zt.error(t,e),this.Va({isLoaded:!1,error:t}),this.nl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ba.push(t),this._surveyManager&&this.nl({isLoaded:!0}),()=>{this.Ba=this.Ba.filter(e=>e!==t)}}getSurveys(t,e=!1){if(this.Ti)return;const n=this.Fa;if(!n)return t([],{isLoaded:!1,error:kd});if(this.Fr.disableSurveys)return Zt.info(_3),t([]);const r=n.kv.get(Jh);if(r&&!e)return t(r,{isLoaded:!0}),void(this.sl()&&this.getSurveys(()=>{},!0));if(this.Ha)return void this.Ha.then(({surveys:o,context:l})=>{this.Ti||t(o,l)}).catch(o=>Zt.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(l){return Zt.error("Error processing surveys response",l),this.rl(n,{statusCode:0,error:l})}},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),t(o.surveys,o.context))},i).catch(o=>Zt.error("Error in survey callback",o))}rl(t,e){if(this.Ti)return{surveys:[],context:{isLoaded:!1,error:kd}};const n=e.statusCode;if(n!==200||!e.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Zt.error(s):e.error||Zt.warn(s),this.Ua=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Ua=null;const r=e.json.surveys||[];return t.kv.set({[Jh]:r,[Pv]:Date.now()}),this.el(r),{surveys:r,context:{isLoaded:!0}}}el(t){const e=t.filter(n=>(function(r){return!(!r.start_date||r.end_date)})(n)&&(g5(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(e)}al(t){var e;(e=this._surveyEventReceiver)===null||e===void 0||e.replace(t)}sl(){return this.ll()&&!this.Ha&&!this.ul()}ll(){var t;const e=(t=this.Fa)===null||t===void 0?void 0:t.kv.get(Pv);return Yn(e)&&Date.now()-e>3e5}ul(){return Yn(this.Ua)&&3e5>Date.now()-this.Ua}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};_5(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Va()}nl(t){for(const e of this.Ba){if(this.Ti)return;try{t.isLoaded?this.getSurveys(e):e([],t)}catch(n){Zt.error("Error in survey callback",n)}}}getActiveMatchingSurveys(t,e=!1){if(!ot(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Zt.warn("init was not called")}onActiveMatchingSurveysChanged(t){var e;if(this.Ti)return()=>{};const n={callback:t,active:!0,revision:0};this.za.push(n),this.il();const r=(e=this.Fa)===null||e===void 0?void 0:e.kv.get(Jh);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 t,e,n;this._surveyManager&&this.za.length>0&&((t=this.Ka)!==null&&t!==void 0||(this.Ka=(e=(n=this.Na).onMatchingConditionsChanged)===null||e===void 0?void 0:e.call(n,this.Va)))}Qa(t,e){if(this.Ti||!t.active)return;const n=++t.revision,r=s=>{if(!this.Ti&&t.active&&n===t.revision)try{const i=e??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===t.lastResult)return;t.lastResult=o,t.callback(s,i)}catch(i){Zt.error("Error in active matching surveys callback",i)}};try{e&&!e.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Zt.error("Error in active matching surveys callback",s)}}cl(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}hl(t){if(ot(this._surveyManager))return{eligible:!1,reason:kd};const e=typeof t=="string"?this.cl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}dl(t){var e;if(!(!((e=this.Fa)===null||e===void 0)&&e.canCapture))return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(ot(this._surveyManager))return{eligible:!1,reason:kd};const n=typeof t=="string"?this.cl(t):t;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ot(this._surveyManager))return Zt.warn("init was not called"),{visible:!1,disabledReason:kd};const e=this.dl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return ot(this._surveyManager)?(Zt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:kd})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.dl(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r,s,i;if(!(!((r=this.Fa)===null||r===void 0)&&r.canCapture))return;if(ot(this._surveyManager))return void Zt.warn("init was not called");const o=typeof t=="string"?this.cl(t):t;if(!(o!=null&&o.id))return void Zt.warn("Survey not found");if(!CZ.includes(o.type))return void Zt.warn(`Surveys of type ${o.type} cannot be rendered in the app`);const l=(s=typeof document>"u"?void 0:document)===null||s===void 0?void 0:s.querySelector(e);if(l){if(!((i=o.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){Zt.info(`Rendering survey ${o.id} with delay of ${o.appearance.surveyPopupDelaySeconds} seconds`);const c=setTimeout(()=>{var d,f,h;this.Wa.delete(c),!this.Ti&&(!((d=this.Fa)===null||d===void 0)&&d.canCapture)&&(Zt.info(`Rendering survey ${o.id} with delay of ${(f=o.appearance)===null||f===void 0?void 0:f.surveyPopupDelaySeconds} seconds`),(h=this._surveyManager)===null||h===void 0||h.renderSurvey(o,l,n),Zt.info(`Survey ${o.id} rendered`))},1e3*o.appearance.surveyPopupDelaySeconds);return void this.Wa.add(c)}this._surveyManager.renderSurvey(o,l,n)}else Zt.warn("Survey element not found")}displaySurvey(t,e){var n,r;if(!(!((n=this.Fa)===null||n===void 0)&&n.canCapture))return;if(ot(this._surveyManager))return void Zt.warn("init was not called");const s=this.cl(t);if(!s)return void Zt.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=V(V({},s),{},{appearance:V(V({},s.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==Rb.Popover&&e.initialResponses&&Zt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const o=this.hl(s);if(!o.eligible)return void Zt.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==Rb.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}cancelPendingSurvey(t){ot(this._surveyManager)?Zt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}},sW=class{constructor(t){this._instance=t}get(){var t,e,n,r;const s=(t=this._instance)===null||t===void 0?void 0:t.config;return{disableSurveys:!!(s!=null&&s.disable_surveys),cookielessMode:!!(s!=null&&s.cookieless_mode),advancedEnableSurveys:!!(s!=null&&s.advanced_enable_surveys),requestTimeoutMs:(e=s==null?void 0:s.surveys_request_timeout_ms)!==null&&e!==void 0?e:1e4,prefillFromUrl:!!(!(s==null||(n=s.surveys)===null||n===void 0)&&n.prefillFromUrl),automaticDisplay:!(s!=null&&s.disable_surveys_automatic_display),featureFlagEvaluation:!(s!=null&&s.advanced_disable_feature_flags),overrideLanguage:s==null?void 0:s.override_display_language,prepareStylesheet:s==null?void 0:s.prepare_external_dependency_stylesheet,get_current_url:s==null?void 0:s.get_current_url,uiHost:(r=this._instance)===null||r===void 0||(r=r.requestRouter)===null||r===void 0?void 0:r.endpointFor("ui","")}}getExtensions(){const t=et==null?void 0:et.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n,loadExternalDependency:r}=t;return{generateSurveys:n?s=>n(e,s):void 0,loadExternalDependency:r?s=>r(e,"surveys",s):void 0}}onMatchingConditionsChanged(t){var e,n;const r=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook(l=>{l!=="$pageview"&&l!==yi.SHOWN&&l!==yi.DISMISSED&&l!==yi.SENT||t()}),s=()=>t();Lt(ce,"PHSurveyShown",s);let i=!1;const o=(n=this._instance)===null||n===void 0?void 0:n.onFeatureFlags(()=>{i&&t()});return i=!0,()=>{i=!1,r==null||r(),o==null||o(),ce==null||ce.removeEventListener("PHSurveyShown",s)}}};const iW=ce!=null&&ce.location?Iv(ce.location.hash,"__posthog")||Iv(location.hash,"state"):null,w3="_postHogToolbarParams",b3=An("[Toolbar]"),x3=An("[FeatureFlags]"),Bc=An("[FeatureFlags]",{debugEnabled:!0}),L2=`" failed. Feature flags didn't load in time.`,oW=[502,504],S3=["click","keydown","wheel","touchstart","pointerdown"],k3="connection_error",E3=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},C3=t=>{const e={};for(const[n,r]of Vg(t||{}))r&&(e[n]=r);return e},aW=(t,e)=>t.distinctId===e.distinctId&&t.sessionId===e.sessionId&&((n,r)=>{const s=Object.keys(n);return s.length===Object.keys(r).length&&s.every(i=>n[i]===r[i])})(t.groups,e.groups);var lW=class{constructor(t){this.name="featureFlags",this.Pd=!1,this.featureFlagEventHandlers=[],this.R=x3,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 e=this.Kd();this.Jd=0,e&&this.reloadFeatureFlags()},this.Yd=()=>{var e,n;const r=this.Xd,s=(e=this.tv)!==null&&e!==void 0?e:r;de(r)||de(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 e;((e=this.ev)===null||e===void 0?void 0:e.visibilityState)==="visible"&&this.rv()},this.Na=t}get ov(){}av(){this.Fa&&this.lv()}setup(t){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=t,this.R=t.logger.createLogger("[FeatureFlags]"),dk(t.kv.initialize(),()=>{this.Ja===t&&(this.Ja=void 0,this.Fa=t,this.hv(t))})}hv(t){var e;if(this.Fa===t)return this.uv&&Lt(this.uv,"online",this.sn),this.lv(),this.dv=t.registerDynamicEventProperties(()=>this.vv()?this.Od:this.Fd),this.fv=(e=this.ov)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.pv(),this.gv(),this.mv()}),this.gv(),this.initialize()}rv(){this.Zd=!0,this.tv=this.Xd,this.Yd()}lv(){var t;const e=this.Fr.refreshIntervalMs,n=!this.Fr.remoteRequestsDisabled&&this.ev&&!de(e)&&e>0?e:void 0;this.Fr.idleRefreshBackoff||(this.tv=n),n!==this.Xd&&(this.yv(),de(n)||(this.Xd=n,this.tv=n,this.nv(),!((t=this.ev)===null||t===void 0)&&t.addEventListener&&(Lt(this.ev,qd,this.an),Fd(S3,r=>{Lt(this.ev,r,this.sv,{capture:!0})}))))}nv(){de(this.Xd)||(de(this.bv)||clearInterval(this.bv),this.iv=Date.now(),this.bv=setInterval(this.Yd,this.Xd))}yv(){var t,e;de(this.bv)||(clearInterval(this.bv),this.bv=void 0,(t=this.ev)===null||t===void 0||(e=t.removeEventListener)===null||e===void 0||e.call(t,"visibilitychange",this.an),Fd(S3,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 t,e,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(),(t=this.dv)===null||t===void 0||t.dispose(),this.dv=void 0,(e=this.fv)===null||e===void 0||e.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(t){var e;return this.$v&&t in this.$v?this.$v[t]:(e=this.Fa)===null||e===void 0?void 0:e.kv.get(t)}pv(){return!!this.$v&&(this.$v=void 0,!0)}Cv(){var t;return!de((t=this.Fa)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.pv()}$t(t){this.Tv(()=>{var e;return(e=this.Fa)===null||e===void 0?void 0:e.kv.set(t)})}Iv(t,e,n){if(!this.ov||!t.$enabled_feature_flags)return;const r=this.xv("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},i=e.flags||e.featureFlags,o=e.flags?Object.entries(e.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,c=l?o:n&&!He(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.xv("$feature_flag_payloads")||{},f=t.$feature_flag_payloads||{},h=l||n?c:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),m=!l&&!n,v=!!m||c,y=!!m||h,_={[Va]:v,[_o]:v,[Zl]:y};t.$feature_flag_details&&(_[_u]=v);for(const b of[wu,Ql,pp])de(t[b])||(_[b]=!0);this.ov.markCrossTabFeatureFlagChanges(_)}Dt(t){this.Tv(()=>{var e;return(e=this.Fa)===null||e===void 0?void 0:e.kv.remove(t)})}Tv(t){try{t()}catch(e){this.R.error("Failed to update feature flag persistence",e)}}gv(){const t={};for(const r of[Va,Zl,wu,Vo]){const s=this.xv(r);de(s)||(t[r]=s)}this.Od=t;const e=V({},t),n=this.xv(_o);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.Fd=e}vv(){const t=this.Fr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.xv(Ql);return typeof e!="number"||Date.now()-e>t}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 t=this.Fr.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.R.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Av(){const t=this.Fr.flagKeys;if(!de(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.R.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Fr,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!de(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),c=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Rv({featureFlags:l,featureFlagPayloads:c},void 0,{persist:!1})}}updateFlags(t,e,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:{},l=V(V({},i),t),c=V(V({},o),e),d={};for(const[f,h]of Object.entries(l))d[f]={key:f,enabled:pP(h),variant:mP(h),reason:void 0,metadata:de(c==null?void 0:c[f])?void 0:{id:0,version:void 0,description:void 0,payload:c[f]}};this.Rv({flags:d})}get hasLoadedFlags(){return this.jd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.xv(_u),e=this.xv(Vo),n=this.xv(nu);if(!n&&!e)return t||{};const r=_n({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i,o;const c=r[l],d=e==null?void 0:e[l],f=de(d)?(i=c==null?void 0:c.enabled)!==null&&i!==void 0&&i:!!d,h=de(d)?c==null?void 0:c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[l],v=V(V({},c),{},{enabled:f,variant:f?h??(c==null?void 0:c.variant):void 0});f!==(c==null?void 0:c.enabled)&&(v.original_enabled=c==null?void 0:c.enabled),h!==(c==null?void 0:c.variant)&&(v.original_variant=c==null?void 0:c.variant),m&&(v.metadata=V(V({},c==null?void 0:c.metadata),{},{payload:m,original_payload:c==null||(o=c.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.Pd||(this.R.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Pd=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:pP(r),variant:mP(r),payload:hP(e[n])}})}getFlagVariants(){const t=this.xv(_o),e=this.xv(Vo);if(!e)return t||{};const n=_n({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Pd||(this.R.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Pd=!0),n}getFlagPayloads(){const t=this.xv(Zl),e=this.xv(nu);if(!e)return t||{};const n=_n({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Pd||(this.R.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,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(t=>{try{t()}catch(e){this.R.error("Error while running feature flags reloading callback",e)}}),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(t=>{this.Ld.add(t),this.reloadFeatureFlags()})}wv(t,e){t.forEach(n=>n({status:e})),t.clear()}Sv(){clearTimeout(this.Pv),this.Pv=void 0}onReloading(t){return this.Dd.push(t),()=>{this.Dd=this.Dd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.jd||this.qd||this.Pv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.zd=t}resetFlagCallReported(){this.Dt(qo),this.Wd=new Map}sendFlagCallsPendingCapture(){var t;if(this.Wd.size!==0&&!this.Vd&&(!((t=this.Fa)===null||t===void 0)&&t.canCapture)&&!this.Fa.isRateLimited){this.Vd=!0;try{const e=this.getFlagVariants();for(const n of Array.from(this.Wd.keys())){const r=this.Wd.get(n);if(r){if(r.value!==String(e[n])||!aW(r.context,this.Fv())){this.Wd.delete(n);continue}if(this.getFeatureFlagResult(n),this.Wd.has(n))break}}}finally{this.Vd=!1}}}Ov(t){var e;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:V(V(V({},n.initialPersonProperties),this.xv("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.xv(Ul),timezone:lk()};de(n.deviceId)||(r.$device_id=n.deviceId),(t!=null&&t.disableFlags||this.Fr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.Ev();s.length&&(r.evaluation_contexts=s);const i=this.Av();de(i)||(r.flag_keys=i);const o=this.Fr.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),c=this.Bd,d=this.Ld;this.Ld=new Set,this.Nd=d,this.qd=!0;const f=()=>{this.Hd&&(this.Hd=!1,this.Ov())},h=b=>{var x,k;const C=(x=b.json)!==null&&x!==void 0?x:{},P=b.statusCode!==200;if(this.qd=!1,c!==this.Bd)return void f();if(this.Dv(b.statusCode),P||this.Hd||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.Hd)return void this.wv(d,"skipped");this.Gd=!P;const R=[];b.error?R.push(b.error instanceof Error&&b.error.name==="AbortError"?"timeout":b.error instanceof Error?k3:"unknown_error"):b.statusCode!==200&&R.push(`api_error_${b.statusCode}`),C.errorsWhileComputingFlags&&R.push("errors_while_computing_flags");const O=!!(!((k=C.quotaLimited)===null||k===void 0)&&k.includes("feature_flags"));O&&R.push("quota_limited"),this.$t({[jp]:R}),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,P,{partialResponse:o}),this.wv(d,r.disable_flags?"skipped":R.length||!C.flags&&!C.featureFlags?"error":"loaded"),f()},m=b=>{this.qd=!1,c===this.Bd&&(this.$t({[jp]:[k3]}),this.R.error("Feature flag request failed",b),this.Cv()&&this.mv(!0),this.wv(d,"error")),f()};let v=(e=this.Fr.requestMaxRetries)!==null&&e!==void 0?e:1;const y=()=>v>0&&c===this.Bd,_=()=>{if(c!==this.Bd||!this.Fa||this.Fr.remoteRequestsDisabled)return this.qd=!1,this.wv(d,"skipped"),void f();try{n.sendRequest(l,{target:"flags",method:"POST",body:r,compression:this.Fr.compression,sentAt:"body",timeoutMs:this.Fr.requestTimeoutMs}).then(b=>{if((x=>oW.includes(x.statusCode)||(k=>k.statusCode===0&&k.error instanceof Error&&k.error.name==="AbortError")(x))(b)&&y())return v--,void setTimeout(_,500);h(b)}).catch(m)}catch(b){m(b)}};_()}Kd(){return zM(this.Jd,3)}Dv(t){this.Jd=VM(t,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(t,e={}){var n;if(e.fresh&&!this.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlag for key "'+t+L2);if(this.Mv())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlagResult for key "'+t+L2);if(this.Mv())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.xv("$feature_flag_request_id")||void 0,c=this.xv("$feature_flag_evaluated_at")||void 0;let d,f=this.xv("$flag_call_reported")||{};if(this.Fr.deduplicateCallsPerSession){var h;const q=(h=this.Fa)===null||h===void 0||(h=h.session)===null||h===void 0?void 0:h.sessionId,X=this.xv(Qh);q&&q!==X&&(f={},d=q)}if(!e.send_event&&"send_event"in e)d&&this.$t({[qo]:f,[Qh]:d});else{var m,v,y;const q=!(!((m=this.Fa)===null||m===void 0)&&m.canCapture),X=!q&&!(!((v=this.Fa)===null||v===void 0)&&v.isRateLimited);var _;if(X?this.Wd.delete(t):(q&&Object.keys(f).length>0&&(f={},this.$t({[qo]:f})),!((_=f[t])===null||_===void 0)&&_.includes(o)||this.Lv(t,o)),X&&!(!((y=f[t])===null||y===void 0)&&y.includes(o))){var b,x,k,C,P,R,O,I,A,M,L,z,$;He(f[t])?f[t].push(o):f[t]=[o],this.$t(V({[qo]:f},d?{[Qh]:d}:{}));const j=this.getFeatureFlagDetails(t),K=[...(b=this.xv("$feature_flag_errors"))!==null&&b!==void 0?b:[]];de(s)&&K.push("flag_missing");const ee={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:(x=(k=this.Fr.bootstrap)===null||k===void 0||(k=k.featureFlags)===null||k===void 0?void 0:k[t])!==null&&x!==void 0?x:null,$feature_flag_bootstrapped_payload:(C=(P=this.Fr.bootstrap)===null||P===void 0||(P=P.featureFlagPayloads)===null||P===void 0?void 0:P[t])!==null&&C!==void 0?C:null,$used_bootstrap_value:!this.Gd};de(j==null||(R=j.metadata)===null||R===void 0?void 0:R.has_experiment)||(ee.$feature_flag_has_experiment=j.metadata.has_experiment),de(j==null||(O=j.metadata)===null||O===void 0?void 0:O.version)||(ee.$feature_flag_version=j.metadata.version);const H=(I=j==null||(A=j.reason)===null||A===void 0?void 0:A.description)!==null&&I!==void 0?I:j==null||(M=j.reason)===null||M===void 0?void 0:M.code;H&&(ee.$feature_flag_reason=H),!(j==null||(L=j.metadata)===null||L===void 0)&&L.id&&(ee.$feature_flag_id=j.metadata.id),de(j==null?void 0:j.original_variant)&&de(j==null?void 0:j.original_enabled)||(ee.$feature_flag_original_response=de(j.original_variant)?j.original_enabled:j.original_variant),!(j==null||(z=j.metadata)===null||z===void 0)&&z.original_payload&&(ee.$feature_flag_original_payload=j==null||($=j.metadata)===null||$===void 0?void 0:$.original_payload),K.length&&(ee.$feature_flag_error=K.join(",")),this.Nv(ee)||(this.jv(t,o),this.Lv(t,o))}else d&&this.$t({[qo]:f,[Qh]:d})}return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:hP(i)}:void 0}Nv(t){try{var e;return((e=this.Fa)===null||e===void 0?void 0:e.capture("$feature_flag_called",t))!==!1}catch(n){return this.R.error("Failed to capture feature flag call",n),!0}}Lv(t,e){this.Wd.set(t,{value:e,context:this.Fv()})}Fv(){var t,e,n;return{distinctId:(t=this.Fa)===null||t===void 0?void 0:t.distinctId,groups:V({},(e=this.Fa)===null||e===void 0?void 0:e.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(t,e){const n=this.xv("$flag_call_reported")||{},r=n[t];He(r)&&r.includes(e)&&(n[t]=r.filter(s=>s!==e),this.$t({[qo]:n}))}getRemoteConfigPayload(t,e){this.qv(t,e)}qv(t,e){var n=this;return pn(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 l;de(o)||(s.flag_keys=o);try{var c;const d=(c=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Fr.compression,sentAt:"body",timeoutMs:n.Fr.requestTimeoutMs})).json)===null||c===void 0?void 0:c.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.R.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.R.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.Gd)return e.defaultValue;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return this.R.warn('isFeatureEnabled for key "'+t+L2),e.defaultValue;const n=this.getFeatureFlag(t,e);return de(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Rv(t,e,n)}Rv(t,e,n){if(!this.Fa)return;this.jd=!0;const r=((s,i={},o={},l={},c,d=x3)=>{const f=((C,P)=>{const R=C.flags;if(R){const O=Object.fromEntries(Object.keys(R).map(A=>{var M;return[A,(M=R[A].variant)!==null&&M!==void 0?M:R[A].enabled]})),I=Object.fromEntries(Object.keys(R).filter(A=>R[A].enabled).filter(A=>{var M;return!de((M=R[A].metadata)===null||M===void 0?void 0:M.payload)}).map(A=>{var M;return[A,(M=R[A].metadata)===null||M===void 0?void 0:M.payload]}));return V(V({},C),{},{featureFlags:O,featureFlagPayloads:I})}return C.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),h=f.flags,m=f.featureFlags,v=f.featureFlagPayloads;if(!m)return;const y=s.requestId,_=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 P=0;m.length>P;P++)C[m[P]]=!0;return{[Va]:m,[_o]:C,[pp]:!1}}let b=m,x=v,k=h;if(c!=null&&c.partialResponse){const C=Object.keys(b),P=x||{};b=V(V({},i),b),x=V(V({},o),P),C.forEach(R=>{R in P||x==null||delete x[R]}),k=V(V({},l),k)}else if(s.errorsWhileComputingFlags)if(h){const C=new Set(Object.keys(h).filter(R=>{var O;return!(!((O=h[R])===null||O===void 0)&&O.failed)}));b=V(V({},i),Object.fromEntries(Object.entries(b).filter(([R])=>C.has(R))));const P=Object.fromEntries(Object.entries(x||{}).filter(([R])=>C.has(R)));x=V(V({},o),P),C.forEach(R=>{R in P||x==null||delete x[R]}),k=V(V({},l),Object.fromEntries(Object.entries(k||{}).filter(([R])=>C.has(R))))}else b=V(V({},i),b),x=V(V({},o),x),k=V(V({},l),k);return V(V({[Va]:Object.keys(C3(b)),[_o]:b||{},[Zl]:x||{},[_u]:k||{},[pp]:s.minimalFlagCalledEvents===!0},y?{[wu]:y}:{}),_?{[Ql]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.R);if(r)if((n==null?void 0:n.persist)===!1){const s=!de(this.Fa.kv.get(_o));this.$v=r,s||this.$t(r)}else this.pv(),this.Iv(r,t,!!(n!=null&&n.partialResponse)),this.$t(r);else e&&this.Cv();e||(this.Qd=!1),this.mv(e)}override(t,e=!1){this.R.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Bv(t)}Bv(t){if(this.Fa){if(t===!1)return this.Dt([Vo,nu]),this.mv(),void Bc.info("All overrides cleared");if(He(t))return this.$t({[Vo]:E3(t)}),this.mv(),void Bc.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Pd=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Vo]=He(s)?E3(s):s),i&&(r[nu]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Dt([Vo,nu]):s===!1?this.Dt(Vo):i===!1&&this.Dt(nu),this.mv(),s===!1?Bc.info("Flag overrides cleared"):s&&Bc.info("Flag overrides set",{flags:s}),void(i===!1?Bc.info("Payload overrides cleared"):i&&Bc.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.$t({[Vo]:t}),this.mv(),void Bc.info("Flag overrides set",{flags:t});this.R.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.R.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.jd){const{flags:e,flagVariants:n}=this.zv();try{t(e,n)}catch(r){this.R.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.xv("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=V(V({},this.getFlagVariants()),{},{[t]:e});(r=this.ov)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.$t({[Va]:Object.keys(C3(l)),[_o]:l,[Bl]:V(V({},this.xv("$stored_person_properties")||{}),i)}),this.mv();try{var c;(c=this.Fa)===null||c===void 0||c.capture("$feature_enrollment_update",o)}catch(d){this.R.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.xv(gb);!r||e?this.Hv(t,n):t(r)}Hv(t,e){var n=this;return pn(function*(){const r=n.Fa;if(!r)return;const s=e?`&${e.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.$t({[gb]:i})}catch(o){return void n.R.error("Early access feature request failed",o)}try{t(i)}catch(o){n.R.error("Early access feature callback failed",o)}})()}zv(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}mv(t){this.gv();const{flags:e,flagVariants:n}=this.zv(),r=this.Ud;this.Ud=!0,this.featureFlagEventHandlers.forEach(s=>{try{s(e,n,{errorsLoading:t})}catch(i){this.R.error("Error while running feature flags callback",i)}}),this.Ud=r}setPersonPropertiesForFlags(t,e=!0){this.Uv(t,e)}Uv(t,e=!0){const n=this.xv("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.$t({[Bl]:V(V(V({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=V({},this.xv("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.$t({[Bl]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Dt(Bl),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.xv("$stored_group_properties")||{},r=V({},n);for(const s of Object.keys(t))r[s]=V(V({},n[s]),t[s]);this.$t({[Ul]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.xv("$stored_group_properties")||{};this.$t({[Ul]:V(V({},e),{},{[t]:{}})})}else this.Dt(Ul)}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 P3=An("[FeatureFlags]");var cW=class{constructor(t,e=!1){this.Wv=!1,this.update(t,e)}update(t,e){this.Vv=((n,r)=>{var s,i,o,l,c,d,f,h;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(c=n.remote_config_refresh_interval_ms)!==null&&c!==void 0?c:3e5,idleRefreshBackoff:de(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(h=n.evaluation_contexts)!==null&&h!==void 0?h:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:He(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Wv||(P3.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Wv=!0),de(t.flag_keys)||He(t.flag_keys)||P3.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Vv}},ng=class extends lW{constructor(t){const e=new cW(t.config,t.lc());super(e),this.name=x5,this._instance=t,this.Gv=e}get ov(){return this._instance.persistence}updateConfig(t,e){this.Gv.update(t,e),this.av()}};const T3=t=>Wf(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),uo=An("[Error tracking]"),Db="webkit-masked-url:",uW=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],dW=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Db],fW=["__firefox__","__gCrWeb"];function R3(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function hW(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,o,l,c,d=[],f=!0,h=!1;try{if(l=(s=s.call(n)).next,r!==0)for(;!(f=(i=l.call(s)).done)&&(d.push(i.value),d.length!==r);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(h)throw o}}return d}})(t,e)||(function(n,r){if(n){if(typeof n=="string")return R3(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)?R3(n,r):void 0}})(t,e)||(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 E5=Object.entries,A3=Object.setPrototypeOf,pW=Object.isFrozen,mW=Object.getPrototypeOf,gW=Object.getOwnPropertyDescriptor;let es=Object.freeze,rs=Object.seal,Od=Object.create,C5=typeof Reflect<"u"&&Reflect,$b=C5.apply,Fb=C5.construct;es||(es=function(t){return t}),rs||(rs=function(t){return t}),$b||($b=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;n>s;s++)r[s-2]=arguments[s];return t.apply(e,r)}),Fb||(Fb=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return new t(...n)});const Ed=Sr([].forEach),vW=Sr([].lastIndexOf),I3=Sr([].pop),Cd=Sr([].push),yW=Sr([].splice),Ml=Array.isArray,np=Sr("".toLowerCase),D2=Sr("".toString),O3=Sr("".match),Uh=Sr("".replace),M3=Sr("".indexOf),_W=Sr("".trim),wW=Sr(0 .toString),bW=Sr(Boolean.prototype.toString),N3=typeof BigInt>"u"?null:Sr(BigInt.prototype.toString),L3=typeof Symbol>"u"?null:Sr(Symbol.prototype.toString),Ur=Sr({}.hasOwnProperty),rg=Sr({}.toString),Vr=Sr(/t/.test),Zc=(D3=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return Fb(D3,e)});var D3;function Sr(t){return function(e){e instanceof RegExp&&(e.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 $b(t,e,r)}}function Bt(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:np;if(A3&&A3(t,null),!Ml(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const i=n(s);i!==s&&(pW(e)||(e[r]=i),s=i)}t[s]=!0}return t}function xW(t){for(let e=0;t.length>e;e++)Ur(t,e)||(t[e]=null);return t}function hs(t){const e=Od(null);for(const r of E5(t)){var n=hW(r,2);const s=n[0],i=n[1];Ur(t,s)&&(e[s]=Ml(i)?xW(i):i&&typeof i=="object"&&i.constructor===Object?hs(i):i)}return e}function fo(t,e){for(;t!==null;){const n=gW(t,e);if(n){if(n.get)return Sr(n.get);if(typeof n.value=="function")return Sr(n.value)}t=mW(t)}return function(){return null}}const $3=es(["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"]),$2=es(["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"]),F2=es(["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"]),SW=es(["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"]),j2=es(["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"]),kW=es(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),F3=es(["#text"]),j3=es(["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"]),z2=es(["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"]),z3=es(["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"]),sg=es(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),EW=rs(/{{[\w\W]*|^[\w\W]*}}/g),CW=rs(/<%[\w\W]*|^[\w\W]*%>/g),PW=rs(/\${[\w\W]*/g),TW=rs(/^data-[\-\w.\u00B7-\uFFFF]+$/),RW=rs(/^aria-[\-\w]+$/),V3=rs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),AW=rs(/^(?:\w+script|data):/i),IW=rs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),OW=rs(/^html$/i),MW=rs(/^[a-z][.\w]*(-[.\w]+)+$/i),H3=rs(/<[/\w!]/g),U3=rs(/<[/\w]/g),NW=rs(/<\/no(script|embed|frames)/i),LW=rs(/\/>/i),DW=function(){return typeof window>"u"?null:window},Cl=function(t,e,n,r){return Ur(t,e)&&Ml(t[e])?Bt(r.base?hs(r.base):{},t[e],r.transform):n};var $W=(function t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:DW();const n=F=>t(F);if(n.version="3.4.13",n.removed=[],!e||!e.document||e.document.nodeType!==9||!e.Element)return n.isSupported=!1,n;let r=e.document;const s=r,i=s.currentScript,o=e.HTMLTemplateElement,l=e.Node,c=e.NodeFilter,d=e.DOMParser,f=e.trustedTypes,h=e.Element.prototype,m=fo(h,"cloneNode"),v=fo(h,"remove"),y=fo(h,"nextSibling"),_=fo(h,"childNodes"),b=fo(h,"parentNode"),x=fo(h,"shadowRoot"),k=fo(h,"attributes"),C=l&&l.prototype?fo(l.prototype,"nodeType"):null,P=l&&l.prototype?fo(l.prototype,"nodeName"):null,R=l&&l.prototype?fo(l.prototype,"ownerDocument"):null;if(typeof o=="function"){const F=r.createElement("template");F.content&&F.content.ownerDocument&&(r=F.content.ownerDocument)}let O,I,A="",M=!1,L=0;const z=function(){if(L>0)throw Zc('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.')},$=function(F){z(),L++;try{return O.createHTML(F)}finally{L--}},q=r.implementation,X=r.createNodeIterator,j=r.createDocumentFragment,K=r.getElementsByTagName,ee=s.importNode;let H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported=typeof E5=="function"&&typeof b=="function"&&q&&q.createHTMLDocument!==void 0;const Q=EW,B=CW,D=PW,G=TW,fe=RW,ie=AW,ue=IW,he=MW;let we=V3,le=null;const se=Bt({},[...$3,...$2,...F2,...j2,...F3]);let be=null;const Se=Bt({},[...j3,...z2,...z3,...sg]);let $e=Object.seal(Od(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}})),kt=null,tn=null;const nn=Object.seal(Od(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xt=!0,Dt=!0,un=!1,Kt=!0,Le=!1,Qe=!0,Ae=!1,Ct=!1,ke=null,$t=null,ft=!1,pt=!1,tr=!1,Mi=!1,Pn=!0,lr=!1;const no="user-content-";let xs=!0,ss=!1,nr={},vn=null;const is=Bt({},["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 pr=null;const Eo=Bt({},["audio","video","img","source","image","track"]);let Kr=null;const rr=Bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lr="http://www.w3.org/1998/Math/MathML",li="http://www.w3.org/2000/svg",cr="http://www.w3.org/1999/xhtml";let Ss=cr,st=!1,cn=null;const rn=Bt({},[Lr,li,cr],D2),yn=es(["mi","mo","mn","ms","mtext"]);let Tn=Bt({},yn);const qt=es(["annotation-xml"]);let $n=Bt({},qt);const os=Bt({},["title","style","font","a","script"]);let sr=null;const kr=["application/xhtml+xml","text/html"];let Ut=null,Ni=null;const rh=r.createElement("form"),il=function(F){return F instanceof RegExp||F instanceof Function},Co=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ni&&Ni===F)return;F&&typeof F=="object"||(F={}),F=hs(F),sr=kr.indexOf(F.PARSER_MEDIA_TYPE)===-1?"text/html":F.PARSER_MEDIA_TYPE,Ut=sr==="application/xhtml+xml"?D2:np,le=Cl(F,"ALLOWED_TAGS",se,{transform:Ut}),be=Cl(F,"ALLOWED_ATTR",Se,{transform:Ut}),cn=Cl(F,"ALLOWED_NAMESPACES",rn,{transform:D2}),Kr=Cl(F,"ADD_URI_SAFE_ATTR",rr,{transform:Ut,base:rr}),pr=Cl(F,"ADD_DATA_URI_TAGS",Eo,{transform:Ut,base:Eo}),vn=Cl(F,"FORBID_CONTENTS",is,{transform:Ut}),kt=Cl(F,"FORBID_TAGS",hs({}),{transform:Ut}),tn=Cl(F,"FORBID_ATTR",hs({}),{transform:Ut}),nr=!!Ur(F,"USE_PROFILES")&&(F.USE_PROFILES&&typeof F.USE_PROFILES=="object"?hs(F.USE_PROFILES):F.USE_PROFILES),xt=F.ALLOW_ARIA_ATTR!==!1,Dt=F.ALLOW_DATA_ATTR!==!1,un=F.ALLOW_UNKNOWN_PROTOCOLS||!1,Kt=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Le=F.SAFE_FOR_TEMPLATES||!1,Qe=F.SAFE_FOR_XML!==!1,Ae=F.WHOLE_DOCUMENT||!1,pt=F.RETURN_DOM||!1,tr=F.RETURN_DOM_FRAGMENT||!1,Mi=F.RETURN_TRUSTED_TYPE||!1,ft=F.FORCE_BODY||!1,Pn=F.SANITIZE_DOM!==!1,lr=F.SANITIZE_NAMED_PROPS||!1,xs=F.KEEP_CONTENT!==!1,ss=F.IN_PLACE||!1,we=(function(ge){try{return Vr(ge,""),!0}catch{return!1}})(F.ALLOWED_URI_REGEXP)?F.ALLOWED_URI_REGEXP:V3,Ss=typeof F.NAMESPACE=="string"?F.NAMESPACE:cr,Tn=Ur(F,"MATHML_TEXT_INTEGRATION_POINTS")&&F.MATHML_TEXT_INTEGRATION_POINTS&&typeof F.MATHML_TEXT_INTEGRATION_POINTS=="object"?hs(F.MATHML_TEXT_INTEGRATION_POINTS):Bt({},yn),$n=Ur(F,"HTML_INTEGRATION_POINTS")&&F.HTML_INTEGRATION_POINTS&&typeof F.HTML_INTEGRATION_POINTS=="object"?hs(F.HTML_INTEGRATION_POINTS):Bt({},qt);const pe=Ur(F,"CUSTOM_ELEMENT_HANDLING")&&F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING=="object"?hs(F.CUSTOM_ELEMENT_HANDLING):Od(null);if($e=Od(null),Ur(pe,"tagNameCheck")&&il(pe.tagNameCheck)&&($e.tagNameCheck=pe.tagNameCheck),Ur(pe,"attributeNameCheck")&&il(pe.attributeNameCheck)&&($e.attributeNameCheck=pe.attributeNameCheck),Ur(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),rs($e),Le&&(Dt=!1),tr&&(pt=!0),nr&&(le=Bt({},F3),be=Od(null),nr.html===!0&&(Bt(le,$3),Bt(be,j3)),nr.svg===!0&&(Bt(le,$2),Bt(be,z2),Bt(be,sg)),nr.svgFilters===!0&&(Bt(le,F2),Bt(be,z2),Bt(be,sg)),nr.mathMl===!0&&(Bt(le,j2),Bt(be,z3),Bt(be,sg))),nn.tagCheck=null,nn.attributeCheck=null,Ur(F,"ADD_TAGS")&&(typeof F.ADD_TAGS=="function"?nn.tagCheck=F.ADD_TAGS:Ml(F.ADD_TAGS)&&(le===se&&(le=hs(le)),Bt(le,F.ADD_TAGS,Ut))),Ur(F,"ADD_ATTR")&&(typeof F.ADD_ATTR=="function"?nn.attributeCheck=F.ADD_ATTR:Ml(F.ADD_ATTR)&&(be===Se&&(be=hs(be)),Bt(be,F.ADD_ATTR,Ut))),Ur(F,"ADD_URI_SAFE_ATTR")&&Ml(F.ADD_URI_SAFE_ATTR)&&Bt(Kr,F.ADD_URI_SAFE_ATTR,Ut),Ur(F,"FORBID_CONTENTS")&&Ml(F.FORBID_CONTENTS)&&(vn===is&&(vn=hs(vn)),Bt(vn,F.FORBID_CONTENTS,Ut)),Ur(F,"ADD_FORBID_CONTENTS")&&Ml(F.ADD_FORBID_CONTENTS)&&(vn===is&&(vn=hs(vn)),Bt(vn,F.ADD_FORBID_CONTENTS,Ut)),xs&&(le["#text"]=!0),Ae&&Bt(le,["html","head","body"]),le.table&&(Bt(le,["tbody"]),delete kt.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw Zc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Zc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ge=O;O=F.TRUSTED_TYPES_POLICY;try{A=$("")}catch(Ee){throw O=ge,Ee}}else F.TRUSTED_TYPES_POLICY===null?(O=void 0,A=""):(O===void 0&&(M||(I=(function(ge,Ee){if(typeof ge!="object"||typeof ge.createPolicy!="function")return null;let Ze=null;const yt="data-tt-policy-suffix";Ee&&Ee.hasAttribute(yt)&&(Ze=Ee.getAttribute(yt));const mt="dompurify"+(Ze?"#"+Ze:"");try{return ge.createPolicy(mt,{createHTML:jt=>jt,createScriptURL:jt=>jt})}catch{return console.warn("TrustedTypes policy "+mt+" could not be created."),null}})(f,i),M=!0),O=I),O&&typeof A=="string"&&(A=$("")));es&&es(F),Ni=F},Dr=Bt({},[...$2,...F2,...SW]),Li=Bt({},[...j2,...kW]),Ds=function(F){Cd(n.removed,{element:F});try{b(F).removeChild(F)}catch{if(v(F),!b(F))throw Zc("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ro=function(F){ci(F);const pe=_(F);if(pe){const Ee=[];Ed(pe,Ze=>{Cd(Ee,Ze)}),Ed(Ee,Ze=>{try{v(Ze)}catch{}})}const ge=k(F);if(ge)for(let Ee=ge.length-1;Ee>=0;--Ee){const Ze=ge[Ee],yt=Ze&&Ze.name;if(typeof yt=="string")try{F.removeAttribute(yt)}catch{}}},$s=function(F,pe){try{Cd(n.removed,{attribute:pe.getAttributeNode(F),from:pe})}catch{Cd(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(F),F==="is")if(pt||tr)try{Ds(pe)}catch{}else try{pe.setAttribute(F,"")}catch{}},ol=function(F){const pe=k(F);if(pe)for(let ge=pe.length-1;ge>=0;--ge){const Ee=pe[ge],Ze=Ee&&Ee.name;if(typeof Ze=="string"&&!be[Ut(Ze)])try{F.removeAttribute(Ze)}catch{}}},ci=function(F){const pe=[F];for(;pe.length>0;){const ge=pe.pop();(C?C(ge):ge.nodeType)===1&&ol(ge);const Ee=_(ge);if(Ee)for(let Ze=Ee.length-1;Ze>=0;--Ze)pe.push(Ee[Ze])}},Cc=function(F){let pe=null,ge=null;if(ft)F="<remove></remove>"+F;else{const yt=O3(F,/^[\r\n\t ]+/);ge=yt&&yt[0]}sr==="application/xhtml+xml"&&Ss===cr&&(F='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+F+"</body></html>");const Ee=O?$(F):F;if(Ss===cr)try{pe=new d().parseFromString(Ee,sr)}catch{}if(!pe||!pe.documentElement){pe=q.createDocument(Ss,"template",null);try{pe.documentElement.innerHTML=st?A:Ee}catch{}}const Ze=pe.body||pe.documentElement;return F&&ge&&Ze.insertBefore(r.createTextNode(ge),Ze.childNodes[0]||null),Ss===cr?K.call(pe,Ae?"html":"body")[0]:Ae?pe.documentElement:Ze},Uu=function(F){const pe=R?R(F):F.ownerDocument;return X.call(pe||F,F,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},al=function(F){return F=Uh(F,Q," "),F=Uh(F,B," "),Uh(F,D," ")},dn=function(F){var pe;F.normalize();const ge=R?R(F):F.ownerDocument,Ee=X.call(ge||F,F,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Ze=Ee.nextNode();for(;Ze;)Ze.data=al(Ze.data),Ze=Ee.nextNode();const yt=(pe=F.querySelectorAll)===null||pe===void 0?void 0:pe.call(F,"template");yt&&Ed(yt,mt=>{ui(mt.content)&&dn(mt.content)})},Po=function(F){const pe=P?P(F):null;return typeof pe=="string"&&Ut(pe)==="form"&&(typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||F.attributes!==k(F)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function"||F.nodeType!==C(F)||F.childNodes!==_(F))},ui=function(F){if(!C||typeof F!="object"||F===null)return!1;try{return C(F)===11}catch{return!1}},To=function(F){if(!C||typeof F!="object"||F===null)return!1;try{return typeof C(F)=="number"}catch{return!1}};function qr(F,pe,ge){F.length!==0&&Ed(F,Ee=>{Ee.call(n,pe,ge,Ni)})}const Pc=function(F,pe,ge,Ee){return F.length===0?pe:pe===ge||pe===Ee?hs(pe):pe},Tc=function(F,pe){if(qr(H.beforeSanitizeElements,F,null),F!==pe&&b(F)===null)return ss&&ci(F),!0;if(Po(F))return Ds(F),!0;const ge=Ut(P?P(F):F.nodeName);if(le=Pc(H.uponSanitizeElement,le,se,ke),qr(H.uponSanitizeElement,F,{tagName:ge,allowedTags:le}),F!==pe&&b(F)===null)return ss&&ci(F),!0;if((function(Ee,Ze){return!!(Qe&&Ee.hasChildNodes()&&!To(Ee.firstElementChild)&&Vr(H3,Ee.textContent)&&Vr(H3,Ee.innerHTML))||!(!Qe||Ee.namespaceURI!==cr||Ze!=="style"||!To(Ee.firstElementChild))||Ee.nodeType===7||!(!Qe||Ee.nodeType!==8||!Vr(U3,Ee.data))})(F,ge))return Ds(F),!0;if(kt[ge]||!(nn.tagCheck instanceof Function&&nn.tagCheck(ge))&&!le[ge]){const Ee=(function(Ze,yt,mt){if(!kt[yt]&&Bu(yt)&&($e.tagNameCheck instanceof RegExp&&Vr($e.tagNameCheck,yt)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(yt)))return!1;if(xs&&!vn[yt]){const jt=b(Ze),Qt=_(Ze);if(Qt&&jt)for(let _t=Qt.length-1;_t>=0;--_t){const Fn=Ze===mt?m(Qt[_t],!0):Qt[_t];jt.insertBefore(Fn,y(Ze))}}return Ds(Ze),!0})(F,ge,pe);return Ee===!1&&qr(H.afterSanitizeElements,F,null),Ee}if((C?C(F):F.nodeType)===1&&!(function(Ee){let Ze=b(Ee);Ze&&Ze.tagName||(Ze={namespaceURI:Ss,tagName:"template"});const yt=np(Ee.tagName),mt=np(Ze.tagName);return!!cn[Ee.namespaceURI]&&(Ee.namespaceURI===li?(function(jt,Qt,_t){return Qt.namespaceURI===cr?jt==="svg":Qt.namespaceURI===Lr?jt==="svg"&&(_t==="annotation-xml"||Tn[_t]):!!Dr[jt]})(yt,Ze,mt):Ee.namespaceURI===Lr?(function(jt,Qt,_t){return Qt.namespaceURI===cr?jt==="math":Qt.namespaceURI===li?jt==="math"&&$n[_t]:!!Li[jt]})(yt,Ze,mt):Ee.namespaceURI===cr?(function(jt,Qt,_t){return!(Qt.namespaceURI===li&&!$n[_t])&&!(Qt.namespaceURI===Lr&&!Tn[_t])&&!Li[jt]&&(os[jt]||!Dr[jt])})(yt,Ze,mt):!(sr!=="application/xhtml+xml"||!cn[Ee.namespaceURI]))})(F)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Vr(NW,F.innerHTML))return Ds(F),!0;if(Le&&F.nodeType===3){const Ee=al(F.textContent);F.textContent!==Ee&&(Cd(n.removed,{element:F.cloneNode()}),F.textContent=Ee)}return qr(H.afterSanitizeElements,F,null),!1},ma=function(F,pe,ge){if(tn[pe]||Qe&&pe==="patchsrc"||Qe&&pe==="for"&&F!=="label"&&F!=="output"||Pn&&(pe==="id"||pe==="name")&&(ge in r||ge in rh))return!1;const Ee=be[pe]||nn.attributeCheck instanceof Function&&nn.attributeCheck(pe,F);if(!(Dt&&Vr(G,pe))){if(!(xt&&Vr(fe,pe))){if(Ee){if(!Kr[pe]){if(!Vr(we,Uh(ge,ue,""))){if((pe!=="src"&&pe!=="xlink:href"&&pe!=="href"||F==="script"||M3(ge,"data:")!==0||!pr[F])&&!(un&&!Vr(ie,Uh(ge,ue,"")))){if(ge)return!1}}}}else if(!(Bu(F)&&($e.tagNameCheck instanceof RegExp&&Vr($e.tagNameCheck,F)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(F))&&($e.attributeNameCheck instanceof RegExp&&Vr($e.attributeNameCheck,pe)||$e.attributeNameCheck instanceof Function&&$e.attributeNameCheck(pe,F))||pe==="is"&&$e.allowCustomizedBuiltInElements&&($e.tagNameCheck instanceof RegExp&&Vr($e.tagNameCheck,ge)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(ge))))return!1}}return!0},as=Bt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Bu=function(F){return!as[np(F)]&&Vr(he,F)},ks=function(F,pe,ge,Ee){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ge)switch(f.getAttributeType(F,pe)){case"TrustedHTML":return $(Ee);case"TrustedScriptURL":return(function(Ze){z(),L++;try{return O.createScriptURL(Ze)}finally{L--}})(Ee)}return Ee},sh=function(F,pe,ge,Ee){try{ge?F.setAttributeNS(ge,pe,Ee):F.setAttribute(pe,Ee),Po(F)?Ds(F):I3(n.removed)}catch{$s(pe,F)}},Zu=function(F){qr(H.beforeSanitizeAttributes,F,null);const pe=F.attributes;if(!pe||Po(F))return;be=Pc(H.uponSanitizeAttribute,be,Se,$t);const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be,forceKeepAttr:void 0};let Ee=pe.length;const Ze=Ut(F.nodeName);for(;Ee--;){const yt=pe[Ee],mt=yt.name,jt=yt.namespaceURI,Qt=yt.value,_t=Ut(mt),Fn=Qt;let it=mt==="value"?Fn:_W(Fn);ge.attrName=_t,ge.attrValue=it,ge.keepAttr=!0,ge.forceKeepAttr=void 0,qr(H.uponSanitizeAttribute,F,ge),it=ge.attrValue,!lr||_t!=="id"&&_t!=="name"||M3(it,no)===0||($s(mt,F),it=no+it),Qe&&Vr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,it)||_t==="attributename"&&O3(it,"href")?$s(mt,F):ge.forceKeepAttr||(!ge.keepAttr||!Kt&&Vr(LW,it)?$s(mt,F):(Le&&(it=al(it)),ma(Ze,_t,it)?(it=ks(Ze,_t,jt,it),it!==Fn&&sh(F,mt,jt,it)):$s(mt,F)))}qr(H.afterSanitizeAttributes,F,null)},Ro=function(F){let pe=null;const ge=Uu(F);for(qr(H.beforeSanitizeShadowDOM,F,null);pe=ge.nextNode();)if(qr(H.uponSanitizeShadowNode,pe,null),Tc(pe,F),Zu(pe),ui(pe.content)&&Ro(pe.content),(C?C(pe):pe.nodeType)===1){const Ee=x(pe);ui(Ee)&&(Ao(Ee),Ro(Ee))}qr(H.afterSanitizeShadowDOM,F,null)},Ao=function(F){const pe=[{node:F,shadow:null}];for(;pe.length>0;){const ge=pe.pop();if(ge.shadow){Ro(ge.shadow);continue}const Ee=ge.node,Ze=(C?C(Ee):Ee.nodeType)===1,yt=_(Ee);if(yt)for(let mt=yt.length-1;mt>=0;--mt)pe.push({node:yt[mt],shadow:null});if(Ze){const mt=P?P(Ee):null;if(typeof mt=="string"&&Ut(mt)==="template"){const jt=Ee.content;ui(jt)&&pe.push({node:jt,shadow:null})}}if(Ze){const mt=x(Ee);ui(mt)&&pe.push({node:null,shadow:mt},{node:mt,shadow:null})}}};return n.sanitize=function(F){let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,Ee=null,Ze=null,yt=null;if(st=!F,st&&(F="<!-->"),typeof F!="string"&&!To(F)&&typeof(F=(function(_t){switch(typeof _t){case"string":return _t;case"number":return wW(_t);case"boolean":return bW(_t);case"bigint":return N3?N3(_t):"0";case"symbol":return L3?L3(_t):"Symbol()";case"undefined":default:return rg(_t);case"function":case"object":{if(_t===null)return rg(_t);const Fn=_t,it=fo(Fn,"toString");if(typeof it=="function"){const $r=it(Fn);return typeof $r=="string"?$r:rg($r)}return rg(_t)}}})(F))!="string")throw Zc("dirty is not a string, aborting");if(!n.isSupported)return F;Ct?(le=ke,be=$t):Co(pe),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(le=hs(le)),H.uponSanitizeAttribute.length>0&&(be=hs(be)),n.removed=[];const mt=ss&&typeof F!="string"&&To(F);if(mt){(function(Fn){if(!Qe)return;const it=[Fn];for(;it.length>0;){const $r=it.pop(),ll=C?C($r):$r.nodeType;if(ll===7||ll===8&&Vr(U3,$r.data)){try{v($r)}catch{}continue}if(ll===1){const Er=$r,ga=Ut(P?P($r):$r.nodeName);try{Er.hasAttribute&&Er.hasAttribute("patchsrc")&&Er.removeAttribute("patchsrc"),Er.hasAttribute&&Er.hasAttribute("for")&&ga!=="label"&&ga!=="output"&&Er.removeAttribute("for")}catch{}}const Io=_($r);if(Io)for(let Er=Io.length-1;Er>=0;--Er)it.push(Io[Er])}})(F);const _t=P?P(F):F.nodeName;if(typeof _t=="string"){const Fn=Ut(_t);if(!le[Fn]||kt[Fn])throw ro(F),Zc("root node is forbidden and cannot be sanitized in-place")}if(Po(F))throw ro(F),Zc("root node is clobbered and cannot be sanitized in-place");try{Ao(F)}catch(Fn){throw ro(F),Fn}}else if(To(F))ge=Cc("<!---->"),Ee=ge.ownerDocument.importNode(F,!0),Ee.nodeType===1&&Ee.nodeName==="BODY"||Ee.nodeName==="HTML"?ge=Ee:ge.appendChild(Ee),Ao(Ee);else{if(!pt&&!Le&&!Ae&&F.indexOf("<")===-1)return O&&Mi?$(F):F;if(ge=Cc(F),!ge)return pt?null:Mi?A:""}ge&&ft&&Ds(ge.firstChild);const jt=mt?F:ge;try{const _t=Uu(jt);for(;Ze=_t.nextNode();)Tc(Ze,jt),Zu(Ze),ui(Ze.content)&&Ro(Ze.content)}catch(_t){throw mt&&(ro(F),Ed(n.removed,Fn=>{Fn.element&&ci(Fn.element)})),_t}if(mt)return Ed(n.removed,_t=>{_t.element&&ci(_t.element)}),Le&&dn(F),F;if(pt){if(Le&&dn(ge),tr)for(yt=j.call(ge.ownerDocument);ge.firstChild;)yt.appendChild(ge.firstChild);else yt=ge;return(be.shadowroot||be.shadowrootmode)&&(yt=ee.call(s,yt,!0)),yt}let Qt=Ae?ge.outerHTML:ge.innerHTML;return Ae&&le["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&Vr(OW,ge.ownerDocument.doctype.name)&&(Qt="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
20
- `+Qt),Le&&(Qt=al(Qt)),O&&Mi?$(Qt):Qt},n.setConfig=function(){Co(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Ct=!0,ke=le,$t=be},n.clearConfig=function(){Ni=null,Ct=!1,ke=null,$t=null,O=I,A=""},n.isValidAttribute=function(F,pe,ge){Ni||Co({});const Ee=Ut(F),Ze=Ut(pe);return ma(Ee,Ze,ge)},n.addHook=function(F,pe){typeof pe=="function"&&Ur(H,F)&&Cd(H[F],pe)},n.removeHook=function(F,pe){if(Ur(H,F)){if(pe!==void 0){const ge=vW(H[F],pe);return ge===-1?void 0:yW(H[F],ge,1)[0]}return I3(H[F])}},n.removeHooks=function(F){Ur(H,F)&&(H[F]=[])},n.removeAllHooks=function(){H={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})();const B3="Refusing to render web experiment since the viewer is a likely bot",Z3={ADD_ATTR:(t,e)=>t==="target"&&e==="a"||t==="form"&&/^(button|fieldset|input|output|select|textarea)$/.test(e),ADD_URI_SAFE_ATTR:["form"]};let W3;const FW={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Lv(e,t),not_regex:(t,e)=>!Lv(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Ui=An("[Conversations]"),Wc="Conversations not available yet.";function K3(t,e){var n,r,s,i,o,l,c;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,h=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,m=de(h)?Math.max(f,2048):Math.max(f,h),v=V(V({},(function(){let y="",_="";try{var b;const x="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,k=x==null||(b=x.navigator)===null||b===void 0?void 0:b.userAgent;k&&([y,_]=O4(k))}catch{}return(function(x,k){const C=(function(P){if(P)return{}.hasOwnProperty.call(wP,P)?wP[P]:P})(x);return V(V({},C?{"os.name":C}:{}),k?{"os.version":k}:{})})(y,_)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(c=v==null?void 0:v["deployment.environment"])!==null&&c!==void 0?c:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const jW=["debug","log","warn","error","info"],zW=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},q3="console",P5="__posthogHandledLogsRequestError",V2=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[P5]=!0,n},G3=t=>!!t&&typeof t=="object"&&t[P5]===!0;var VW=class{get Qv(){return V(V({},this.R),{},{error:(...t)=>{t.some(G3)||this.R.error(...t)}})}constructor(t,e){var n;this.Na=t,this.Jv=e,this.name="logs",this.Zv=!1,this.Kv=!1,this.Yv=!1,this.R=An("[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=t.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&&(Lt(this.uv,"online",this.af),this.rf=!0)}}vf(t,e,n,r){this.df();const s=K3(this.Na.get(),n);return[new rB(this.ff(t,e),s,this.Qv,()=>this.Jv(),i=>i(),void 0,r),s]}pf(){const t=this.Na.get();var e;return this.lf&&this.gf===t||((e=this.lf)===null||e===void 0||e.reset(),this.gf=t,[this.lf,this.mf]=this.vf(()=>this.cc,n=>{this.cc=n})),this.lf}yf(){const t=this.Na.get();var e;return this.uf&&this.bf===t||((e=this.uf)===null||e===void 0||e.reset(),this.bf=t,[this.uf,this._f]=this.vf(()=>this.Xv,n=>{this.Xv=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},q3)),this.uf}setup(t){if(!this.Ti&&!this.tf)return this.tf=!0,this.Fa=t,this.R=t.logger.createLogger("[logs]"),dk(t.kv.initialize(),()=>{this.Ti||this.hv(t)})}hv(t){var e;this.df(),!((e=this.Na.get())===null||e===void 0)&&e.captureConsoleLogs&&(this.Zv=!0),(this.Zv||this.Na.remoteConfigWillArrive&&t.kv.get(this.Na.captureHintKey))&&this.wf();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Ti?r.dispose():(this.Za=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r,s,i,o;this.Ti||(this.Ti=!0,this.kf(),(t=this.Za)===null||t===void 0||t.dispose(),this.Za=void 0,this.Fa=void 0,this.Yv=!1,(e=this.uv)===null||e===void 0||e.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(t){var e,n;if(this.Ti)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.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 t,e,n,r;this.kf(),(t=this.lf)===null||t===void 0||t.clearQueue(),this.cc=[],(e=this.lf)===null||e===void 0||e.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(t){!this.Ti&&this.Fa&&this.pf().captureLog(t)}captureConsoleLog(t){!this.Ti&&this.Fa&&this.yf().captureLog(t)}captureBufferedConsoleLog(t,e,n){!this.Ti&&this.Fa&&this.yf().captureLog(t,{context:e,occurredAtMs:n})}Rd(){var t;this.kf(),(t=this.uf)===null||t===void 0||t.clearQueue(),this.Xv=[]}xf(){this.Zv||this.kf()}wf(){var t;if(this.nf||!(!((t=this.uv)===null||t===void 0)&&t.console))return;const e=K3(this.Na.get()).maxBufferSize;let n=!0;this.if.push(()=>{n=!1});for(const r of jW){let s;try{s=zW(this.uv.console[r])}catch{continue}s&&this.if.push(Sf(this.uv.console,r,i=>{const o=(...l)=>{try{n&&this.$f(r,l,e)}catch{}return i.apply(this.uv.console,l)};return o.__rrweb_original__=s,o}))}this.nf=!0,this.Cf=setTimeout(()=>{this.kf()},3e4)}$f(t,e,n){var r;if(this.nf&&!this.sf&&e.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:t,args:e,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 t of this.if)t();this.if=[]}}Tf(){const t=this.ef;return this.kf(),t}get logger(){return this.If||(this.If={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.If}flushLogs(t){this.Fa&&(t?this.Mf(t):(this.lf&&this.lf.flush().catch(e=>this.Ef(e)),this.uf&&this.uf.flush().catch(e=>this.Ef(e))))}flush(){var t=this;return pn(function*(){var e,n;const r=(e=t.lf)===null||e===void 0?void 0:e.flush().catch(i=>t.Ef(i)),s=(n=t.uf)===null||n===void 0?void 0:n.flush().catch(i=>t.Ef(i));yield r,yield s})()}Ef(t){G3(t)||this.R.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Ti||!this.Zv||this.Kv||this.Yv)return;const t=this.hf();if(t){this.Yv=!0;try{t((e,n)=>{if(this.Yv=!1,!this.Ti&&this.Zv)if(e||!n)this.R.error("Could not load logs script",e),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(e){throw this.Yv=!1,e}}else this.kf()}ff(t,e){const n=this.Fa;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===Ho.LogsQueue?t():void 0,setPersistedProperty(r,s){r===Ho.LogsQueue&&e(s??[])},qs:r=>this.qs(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}qs(t){return new Promise(e=>{if(zM(this.Jd,3))return void e({kind:"fatal",error:V2(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=o=>{n||(n=!0,clearTimeout(s),e(o))},s=setTimeout(()=>{this.R.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:V2(void 0,"logs request timed out")})},9e4),i=this.cf;this.Fa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Fa.projectToken},body:t,compression:"best-available",timeoutMs:6e4}).then(o=>{var l;const c=o.statusCode;this.Af(c,i),c>=200&&300>c?r({kind:"ok"}):c===413?r({kind:"too-large"}):c!==0&&c!==408&&c!==429&&500>c?r({kind:"fatal",error:new Error(`logs request failed with status ${c}`)}):c===0?(o.error||this.R.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:V2(o.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${c}`)})},o=>{r({kind:"retry-later",error:o})})})}Af(t,e){(t!==0||e)&&(this.Jd=VM(t,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(t){this.cc.length>0&&this.Rf(t,this.cc,this.mf,this.Fa.library.name,e=>{this.cc=e}),this.Xv.length>0&&this.Rf(t,this.Xv,this._f,q3,e=>{this.Xv=e})}Rf(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=tM(i,eM(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:t,timeoutMs:6e4}).catch(l=>this.Ef(l))}};const Dv=An("[NetworkMetrics]"),HW={"http:":80,"https:":443},UW=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),T5=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=oa(r))===null||n===void 0?void 0:n.href)||r}},jb=(t,e,n,r,s,i,o=!1)=>{try{var l,c;const d=s();if(!d)return;const f=n||void 0,h=Up()-r,m=oa(e.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const v={url:(m==null?void 0:m.href)||e.url,method:e.method},y=Vn(d.name)?d.name(v):dt(d.name)?d.name:"http.client.request.duration";if(!y)return;const _=o&&!f?void 0:((x,k)=>x?400>x?void 0:String(x):(k==null?void 0:k.name)||"_OTHER")(f,i),b=V(V(V(V(V({},(x=>{const k=UW.has(x)?x:"_OTHER";return V({"http.request.method":k},k==="_OTHER"&&x!==k?{"http.request.method_original":x}:{})})(v.method)),m?(x=>{return{"server.address":x.hostname.startsWith("[")&&x.hostname.endsWith("]")?x.hostname.slice(1,-1):x.hostname,"server.port":Number(x.port)||HW[x.protocol],"url.scheme":x.protocol.slice(0,-1),"url.template":(k=x.pathname,k.split("/").map(C=>(P=>/^\d+$/.test(P)||P.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(P))(C)?":id":C).join("/"))};var k})(m):{}),f?{"http.response.status_code":f}:{}),_?{"error.type":_}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:h}));(c=t.metrics)===null||c===void 0||c.histogram(y,h,{unit:"ms",attributes:b})}catch(d){Dv.error("Failed to record network metric",d)}},R5=()=>{},BW=(t,e)=>Vn(ce==null?void 0:ce.fetch)?Sf(ce,"fetch",n=>function(...r){const s=Up(),i=n.apply(this,r);if(!e())return i;try{var o,l,c;const[d,f]=r,h=T5((o=(l=f==null?void 0:f.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(c=d==null?void 0:d.url)!==null&&c!==void 0?c:d);return i.then(m=>(jb(t,h,m==null?void 0:m.status,s,e,void 0,!0),m),m=>{throw jb(t,h,void 0,s,e,m),m})}catch(d){return Dv.error("Failed to observe fetch",d),i}}):R5,ZW=(t,e)=>{var n;const r=ce==null||(n=ce.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return R5;const s=new WeakMap,i=Sf(r,"open",l=>function(...c){try{n5.has(this)||s.set(this,T5(c[0],c[1]))}catch(d){Dv.error("Failed to observe XHR open",d)}return l.apply(this,c)}),o=Sf(r,"send",l=>function(...c){let d;try{const f=s.get(this);if(f&&e()){const h=Up();d=()=>{this.removeEventListener("loadend",d),jb(t,f,this.status,h,e)},Lt(this,"loadend",d)}}catch(f){Dv.error("Failed to observe XHR send",f)}try{return l.apply(this,c)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},Y3=new WeakMap,WW=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),KW={maxStringLength:2048,truncationSuffix:"..."},qW={maxStringLength:2048,truncationSuffix:"..."};function X3(t){if(t)return t===!0?{intent:!0,model:!0}:{intent:t.intent!==!1,model:t.model!==!1}}function H2(t,e){return{}.hasOwnProperty.call(t,e)}function U2(t,e){const n=Object.create(t);return e&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:e}),n}function Q3(t,e,n=!1){if(!dt(t))return;const r=t.trim();return r?(n?G4(r,KW):r).slice(0,e):void 0}function J3(t){try{return ct(t)&&t.isError===!0}catch{return!1}}function A5(t){return G4(t||"Unknown error",qW).slice(0,2048)}function GW(t,e){try{return A5(e?(function(n){try{return!ct(n)||!He(n.content)?void 0:n.content.filter(r=>ct(r)&&r.type==="text"&&dt(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(t):ct(t)&&dt(t.message)?t.message:dt(t)?t:String(t))}catch{return"Unknown error"}}function YW(t,e,n){return e.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:t.buildProperties(e.error,{handled:!0}).$exception_list.map(r=>V(V({},r),{},{value:A5(r.value)}))}function XW(t,e){if(e)return"Error";try{if(!ct(t))return"Error";let n=dt(t.name)?t.name.trim():"";const r=t.constructor;return n&&n!=="Error"||!Vn(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function QW(t,e){return{message:GW(t,e),type:XW(t,e)}}Sp.__defaultExtensionClasses=V({},((...t)=>_n({},...t))({featureFlags:ng},{sessionRecording:class{get Fr(){return this._instance.config}get Pc(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Pf)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Of==="awaiting_config"||this.Of==="missing_config"?this.Of:(t=(e=this.Pf)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Of}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Of=O2,this.Ff=void 0,this.Df=!1,this.Ye=(()=>{var e,n;if(!(Me!=null&&Me.visibilityState)||Me.visibilityState==="visible")return!0;const r=ce==null||(e=ce.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.an=()=>{var e,n;(Me==null?void 0:Me.visibilityState)==="visible"&&(this.Ye=!0,(e=this.Pf)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw Ca.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"');Me!=null&&Me.addEventListener&&Lt(Me,"visibilitychange",this.an)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.Df=!0,Me==null||(e=Me.removeEventListener)===null||e===void 0||e.call(Me,"visibilitychange",this.an),t?this.Lf(!0):this.stopRecording()}get Nf(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Fr.disable_session_recording,r=this.Fr.disable_session_recording||this._instance.consent.isOptedOut();return ce&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.Df||this.Nf&&(!((e=this.Pf)===null||e===void 0)&&e.isStarted))return;const n=!de(Object.assign)&&!de(Array.from);this.Nf&&n?(this.jf(t),Ca.info("starting")):(this.Of=O2,this.stopRecording())}jf(t){var e,n;if(this.Nf)if(this.Of!=="awaiting_config"&&this.Of!=="missing_config"&&(this.Of=v3),(et==null||(e=et.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=et.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.qf(t);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}),Ca.error("could not load recorder",o)):void this.qf(t);this.Of="disabled"})}}stopRecording(){var t,e;(t=this.Ff)===null||t===void 0||t.call(this),this.Ff=void 0,(e=this.Pf)===null||e===void 0||e.stop()}Lf(t=!1){var e,n;(e=this.Ff)===null||e===void 0||e.call(this),this.Ff=void 0,(n=this.Pf)===null||n===void 0||n.discard({discardProducerEvents:t})}zf(){var t,e;(t=this.Pc)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Pc)===null||e===void 0||e.unregister("$replay_sample_rate")}Hf(t,e){if(ot(t))return null;const n=Yn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(Ca.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}Uf(t){if(this.Pc){var e,n;const r=this.Pc,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.Hf((i=this.Fr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.Hf(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??c;ot(d)&&this.zf();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[gp]:V(V({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:V({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:de(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.Ff)===null||e===void 0||e.call(this),this.Ff=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.Uf(e),void this.Lf()):(this.Uf(e),void this.startIfEnabledOrStop()):(this.Of==="awaiting_config"&&(this.Of="missing_config",this._instance.register_for_session({[tk]:!0}),Ca.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Pf)===null||n===void 0)&&n.log?this.Pf.log(t,e):Ca.warn("log called before recorder was ready")}get Bf(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(gp);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}Wf(){const t=this._instance.get_property(gp);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return Ca.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!ot(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}qf(t){var e,n,r;if(!this.Df&&this.Nf&&this._instance.sessionManager){if(!(!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return Ca.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[ek]:!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",Ca.info("persisted remote config is stale, requesting fresh config before starting"),void new YM(this._instance).load());this.Of=v3,(n=(r=this.Pf).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Ye),this.Pf.start(t)}else this.Of=O2}onRRwebEmit(t){var e,n;(e=this.Pf)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Pf||(e=this.Pc)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Pf)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Pf||(e=this.Pc)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Pf)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Pf||(n=this.Pc)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Pf)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of XZ){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);de(s)||(e[r]=s)}return V(V({},e),((t=this.Pf)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Pf)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Pf)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},{autocapture:class extends NZ{constructor(t){super(new KZ(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.Vf=!1,this._instance=t,this.Gf=this.Qf()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.Jf();return!!(t.path||t.search||this.Zf(t))}startIfEnabled(){this.isEnabled&&(ve.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,ve.info("History API monitoring stopped")}monitorHistoryChanges(){ce&&ce.history&&(this.Xf("pushState"),this.Xf("replaceState"),this.tp(),this.Zf()&&this.ep())}Xf(t){var e;if(!ce||!((e=ce.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;Sf(ce.history,t,r=>function(s,i,o){var l;n.np(o)&&n.sp(),r.call(this,s,i,o),n.rp(t,!n.Vf&&(ce==null||(l=ce.event)===null||l===void 0?void 0:l.type)!=="popstate")})}Qf(){const t=ce==null?void 0:ce.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Jf(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:ct(t)?t:{}}Zf(t=this.Jf()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}op(t){const e=this.Jf(),n=this.Gf;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Zf(e)&&t.hash!==n.hash))}rp(t,e=!1){try{e||this.sp();const n=this.Qf();if(!n)return;if(this.op(n)){const r=()=>this._instance.capture(nk,{navigation_type:t});e?(this.ap=r,Promise.resolve().then(()=>this.sp())):r()}this.Gf=n}catch(n){ve.error(`Error capturing ${t} pageview`,n)}}np(t){var e,n;return!(ot(t)||!ce)&&((e=oa(String(t)))===null||e===void 0?void 0:e.href)!==((n=ce.location)===null||n===void 0?void 0:n.href)}sp(){const t=this.ap;if(t){this.ap=void 0,this.Vf=!0;try{t()}catch(e){ve.error("Error capturing deferred pageview",e)}finally{this.Vf=!1}this.Gf=this.Qf()}}tp(){if(this.Kf)return;const t=()=>{this.rp("popstate")};Lt(ce,"popstate",t),this.Kf=()=>{ce&&ce.removeEventListener("popstate",t)}}ep(){if(this.Yf)return;const t=()=>{this.rp("hashchange")};Lt(ce,"hashchange",t),this.Yf=()=>{ce&&ce.removeEventListener("hashchange",t)}}},heatmaps:class{get Fr(){return this.instance.config}constructor(t){var e;this.lp=!1,this._l=!1,this.up=null,this.instance=t,this.lp=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[wb]),this.rageclicks=new w5(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return ct(this.Fr.capture_heatmaps)&&this.Fr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Fr.capture_heatmaps.flush_interval_milliseconds),t}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;QZ.info("starting..."),this.cp(),this.an()}else{var t;clearInterval((t=this.up)!==null&&t!==void 0?t:void 0),this.hp(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[wb]:n}),this.lp=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}dp(t){M2(t.originalEvent)&&this.Pr(t.originalEvent,"deadclick")}an(){this.up&&clearInterval(this.up),this.up=(Me==null?void 0:Me.visibilityState)==="visible"?setInterval(this.bc.bind(this),this.flushIntervalMilliseconds):null}cp(){ce&&Me&&(this.vp=this.bc.bind(this),Lt(ce,Rv,this.vp),this.fp=t=>this.Pr(t||(ce==null?void 0:ce.event)),Lt(Me,"click",this.fp,{capture:!0}),this.pp=t=>this.gp(t||(ce==null?void 0:ce.event)),Lt(Me,"mousemove",this.pp,{capture:!0}),this.mp=new BP(this.instance,GB,this.dp.bind(this)),this.mp.startIfEnabledOrStop(),this.yp=this.an.bind(this),Lt(Me,qd,this.yp),this._l=!0)}hp(){var t;ce&&Me&&(this.vp&&ce.removeEventListener(Rv,this.vp),this.fp&&Me.removeEventListener("click",this.fp,{capture:!0}),this.pp&&Me.removeEventListener("mousemove",this.pp,{capture:!0}),this.yp&&Me.removeEventListener(qd,this.yp),clearTimeout(this.bp),(t=this.mp)===null||t===void 0||t.stop(),this._l=!1)}_p(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,c){let d=o;for(;d&&Xi(d)&&!hr(d,"body");){if(d===c)return!1;let v;try{var f,h,m;v=(f=(h=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&h!==void 0?h:ce)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(We(l,v))return!0;d=OM(d)}return!1})(_p(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Pr(t,e="click"){var n;if(MP(t.target)||!M2(t))return;const r=this._p(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&NM(_p(t),this.instance.config.rageclick)&&this.Ks(V(V({},r),{},{type:"rageclick"})),this.Ks(r)}gp(t){!MP(t.target)&&M2(t)&&(clearTimeout(this.bp),this.bp=setTimeout(()=>{this.Ks(this._p(t,"mousemove"))},500))}Ks(t){if(!ce)return;const e=this.Fr.disable_capture_url_hashes?Xl(ce.location.href):ce.location.href,n=this.Fr.custom_personal_data_properties,r=this.Fr.mask_personal_data_properties?[...bf,...n||[]]:[],s=Vp(e,r,Hp);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}bc(){this.Rt&&!Ks(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:BP,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,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",V({$current_url:this.Rt.url},this.Rt.metrics.reduce((r,s)=>V(V({},r),{},{[`$web_vitals_${s.name}_event`]:V({},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 Uc.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.xp(s);if(de(i))return;const o=Yn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.$p&&n.value>=this.$p)return void Uc.error("Ignoring metric with value >= "+this.$p,n);this.Rt.navigationKey!==o&&(this.wp(),this.kp=setTimeout(this.wp,this.flushToCaptureTimeoutMs)),de(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=de(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),c=V(V(V({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete c.entries,ct(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of YZ){const h=f==="url"&&typeof n.attribution[f]=="string"?this.xp(n.attribution[f]):n.attribution[f];de(h)||(d[f]=h)}c.attribution=d}else delete c.attribution;de(l)||(c.$session_id=l.sessionId,c.$window_id=l.windowId),this.Rt.metrics.push(c),this.Rt.metrics.length===this.allowedMetrics.length&&this.wp()},this.Cp=()=>{if(this._l)return;let n,r,s,i,o=!1;const l=et.__PosthogExtensions__,c=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(c==null?void 0:c[this.Tp])||(this.Tp==="web-vitals"&&de(c)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!de(d)){const v=d.withoutAttribution,y=this.attributionMetrics;o=!de(v),n=y.indexOf("LCP")>-1?d.onLCP:(v==null?void 0:v.onLCP)||d.onLCP,r=y.indexOf("CLS")>-1?d.onCLS:(v==null?void 0:v.onCLS)||d.onCLS,s=y.indexOf("FCP")>-1?d.onFCP:(v==null?void 0:v.onFCP)||d.onFCP,i=y.indexOf("INP")>-1?d.onINP:(v==null?void 0:v.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Uc.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},h=o&&this.attributionMetrics.indexOf("INP")>-1?V(V({},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),h);const m=ce==null?void 0:ce.document;Lt(m,qd,()=>{(m==null?void 0:m.visibilityState)==="hidden"&&this.wp(!0)}),Lt(ce,"pagehide",()=>this.wp(!0)),this._l=!0},this.lp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[Sb]),this.startIfEnabled()}get Ip(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=ct(this.Ip)?(t=this.Ip)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return ot(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||g3:n}get flushToCaptureTimeoutMs(){return(ct(this.Ip)?this.Ip.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=ct(this.Ip)?this.Ip.web_vitals_attribution:void 0;return Ms(t)?t?g3:[]:He(t)?t:GZ}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=ct(this.Ip)?this.Ip.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get $p(){const t=ct(this.Ip)&&Yn(this.Ip.__web_vitals_max_value)?this.Ip.__web_vitals_max_value:m3;return t>0&&6e4>=t?m3:t}get isEnabled(){const t=fn==null?void 0:fn.protocol;if(t!=="http:"&&t!=="https:")return Uc.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=ct(this.Ip)?this.Ip.web_vitals:Ms(this.Ip)?this.Ip:void 0;return Ms(e)?e:this.lp}startIfEnabled(){this.isEnabled&&!this._l&&(Uc.info("enabled, starting..."),this.Bl(this.Cp))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=ct(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ct(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Sb]:n}),this._instance.persistence.register({[cM]: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(t){var e;const n=et.__PosthogExtensions__,r=this.Tp,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&de(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Uc.error("failed to load script",i):t()})}xp(t){const e=t||(ce==null?void 0:ce.location.href);if(!e)return void Uc.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?Xl(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...bf,...r||[]]:[];return Vp(n,s,Hp)}}},{exceptionObserver:class{constructor(t){var e;this.Cp=()=>{var n;if(!ce||!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){Hh.error("failed to start",o),this.Rp()}},this._instance=t,this.Pp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[bb]),this.kt=new jH(V(V({},(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:Hh})),this.Fr=this.Op(),this.startIfEnabledOrStop()}Op(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ct(t)?e=V(V({},e),t):(de(t)?this.Pp:t)&&(e=V(V({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Fr.capture_console_errors||this.Fr.capture_unhandled_errors||this.Fr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hh.info("enabled"),this.Rp(),this.Bl(this.Cp)):this.Rp()}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(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 Hh.error("failed to load script",s);t()})}Rp(){var t,e,n;(t=this.Mp)===null||t===void 0||t.call(this),this.Mp=void 0,(e=this.Ep)===null||e===void 0||e.call(this),this.Ep=void 0,(n=this.Ap)===null||n===void 0||n.call(this),this.Ap=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Pp=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[bb]:this.Pp}),this.Fr=this.Op(),this.startIfEnabledOrStop())}onConfigChange(){this.Fr=this.Op()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.kt.consumeRateLimit(s))return void Hh.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.Fp=[],this.Dp=new YH([new dU,new wU,new hU,new fU,new yU,new vU,new mU,new _U],(function(r,...s){return(i,o=0)=>{const l=[],c=i.split(`
21
- `),d=Math.min(c.length,o+1e3),f=[];for(let v=o;d>v;v++){const y=c[v];if(y.length>1024)continue;const _=fP.test(y)?y.replace(fP,"$1"):y;if(!_.match(/\S*Error: /)){for(const b of s){const x=b(_,r);if(x){l.push(x);const k=aU(l);if(k){for(let C=f.length-1;C>=0;C--){const P=f[C];if(k.start>=P.start+P.length)break;f.pop()}f.push(k)}break}}if(cU(l,f)>=50)break}}const h=[...f].sort((v,y)=>y.start-v.start),m=h[h.length-1];if(m){const v=z4(l,m);l.splice(m.start-v,v);for(const y of h)y.start-=v}for(const v of h)lU(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const y=v.map(b=>`${b.function}|${b.filename}|${b.lineno}|${b.colno}|${b.module}`);let _=0;for(let b=1;y.length>b;b++)uU(y,b,_)&&(_=b);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const y=Array.from(v);return y.reverse(),y.slice(0,50).map(_=>{return V(V({},_),{},{filename:_.filename||(b=y,b[b.length-1]||{}).filename,function:_.function||"?"});var b})})(l)}})("web:javascript",rU,oU)),this._instance=t,this.Fp=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.Lp=Sv(this.Np()),this.jp=new xU(this.Lp)}onConfigChange(){this.Lp=Sv(this.Np()),this.jp.setConfig(this.Lp)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.Fp=i,this._instance.persistence&&this._instance.persistence.register({[aM]:this.Fp,[xb]:o})}get qp(){var t;const e=!!this._instance.get_property(xb),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Dp.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Lp.enabled)try{if(!dt(t)||t.trim().length===0)return void uo.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>bU.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.Bp(e));r.length>0&&uo.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.jp.add(V({[bv]:t,[xv]:new Date().toISOString()},n))}catch(n){uo.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.zp(e)){if(this.Hp(e))return this.Up("Exception dropped: matched a suppression rule"),void uo.info("Skipping exception capture because a suppression rule matched");if(!this.qp&&this.Wp(e))return this.Up("Exception dropped: thrown by a browser extension"),void uo.info("Skipping exception capture because it was thrown by an extension");if(!this.qp&&this.Vp(e))return this.Up("Exception dropped: thrown by an injected browser script"),void uo.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Gp(e))return this.Up("Exception dropped: thrown by the PostHog SDK"),void uo.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Lp.enabled&&ot(t.$exception_steps)?this.Qp(t):t,r=(function(){if("u">typeof process){var s;const o=(s=RH.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 T3(s)||uo.error("Failed to capture exception event. Dropping this exception.",s),void this.jp.clear()}}catch(e){return void(T3(e)||uo.error("Failed to process exception event. Ignoring this exception.",e))}}Qp(t){try{const e=this.jp.getAttachable();return e.length===0?t:V(V({},t),{},{$exception_steps:e})}catch(e){return uo.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Up(t){this.Lp.enabled&&this.jp.add({[bv]:t,[xv]:new Date().toISOString()})}Bp(t){return ct(t)?V({},t):{}}Np(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Hp(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(dt(r)&&r.length>0&&n.$exception_types.push(r),dt(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=v5[s.operator],o=e[s.key];if(!i||!o)return!1;const l=He(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return uo.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Wp(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&dW.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(Db))||t.some(({type:r,value:s})=>r==="NoResponse"||dt(s)&&uW.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(Db))))}Vp(t){return t.some(({value:e})=>dt(e)&&fW.some(n=>e.includes(n)))}Gp(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}zp(t){return!ot(t)&&He(t)}}},{productTours:class{get Pc(){return this._instance.persistence}constructor(t){this.Jp=null,this.Zp=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this.Pc&&this.Pc.register({[QS]:!!e.productTours}),!N2(this._instance))return!this.Jp&&ot((n=this.Pc)===null||n===void 0?void 0:n.props.ph_product_tours)||tg.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&&N2(this._instance)&&this.Bl(()=>this.Kp())}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?tg.error("Could not load product tours script",s):t()})}Kp(){var t;!this.Jp&&(!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.Jp=et.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(He(this.Zp)&&!e)return void t(this.Zp,{isLoaded:!0});const n=this.Pc;if(n){const r=n.props[kb];if(He(r)&&!e)return this.Zp=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:r=>{if(!N2(this._instance))return void t([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||tg.warn(o):tg.error(o),void t([],{isLoaded:!1,error:o})}const i=He(r.json.product_tours)?r.json.product_tours:[];this.Zp=i,n&&n.register({[kb]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){ot(this.Jp)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Jp.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Jp)===null||e===void 0||e.showTourById(t)}previewTour(t){this.Jp?this.Jp.previewTour(t):this.Bl(()=>{var e;this.Kp(),(e=this.Jp)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Jp)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Jp)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.Jp)===null||t===void 0||t.previousStep()}clearCache(){var t;this.Zp=null,(t=this.Pc)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.Jp)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.Jp)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Jp)===null||e===void 0||e.cancelPendingTour(t)}},featureFlags:ng},{siteApps:class{constructor(t){this._instance=t,this.Yp=0,this.Xp=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}tg(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Xp.push(n),this.Xp.length>1e3&&(this.Xp=this.Xp.slice(10))}get siteAppLoaders(){var t;return(t=et._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.tg.bind(this));this.eg=()=>{t(),this.Xp=[],this.eg=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const c={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,y]of Object.entries(f))c[v]={id:d[v],type:v,properties:y};const{$set_once:h,$set:m}=t;return{event:V(V({},B4(t,JZ)),{},{properties:V(V(V({},t.properties),m?{$set:V(V({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),m)}:{}),h?{$set_once:V(V({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),h)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}ig(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||($o.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||($o.error("prepare_external_dependency_script returned null"),null):t}ng(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const c=Me==null?void 0:Me.defaultView,d=c==null||(t=c.Node)===null||t===void 0?void 0:t.prototype;if(!c||!d)return()=>{};if(this.Yp++,this.sg)return this.rg();const f=[],h=this,m=new WeakSet,v=(b,x,k)=>{if(!(b!=null&&b[x]))return;const C=b[x];b[x]=k(C),f.push(()=>{b[x]=C})},y=b=>{if(m.has(b))return b;const x=h.ig(b);return x&&m.add(x),x},_=b=>b.map(x=>typeof x=="string"?x:y(x)).filter(x=>!Nn(x));return v(d,"appendChild",b=>function(x){const k=y(x);return k?b.call(this,k):x}),v(d,"insertBefore",b=>function(x,k){const C=y(x);return C?b.call(this,C,k):x}),v(d,"replaceChild",b=>function(x,k){const C=y(x);return C?b.call(this,C,k):k}),[(e=c.Element)===null||e===void 0?void 0:e.prototype,(n=c.Document)===null||n===void 0?void 0:n.prototype,(r=c.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(b=>{v(b,"append",x=>function(...k){return x.apply(this,_(k))}),v(b,"prepend",x=>function(...k){return x.apply(this,_(k))})}),[(s=c.Element)===null||s===void 0?void 0:s.prototype,(i=c.CharacterData)===null||i===void 0?void 0:i.prototype,(o=c.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(b=>{v(b,"before",x=>function(...k){return x.apply(this,_(k))}),v(b,"after",x=>function(...k){return x.apply(this,_(k))}),v(b,"replaceWith",x=>function(...k){const C=_(k);return k.length&&!C.length?void 0:x.apply(this,C)})}),v((l=c.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",b=>function(x,k){const C=y(k);return C?b.call(this,x,C):null}),this.sg=()=>{f.forEach(b=>b()),this.sg=void 0},this.rg()}rg(){let t=!1;return()=>{var e;t||(t=!0,this.Yp--,this.Yp===0&&((e=this.sg)===null||e===void 0||e.call(this)))}}og(t,e=!0){const n=this.ng();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this.Xp.length&&($o.info(`Processing ${this.Xp.length} events for site app with id ${t.id}`),this.Xp.forEach(o=>this.og(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.eg)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,$o.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.og(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){$o.error(y3+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){$o.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}ag(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}lg(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);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,e)})}catch(r){$o.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.ag(),void this._instance.on("eventCaptured",l=>this.lg(l))):void $o.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),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:c}of s.siteApps){var i,o;et[`__$$ph_site_app_${l}`]=this._instance,(i=et.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,c,d=>{if(d)return $o.error(y3+l,d)})}else $o.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},{surveys:class extends rW{constructor(t){super(new sW(t))}},featureFlags:ng},{tracingHeaders:class{constructor(t){this._instance=t,this.ug=void 0,this.cg=void 0,this.hg=void 0,this.Cp=()=>{const e=this.dg();var n,r;e?(de(this.ug)&&(this.ug=(n=et.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),de(this.cg)&&(this.cg=(r=et.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Rp()}}initialize(){this.startIfEnabledOrStop()}Bl(t){var e,n,r;!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(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 qZ.error("failed to load script",s);t()})}vg(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}dg(){const t=this.vg();return He(t)?(He(this.hg)?this.hg.splice(0,this.hg.length,...t):this.hg=[...t],t.length>0?this.hg:void 0):(He(this.hg)&&this.hg.splice(0),this.hg=t||void 0,this.hg)}Rp(){var t,e;(t=this.ug)===null||t===void 0||t.call(this),(e=this.cg)===null||e===void 0||e.call(this),this.ug=void 0,this.cg=void 0}startIfEnabledOrStop(){this.dg()?this.Bl(this.Cp):this.Rp()}}},{toolbar:class{constructor(t){this.instance=t}fg(t){et.ph_toolbar_state=t}pg(){var t;return(t=et.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(f2(this.instance.config)||!ce||!Me)return!1;t=(r=t)!==null&&r!==void 0?r:ce.location,n=(s=n)!==null&&s!==void 0?s:ce.history;try{if(!e){try{ce.localStorage.setItem("test","test"),ce.localStorage.removeItem("test")}catch{return!1}e=ce==null?void 0:ce.localStorage}const i=iW||Iv(t.hash,"__posthog")||Iv(t.hash,"state");let o;const l=i?oP(()=>JSON.parse(atob(decodeURIComponent(i))))||oP(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(w3)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}gg(t){const e=et.ph_load_toolbar||et.ph_load_editor;!ot(e)&&Vn(e)?e(t,this.instance):b3.warn("No toolbar load function found")}loadToolbar(t){const e=!!(Me!=null&&Me.getElementById("__POSTHOG_TOOLBAR__"));if(!ce||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=V(V({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ce.localStorage.setItem(w3,JSON.stringify(V(V({},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 b3.error("[Toolbar] Failed to load",o),void this.fg(0);this.fg(2),this.gg(r)}),Lt(ce,"turbolinks:load",()=>{this.fg(0),this.loadToolbar(r)})}return!0}mg(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},{experiments:class vr{get Fr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{vr.yg("retrieved web experiments from the server"),this.bg=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.bg&&(vr.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);dt(o)&&s.variants[o]&&this._g(s,o)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];vr.wg(l,this._instance)&&this.kg(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())vr.yg(B3);else if(!this.Fr.disable_web_experiments){if(ot(this.bg))return this.bg=new Map,this.loadIfEnabled(),void this.previewWebExperiment();vr.yg("applying feature flags",e),e.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 e=vr.getWindowLocation();if(e!=null&&e.search){const n=wf(e==null?void 0:e.search,"__experiment_id"),r=wf(e==null?void 0:e.search,"__experiment_variant");n&&r&&(vr.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(e,n,r){if(this.Fr.disable_web_experiments&&!r)return e([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Fr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Sg(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(vr.yg(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.kg(s[0].name,n,s[0].variants[n].transforms))}_g(e,n){const r=e.variants[n];vr.xg(r,this._instance)?this.kg(e.name,n,r.transforms):vr.yg(`skipping variant ${n} of experiment ${e.name} because this page does not match its url conditions`)}static wg(e,n){return!ot(e.conditions)&&vr.xg(e,n)&&vr.$g(e)}static xg(e,n){var r;if(ot(e.conditions)||ot((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=vr.getWindowLocation();if(s){var i,o,l;const c=RM(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||FW[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return ce==null?void 0:ce.location}static $g(e){var n;if(ot(e.conditions)||ot((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=HM();if(r.utm_source){var s,i,o,l,c,d,f,h;const m=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,y=!(!((c=e.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0)&&c.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((h=e.conditions)===null||h===void 0||(h=h.utm)===null||h===void 0?void 0:h.utm_term)==r.utm_term;return m&&y&&_&&v}return!1}static yg(e,...n){ve.info(`[WebExperiments] ${e}`,n)}static Cg(e,...n){ve.warn(`[WebExperiments] ${e}`,n)}static Tg(e){(e.namespaceURI==="http://www.w3.org/1999/xhtml"&&e.localName==="template"?e.content:e).querySelectorAll("a[target], template").forEach(n=>{var r;if(n.localName==="template")return void(n.namespaceURI==="http://www.w3.org/1999/xhtml"&&vr.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(e,n,r){this._is_bot()?vr.yg(B3):n!=="control"?r.forEach(s=>{if(s.selector){var i;vr.yg(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);if(!(o!=null&&o.length))return void vr.Cg(`no element on this page matches selector ${s.selector} of variant ${n} for experiment ${e}`);const l=new Map;o==null||o.forEach(c=>{if(c.localName.toLowerCase()==="script")return;const d=c;if(s.html){var f;const m=c.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&c.localName==="annotation-xml"&&((f=c.getAttribute("encoding"))===null||f===void 0?void 0:f.toLowerCase())||"",v=JSON.stringify([c.namespaceURI,c.localName,m]);let y=l.get(v);if(ot(y)){var h;const _=(h=W3)!==null&&h!==void 0?h:W3=$W(),b=c.ownerDocument.implementation.createHTMLDocument(""),x=b.createElementNS(c.namespaceURI,c.localName);m&&x.setAttribute("encoding",m);const k=b.createRange();k.selectNodeContents(x);const C=c.namespaceURI==="http://www.w3.org/2000/svg"&&/^(foreignObject|desc|title)$/.test(c.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(m)?"http://www.w3.org/1999/xhtml":c.namespaceURI,P=k.createContextualFragment(s.html);c.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&/^(mi|mo|mn|ms|mtext)$/.test(c.localName)?(x.appendChild(P),_.sanitize(x,V(V({},Z3),{},{NAMESPACE:C||void 0,IN_PLACE:!0}))):(x.namespaceURI==="http://www.w3.org/1999/xhtml"&&x.localName==="template"?x.content:x).appendChild(_.sanitize(P,V(V({},Z3),{},{NAMESPACE:C||void 0,RETURN_DOM_FRAGMENT:!0}))),vr.Tg(x),y=x.innerHTML,l.set(v,y)}d.innerHTML=y}s.css&&d.setAttribute("style",s.css)})}}):vr.yg("Control variants leave the page unmodified.")}_is_bot(){return Jr&&this._instance?p5(Jr,this.Fr.custom_blocked_useragents):void 0}},featureFlags:ng},{conversations:class{constructor(t){this._instance=t,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(t){if(this._instance.config.disable_conversations)return void(this.Rg=null);if(this.Og=t.ok,!t.ok)return;const e=t.config.conversations;ot(e)?this.Rg=null:(Ms(e)?this.Ig=e:(this.Ig=e.enabled,this.ie=e),this.Ig||(this.Rg=null),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.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||f2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=et==null?void 0:et.__PosthogExtensions__;if(t&&!de(this.Ig)&&this.Ig)if(this.ie&&this.ie.token){this.Mg=!0;try{const e=t.initConversations;if(e)return this.Fg(e),void(this.Mg=!1);const n=t.loadExternalDependency;if(!n)return void this.Dg(vb);const r=this.Ag;n(this._instance,"conversations",s=>{if(r!==this.Ag)return this.Mg=!1,void this.loadIfEnabled();s||!t.initConversations?this.Dg("Could not load conversations script",s):this.Fg(t.initConversations),this.Mg=!1})}catch(e){this.Dg("Error initializing conversations",e),this.Mg=!1}}else Ui.error("Conversations enabled but missing token in remote config.")}Fg(t){if(this.ie){try{this._conversationsManager=t(this.ie,this._instance),this.Eg=!1,Ui.info("Conversations loaded successfully")}catch(e){return void this.Dg("Error completing conversations initialization",e)}this.Pg&&this._conversationsManager.setTheme(this.Pg),this.Lg()}else Ui.error("Cannot complete initialization: remote config is null")}Lg(){const t=this.Rg;this.Rg=null,this._conversationsManager&&t&&(t==="open"?this._conversationsManager.open():this._conversationsManager.close())}Dg(t,e){Ui.error(t,e),this._conversationsManager=null,this.Mg=!1,this.Eg=!0}show(){this._conversationsManager?this._conversationsManager.show():Ui.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(t){var e,n;this.Pg=V(V(V({},this.Pg),t),{},{dark:V(V({},(e=this.Pg)===null||e===void 0?void 0:e.dark),t==null?void 0:t.dark)}),(n=this._conversationsManager)===null||n===void 0||n.setTheme(t)}isAvailable(){return this.Ig===!0&&!Nn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":f2(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Og===!1?"remote_config_failed":de(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 t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return pn(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Ui.warn(Wc),null)})()}getMessages(t,e){var n=this;return pn(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Ui.warn(Wc),null)})()}markAsRead(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ui.warn(Wc),null)})()}getTickets(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ui.warn(Wc),null)})()}requestRestoreLink(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ui.warn(Wc),null)})()}restoreFromToken(t){var e=this;return pn(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ui.warn(Wc),null)})()}restoreFromUrlToken(){var t=this;return pn(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ui.warn(Wc),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Md(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}Ed(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},{logs:class extends VW{constructor(t){super({get(){var e;return t==null||(e=t.config)===null||e===void 0?void 0:e.logs},captureHintKey:lM,get remoteConfigWillArrive(){var e,n;return!(!((e=t.lc)===null||e===void 0)&&e.call(t))||!!(!((n=et._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[t.config.token])===null||n===void 0)&&n.config)}},()=>(function(e){var n;const r={};if(r.distinctId=e.get_distinct_id(),e.sessionManager){const{sessionId:s,windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:l}=e.sessionManager.checkAndGetSessionAndWindowId(!0);r.sessionId=s,r.windowId=i,ot(o)||(r.sessionStartTimestamp=o),ot(l)||(r.lastActivityTimestamp=l)}if(!(et==null||(n=et.location)===null||n===void 0)&&n.href&&(r.currentUrl=e.config.disable_capture_url_hashes?Xl(et.location.href):et.location.href),e.featureFlags){const s=e.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(t)),this._instance=t,this.name=S5,this.df()}get cf(){return this._instance.__loaded}hf(){const t=An("[logs]"),e=et==null?void 0:et.__PosthogExtensions__;if(!e)return void t.error("PostHog Extensions not found.");const n=e.loadExternalDependency;if(n)return r=>{n(this._instance,"logs",s=>{const i=e.logs;r(s,i!=null&&i.initializeLogs?{initialize:o=>i.initializeLogs(o),replay(o,l){var c;return(c=i.replayConsoleBuffer)===null||c===void 0?void 0:c.call(i,o,l)}}:void 0)})};t.error(vb)}}},{metrics:class{constructor(t){this._instance=t,this.R=An("[metrics]"),this.Ti=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Ti)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Ng?this.Ng=(n=>{let r=!0;const s=()=>r?(l=>{var c;const d=(c=l.config.metrics)===null||c===void 0?void 0:c.network;return d===!0?{}:d||void 0})(n):void 0,i=BW(n,s),o=ZW(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Ng&&(this.Ng(),this.Ng=void 0)}pf(){var t;if(this.Ti)return;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.lf&&this.gf===e||((n=this.lf)===null||n===void 0||n.reset(),this.gf=e,this.lf=new aB(this.ff(),(function(r){var s,i,o,l,c;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(e),this.R)),this.lf}count(t,e=1,n){var r;(r=this.pf())===null||r===void 0||r.count(t,e,n)}gauge(t,e,n){var r;(r=this.pf())===null||r===void 0||r.gauge(t,e,n)}histogram(t,e,n){var r;(r=this.pf())===null||r===void 0||r.histogram(t,e,n)}flush(t){if(!this.lf)return Promise.resolve();if(t){const e=this.lf.drainWindow();return e&&this.To(e,t),Promise.resolve()}return this.lf.flush().catch(e=>this.R.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.lf)===null||t===void 0||t.reset()}dispose(){var t,e;this.Ti=!0,(t=this.Ng)===null||t===void 0||t.call(this),this.Ng=void 0,(e=this.lf)===null||e===void 0||e.reset()}ff(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},To:n=>e.To(n),getLibraryId:()=>Ws.LIB_NAME,getLibraryVersion:()=>Ws.LIB_VERSION}}To(t,e){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(V(V({method:"POST",url:this.jg(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var c;s({kind:"retry-later",error:(c=o.error)!==null&&c!==void 0?c:new Error(`metrics request failed with status ${l}`)})}}}))})}jg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},{webMCP:class{constructor(t){this._instance=t,this.qg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.qg)return;const t=Me==null?void 0:Me.modelContext;if(!t||!Vn(t.registerTool))return;const e=Y3.get(t);if(e)return e.instances.add(this._instance),void(this.qg=!0);const n={instances:new Set([this._instance])},r=t.registerTool,s=this;Sf(t,"registerTool",i=>{const o=i;return function(l,...c){let d=l;try{d=s.Bg(l,n)}catch{return o.call(this,l,...c)}return o.call(this,d,...c)}}),t.registerTool!==r&&(Y3.set(t,n),this.qg=!0)}Bg(t,e){if(!t||!Vn(t.execute))return t;const n=t.execute,r=this,{tool:s,injected:i}=(function(o,l){const c={intent:!1,model:!1},d=o.inputSchema;if(!(function(y){return!!de(y)||ct(y)&&Object.keys(y).every(_=>WW.has(_)||_.startsWith("x-"))&&y.additionalProperties!==!0&&!ct(y.additionalProperties)&&(!y.type||y.type==="object")&&(!y.properties||ct(y.properties))&&(!y.required||He(y.required))})(d))return{tool:U2(o),injected:c};const f=(d==null?void 0:d.properties)||{},h=y=>H2(f,y)||He(d==null?void 0:d.required)&&d.required.includes(y);if(c.intent=l.intent&&!h("context"),c.model=l.model&&!h("llm_model"),!c.intent&&!c.model)return{tool:U2(o),injected:c};const m=V({},f),v=He(d==null?void 0:d.required)?[...d.required]:[];return c.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")),c.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:U2(o,V(V({},d),{},{type:(d==null?void 0:d.type)||"object",properties:m,required:v})),injected:c}})(t,(function(o){const l={intent:!1,model:!1};for(const c of o.instances){const d=X3(c.config.capture_webmcp);l.intent||(l.intent=(d==null?void 0:d.intent)===!0),l.model||(l.model=(d==null?void 0:d.model)===!0)}return l})(e));return Object.defineProperty(s,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){const l=new Date,c=(function(v,y){if(!ct(v))return{};try{const _=y.intent?Q3(v.context,2048,!0):void 0,b=y.model?Q3(v.llm_model,256):void 0;return V(V({},_&&_!=="{}"?{intent:_}:{}),b&&b.toLowerCase()!=="unknown"?{model:b}:{})}catch{return{}}})(o[0],i),d=(function(v,y){const _=v[0];if(!ct(_))return v;try{const b=y.intent&&H2(_,"context"),x=y.model&&H2(_,"llm_model");if(!b&&!x)return v;const k=V({},_);return b&&delete k.context,x&&delete k.llm_model,[k,...v.slice(1)]}catch{return v}})(o,i);let f;try{f=n.apply(this===s?t:this,d)}catch(v){throw r.zg(e,s,l,{error:v,errorResult:!1},c),v}if((h=f)&&typeof h.then=="function")return Promise.resolve(f).then(v=>{const y=J3(v)?{error:v,errorResult:!0}:void 0;return r.zg(e,s,l,y,c),v},v=>{throw r.zg(e,s,l,{error:v,errorResult:!1},c),v});var h;const m=J3(f)?{error:f,errorResult:!0}:void 0;return r.zg(e,s,l,m,c),f}}),s}zg(t,e,n,r,s){const i=Date.now()-n.getTime();let o;for(const c of t.instances){var l;const d=X3(c.config.capture_webmcp);if(d){r&&!o&&(o=QW(r.error,r.errorResult));try{c.capture("$mcp_tool_call",V(V(V({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:fn==null?void 0:fn.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&&c.exceptions&&(!((l=c.exceptionObserver)===null||l===void 0)&&l.isEnabled))try{const f={$exception_list:YW(c.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:fn==null?void 0:fn.hostname};c.exceptionObserver.captureException(f)}catch{}}}}}}));const JW=(function(){Ws.SDK_DIST_CHANNEL="npm";const t=bp[tp]=new Sp;return(function(){function e(){e.done||(e.done=!0,f5=!1,Wt(bp,function(n){n._dom_loaded()}))}Me!=null&&Me.addEventListener?Me.readyState==="complete"?e():Lt(Me,"DOMContentLoaded",e,{capture:!1}):ce&&ve.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Xe=JW;function zb(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,s])=>e.indexOf(+r)===-1).map(([r,s])=>s)}function eT(t,e="|"){return t.map(n=>L5(n)).join(e)}function Vb(t,e){return typeof e=="bigint"?e.toString():e}class eK{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}}function L1(t){return new eK(t)}function tK(t){return t==null}function fk(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function nK(t,e){const n=t/e,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function nl(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function hk(t){const e=Object.getOwnPropertyDescriptor(t,"shape");return e!=null&&e.get?e.get.raw:e==null?void 0:e.value}function Ga(t){return hk(t._zod.def)??t._zod.def.shape}function I5(t,e,n){Object.defineProperty(t,e,{get(){const r=n();return nl(this,e,r),r},enumerable:!0,configurable:!0})}function O5(t,e,n){e in t?nl(t,e,n):t[e]=n}function Nu(t,e,n,r){const s=Ga(e);for(const i of n){const o=Object.getOwnPropertyDescriptor(s,i);o.enumerable&&(o.get?I5(t,i,()=>{const l=e._zod.def.shape[i];return r?r(l,i):l}):O5(t,i,r?r(o.value,i):o.value))}}function rK(t,e){for(const n of Reflect.ownKeys(e)){const r=Object.getOwnPropertyDescriptor(e,n);r.enumerable&&(r.get?I5(t,n,()=>e[n]):O5(t,n,r.value))}}function wi(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function sK(t){return JSON.stringify(t)}function iK(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const M5="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Bp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const oK=L1(()=>{var t;if(So.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function kf(t){if(Bp(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Bp(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function N5(t){return kf(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const aK=new Set(["string","number","symbol"]);function Ef(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _c(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n!=null&&n.parent)&&(r._zod.parent=t),r}function rt(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function L5(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function lK(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}const D5={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]},cK={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function uK(t,e){const n=t._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 Nu(i,t,D1(t,e)),_c(t,wi(n,{shape:i,checks:[]}))}function D1(t,e){var s;const n=Ga(t),r=[];for(const i of Reflect.ownKeys(e)){if(!((s=Object.getOwnPropertyDescriptor(n,i))!=null&&s.enumerable))throw new Error(`Unrecognized key: "${String(i)}"`);e[i]&&r.push(i)}return r}function dK(t,e){const n=t._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(D1(t,e)),o={};return Nu(o,t,Reflect.ownKeys(Ga(t)).filter(l=>!i.has(l))),_c(t,wi(n,{shape:o,checks:[]}))}function fK(t,e){if(!kf(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const s=Ga(t);for(const i of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _c(t,wi(t._zod.def,{shape:$5(t,e)}))}function $5(t,e){const n={};return Nu(n,t,Reflect.ownKeys(Ga(t))),rK(n,e),n}function hK(t,e){if(!kf(e))throw new Error("Invalid input to safeExtend: expected a plain object");return _c(t,wi(t._zod.def,{shape:$5(t,e)}))}function pK(t,e){var s,i;if(!((s=e==null?void 0:e._zod)!=null&&s.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((i=t._zod.def.checks)!=null&&i.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Nu(n,t,Reflect.ownKeys(Ga(t))),Nu(n,e,Reflect.ownKeys(Ga(e)));const r=wi(t._zod.def,{shape:n,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return _c(t,r)}function tT(t,e,n,r="partial"){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const l=n?new Set(D1(e,n)):void 0,c={};return Nu(c,e,Reflect.ownKeys(Ga(e)),t&&((d,f)=>l&&!l.has(f)?d:new t({type:"optional",innerType:d}))),_c(e,wi(e._zod.def,{shape:c,checks:[]}))}function mK(t,e,n){const r=n?new Set(D1(e,n)):void 0,s={};return Nu(s,e,Reflect.ownKeys(Ga(e)),(i,o)=>r&&!r.has(o)?i:new t({type:"nonoptional",innerType:i})),_c(e,wi(e._zod.def,{shape:s}))}function Za(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function gK(t,e=0){var n;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((n=t.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function zd(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function Bh(t){return typeof t=="string"?t:t==null?void 0:t.message}function nT(t){const e=[];for(const n of t??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&e.push([s,n])}return e}function Hb(t,e,n){var r;for(let s=e;s<t.length;s++)(r=t[s]).schema??(r.schema=n)}function sc(t,e,n){var c,d,f,h,m,v,y,_,b,x;var r;const s=(d=(c=t.inst)==null?void 0:c._zod)==null?void 0:d.traits;s!=null&&s.has("$ZodType")&&(s.has("$ZodCheck")?(r=t).schema??(r.schema=t.inst):t.schema=t.inst);const i=t.schema!==t.inst?(h=(f=t.schema)==null?void 0:f._zod.def)==null?void 0:h.error:void 0,o=t.message?t.message:Bh((y=(v=(m=t.inst)==null?void 0:m._zod.def)==null?void 0:v.error)==null?void 0:y.call(v,t))??Bh(i==null?void 0:i(t))??Bh((_=e==null?void 0:e.error)==null?void 0:_.call(e,t))??Bh((b=n.customError)==null?void 0:b.call(n,t))??Bh((x=n.localeError)==null?void 0:x.call(n,t))??"Invalid input",l={};for(const k of Object.keys(t))k==="inst"||k==="schema"||k==="continue"||k==="input"||k==="__proto__"||(l[k]=t[k]);return l.path??(l.path=[]),l.message=o,e!=null&&e.reportInput&&(l.input=t.input),l}const vK=/[\uD800-\uDBFF]/;function pk(t){const e=t.length;if(!vK.test(t))return e;let n=e;for(let r=0;r<e-1;r++)(t.charCodeAt(r)&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function mk(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function yK(t){const e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Zp(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}function _K(t,e){for(const n in e){const r=Object.getOwnPropertyDescriptor(e,n);r.get?Object.defineProperty(t,n,{...r,enumerable:!1}):wK(t,n,r.value)}}function ic(t,e,n,r=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function F5(t,e,n){return ic(t,e,n,!1)}function j5(t,e){for(const n in t){const r=t[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){return ic(this,n,r(this))},set(s){ic(this,n,s)}})}return e}function wK(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?n:ic(this,e,n.bind(this))},set(r){ic(this,e,r)}})}function bK(t,e){const n=Object.getPrototypeOf(t);return e in n?void 0:n}let B2,Rl=!1;const xK={configurable:!0,get(){Rl=!0}};function an(t,e,n){const r=Object.getPrototypeOf(t._zod);if(e in r&&B2!==t._zod){B2=void 0;return}B2=t._zod,Object.defineProperty(r,e,{configurable:!0,get(){Object.defineProperty(this,e,xK);const s=Rl;Rl=!1;try{const i=n(this);return Rl?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:i}),Rl=Rl||s,i}catch(i){throw delete this[e],Rl=Rl||s,i}},set(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})}function SK(t,e,n,r){const s=bK(t,e);s&&Object.defineProperty(s,e,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,e,i),i.value=n(this),Object.defineProperty(this,e,i),i.value},set(i){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const kK="~constantCatch";function EK(t){const e=()=>t;return e[kK]=!0,e}var rT;const z5=Object.freeze({status:"aborted"}),Z2={value:void 0,enumerable:!1};let sT="captureStackTrace"in Error?Error:null;function CK(t){const e=sT;if(e){const n=e.stackTraceLimit;if(typeof n=="number"){try{e.stackTraceLimit=0}catch{return sT=null,new t}try{return new t}finally{e.stackTraceLimit=n}}}return new t}function me(t,e,n,r){const s={};function i(m){this.def=m,this.constr=h,this.traits=new Set}i.prototype=s;const o=n,l=o&&new WeakSet;function c(m,v){if(m._zod){if(m._zod.traits.has(t))return}else{Z2.value=new i(v);try{Object.defineProperty(m,"_zod",Z2)}finally{Z2.value=void 0}}if(m._zod.traits.add(t),e(m,v),l){const _=Object.getPrototypeOf(m),b=m._zod.constr.prototype;let x=_;for(;x&&x!==b;)x=Object.getPrototypeOf(x);const k=x??_;l.has(k)||(l.add(k),_K(k,o))}const y=h.prototype;for(const _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(_ in m||(m[_]=y[_].bind(m)))}const d=(r==null?void 0:r.Parent)??Object;class f extends d{}Object.defineProperty(f,"name",{value:t});function h(m){var b;const v=r!=null&&r.Parent?CK(f):this;c(v,m);const y=v._zod.deferred;if(y){for(const x of y)x();v._zod.deferred=void 0}const _=(b=globalThis.__zod_globalConfig)==null?void 0:b.postProcessor;return _&&_(v),v}return Object.defineProperty(h,"init",{value:c}),Object.defineProperty(h,Symbol.hasInstance,{value:m=>{var v,y;return r!=null&&r.Parent&&m instanceof r.Parent?!0:(y=(v=m==null?void 0:m._zod)==null?void 0:v.traits)==null?void 0:y.has(t)}}),Object.defineProperty(h,"name",{value:t}),h}class xu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class V5 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(rT=globalThis).__zod_globalConfig??(rT.__zod_globalConfig={});const So=globalThis.__zod_globalConfig;function aa(t){return t&&Object.assign(So,t),So}function PK(){const t=this._zod;return t.message??(t.message=JSON.stringify(t.def,Vb,2)),t.message}function TK(t){this._zod.message=t}const RK={get:PK,set:TK,enumerable:!0,configurable:!0},W2={value:void 0,enumerable:!1},iT=new WeakSet([Object.prototype,Error.prototype]),AK=(t,e)=>{t.name="$ZodError",W2.value=e,Object.defineProperty(t,"issues",W2),W2.value=void 0,Object.defineProperty(t,"message",RK);const n=Object.getPrototypeOf(t);iT.has(n)||(iT.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})}}))},IK=me("$ZodError",AK);function OK(t,e,n){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:n(),writable:!0,enumerable:!0,configurable:!0}):t[e]=n()),t[e]}function MK(t,e=n=>n.message){const n={},r=[];for(const s of t.issues)s.path.length>0?OK(n,s.path[0],()=>[]).push(e(s)):r.push(e(s));return{formErrors:r,fieldErrors:n}}function NK(t,e=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(l=>r({issues:l},[...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 l=[...i,...o.path];if(l.length===0)n._errors.push(e(o));else{let c=n,d=0;for(;d<l.length;){const f=l[d],h=d===l.length-1;if(f==="_errors"){h&&c._errors.push(e(o)),d++;continue}Object.prototype.hasOwnProperty.call(c,f)||Object.defineProperty(c,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=c[f];h&&m._errors.push(e(o)),c=m,d++}}}};return r(t),n}function $1(t,e){return{callee:(e==null?void 0:e.callee)??t,Err:e==null?void 0:e.Err}}const gk=t=>{const e=(n,r,s,i)=>{const o=s?{...s,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new xu;if(l.issues.length){const c=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>sc(d,o,aa())));throw M5(c,(i==null?void 0:i.callee)??e),c}return l.value};return e},vk=t=>{const e=async(n,r,s,i)=>{const o=s?{...s,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new((i==null?void 0:i.Err)??t)(l.issues.map(d=>sc(d,o,aa())));throw M5(c,(i==null?void 0:i.callee)??e),c}return l.value};return e},yk=t=>(e,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new xu;return i.issues.length?H5(t,i.issues,s):{success:!0,data:i.value}};function H5(t,e,n){let r;return{success:!1,get error(){return r||(r=new t(e.map(s=>sc(s,n,aa()))),e=void 0,n=void 0),r},set error(s){r=s,e=void 0,n=void 0}}}const _k=t=>async(e,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=e._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?H5(t,i.issues,s):{success:!0,data:i.value}},LK=Symbol.for("zod.compile.invalid"),DK=Symbol.for("zod.compile.fallback"),$K=((t,e,n)=>{const r=t._zod.bag.validator;if(r!==void 0){if(r(e)!==LK)return!0;if(r.definite===!0&&n===void 0)return!1}return FK(t,e,n)});function FK(t,e,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=t._zod.bag.fallbackRun;let i;if(s?(r[DK]=!0,i=s({value:e,issues:[]},r)):i=t._zod.run({value:e,issues:[]},r),i instanceof Promise)throw new xu;return i.issues.length===0}const jK=async(t,e,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=t._zod.run({value:e,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},zK=t=>{const e=gk(t),n=(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return e(r,s,l,$1(n,o))};return n},VK=t=>{const e=gk(t),n=(r,s,i,o)=>e(r,s,i,$1(n,o));return n},HK=t=>{const e=vk(t),n=async(r,s,i,o)=>{const l=i?{...i,direction:"backward"}:{direction:"backward"};return await e(r,s,l,$1(n,o))};return n},UK=t=>{const e=vk(t),n=async(r,s,i,o)=>await e(r,s,i,$1(n,o));return n},BK=t=>(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return yk(t)(e,n,s)},ZK=t=>(e,n,r)=>yk(t)(e,n,r),WK=t=>async(e,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return _k(t)(e,n,s)},KK=t=>async(e,n,r)=>_k(t)(e,n,r),qK=/^[cC][0-9a-z]{6,}$/,GK=/^[0-9a-z]+$/,YK=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,XK=/^[0-9a-vA-V]{20}$/,QK=/^[A-Za-z0-9]{27}$/,JK=/^[a-zA-Z0-9_-]{21}$/;function eq(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}const tq=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nq=/^([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})$/,oT=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,rq=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sq="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function iq(){return new RegExp(sq,"u")}const oq=/^(?:(?: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])$/,aq=/^(([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}|:))$/,lq=/^((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])$/,cq=/^(([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])$/,uq=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dq=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,fq=/^https?$/,hq=/^\+[1-9]\d{6,14}$/,U5="(?:(?:\\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 pq(t){return new RegExp(`^${t}$`)}const mq=pq(U5);function Ub(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gq(t){return new RegExp(`^${Ub(t)}$`)}function vq(t){const e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Ub({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,r=t.local?`${n}|${Ub({precision:t.precision})}`:n;return new RegExp(`^${U5}T(?:${r})$`)}const yq=/^[\s\S]{0,}$/,_q=/^-?\d+$/,wk=/^-?\d+(?:\.\d+)?$/,wq=/^(?:true|false)$/i,bq=/^[^A-Z]*$/,xq=/^[^a-z]*$/,ii=me("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),bk=t=>{const e=t.value;return!tK(e)&&e.length!==void 0},$v={number:"number",bigint:"bigint",object:"date"},B5=me("$ZodCheckLessThan",(t,e)=>{ii.init(t,e);const n=$v[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:$v[typeof r.value]??n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Z5=me("$ZodCheckGreaterThan",(t,e)=>{ii.init(t,e);const n=$v[typeof e.value];t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:$v[typeof r.value]??n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Sq=me("$ZodCheckMultipleOf",(t,e)=>{ii.init(t,e),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?e.value!==BigInt(0)&&n.value%e.value===BigInt(0):nK(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),kq=me("$ZodCheckNumberFormat",(t,e)=>{var o;ii.init(t,e),e.format=e.format||"float64";const n=(o=e.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=D5[e.format];t._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}c<s&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!e.abort}),c>i&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Eq=me("$ZodCheckMaxLength",(t,e)=>{var n;ii.init(t,e),(n=t._zod.def).when??(n.when=bk),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>e.maximum?pk(s):i)<=e.maximum)return;const l=mk(s);r.issues.push({origin:l,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),Cq=me("$ZodCheckMinLength",(t,e)=>{var n;ii.init(t,e),(n=t._zod.def).when??(n.when=bk),t._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=e.minimum&&i<e.minimum*2?pk(s):i)>=e.minimum)return;const l=mk(s);r.issues.push({origin:l,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),Pq=me("$ZodCheckLengthEquals",(t,e)=>{var n;ii.init(t,e),(n=t._zod.def).when??(n.when=bk),t._zod.check=r=>{const s=r.value,i=s.length,o=typeof s=="string"&&i>=e.length&&i<=e.length*2?pk(s):i;if(o===e.length)return;const l=mk(s),c=o>e.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),F1=me("$ZodCheckStringFormat",(t,e)=>{var n,r;ii.init(t,e),e.pattern?(n=t._zod).check??(n.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),Tq=me("$ZodCheckRegex",(t,e)=>{F1.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Rq=me("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=bq),F1.init(t,e)}),Aq=me("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=xq),F1.init(t,e)}),Iq=me("$ZodCheckIncludes",(t,e)=>{ii.init(t,e);const n=Ef(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position},}${n}`:n);e.pattern=r,t._zod.check=s=>{s.value.includes(e.includes,e.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:s.value,inst:t,continue:!e.abort})}}),Oq=me("$ZodCheckStartsWith",(t,e)=>{ii.init(t,e);const n=new RegExp(`^${Ef(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Mq=me("$ZodCheckEndsWith",(t,e)=>{ii.init(t,e);const n=new RegExp(`.*${Ef(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Nq=me("$ZodCheckOverwrite",(t,e)=>{ii.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Lq{constructor(e=[],n={}){this.content=[],this.indent=0,this.args=e,this.closed=n}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.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 e=Function,n=(this==null?void 0:this.content)??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
23
- ${n.join(`
24
- `)}
25
- };`)(...Object.values(this.closed))}}const Dq={major:4,minor:6,patch:7},Xn=me("$ZodType",(t,e)=>{var i;var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Dq;const r=t._zod.def.checks,s=t._zod.traits.has("$ZodCheck")?[t,...r??[]]:r!=null&&r.length?[...r]:[];for(const o of s)for(const l of o._zod.onattach)l(t);if(s.length===0)(n=t._zod).deferred??(n.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const o=(c,d,f)=>{if(c.memo)return c;let h=Za(c),m;for(const v of d){if(v._zod.def.when){if(gK(c)||!v._zod.def.when(c))continue}else if(h)continue;const y=c.issues.length,_=v._zod.check(c);if(_ instanceof Promise&&(f==null?void 0:f.async)===!1)throw new xu;if(m||_ instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await _,c.issues.length!==y&&(Hb(c.issues,y,t),h||(h=Za(c,y)))});else{if(c.issues.length===y)continue;Hb(c.issues,y,t),h||(h=Za(c,y))}}return m?m.then(()=>c):c},l=(c,d,f)=>{if(Za(c))return c.aborted=!0,c;const h=o(d,s,f);if(h instanceof Promise){if(f.async===!1)throw new xu;return h.then(m=>t._zod.parse(m,f))}return t._zod.parse(h,f)};t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){const h=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(m=>l(m,c,d)):l(h,c,d)}const f=t._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new xu;return f.then(h=>o(h,s,d))}return o(f,s,d)}}},{get"~standard"(){return F5(this,"~standard",K5(this))},set"~standard"(t){ic(this,"~standard",t)}}),W5=(t,e)=>t.issues.length?{issues:t.issues.map(n=>sc(n,e,aa()))}:{value:t.value};async function $q(t,e){const n={async:!0};return W5(await t._zod.run({value:e,issues:[]},n),n)}function K5(t){return{validate:e=>{const n={async:!1};try{const r=t._zod.run({value:e,issues:[]},n);if(!(r instanceof Promise))return W5(r,n)}catch{}return $q(t,e)},vendor:"zod",version:1}}const xk=me("$ZodString",(t,e)=>{Xn.init(t,e),t._zod.pattern=e.pattern??yq,t._zod.parse=(n,r)=>{if(e.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:t}),n}}),Un=me("$ZodStringFormat",(t,e)=>{F1.init(t,e),xk.init(t,e)}),Fq=me("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=nq),Un.init(t,e)}),jq=me("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=oT(r))}else e.pattern??(e.pattern=oT());Un.init(t,e)}),zq=me("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=rq),Un.init(t,e)}),q5=1,Fv=2;function G5(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function Vq(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?G5(t)||Fv:Hq(t,e)}function Hq(t,e){var n;if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===fq.source&&!/^https?:\/\//i.test(t))return q5;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(t)??Fv}return new URL(t)}catch{return Fv}}const Uq=/[\t\n\r]/g;function aT(t){return t.replace(Uq,"")}function Bq(t,e){return e.lastIndex=0,e.test(t.hostname)}function Zq(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}const Wq=me("$ZodURL",(t,e)=>{Un.init(t,e),t._zod.check=n=>{try{const r=n.value.trim(),s=Vq(r,e);if(s===q5){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}if(s===Fv){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort});return}if(s===!0){n.value=aT(r);return}e.hostname&&!Bq(s,e.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort}),e.protocol&&!Zq(s,e.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort}),n.value=e.normalize?s.href:aT(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Kq=me("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=iq()),Un.init(t,e)}),qq=me("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?JK:eq(e.length)),Un.init(t,e)}),Gq=me("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=qK),Un.init(t,e)}),Yq=me("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=GK),Un.init(t,e)}),Xq=me("$ZodULID",(t,e)=>{e.pattern??(e.pattern=YK),Un.init(t,e)}),Qq=me("$ZodXID",(t,e)=>{e.pattern??(e.pattern=XK),Un.init(t,e)}),Jq=me("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=QK),Un.init(t,e)}),eG=me("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=vq(e)),Un.init(t,e)}),tG=me("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=mq),Un.init(t,e)}),nG=me("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=gq(e)),Un.init(t,e)}),rG=me("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=tq),Un.init(t,e)}),sG=me("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=oq),Un.init(t,e)}),iG=/^[0-9a-fA-F:.]+$/;function Y5(t){return iG.test(t)?G5(`http://[${t}]`):!1}const oG=me("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=aq),Un.init(t,e),t._zod.check=n=>{Y5(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}),aG=me("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=lq),Un.init(t,e)});function lG(t){const e=t.split("/");if(e.length!==2)return!1;const[n,r]=e;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:Y5(n)}const cG=me("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=cq),Un.init(t,e),t._zod.check=n=>{lG(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}});function X5(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const Q5=/^[0-9a-zA-Z+/]*={0,2}$/,uG=me("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Q5),Un.init(t,e),t._zod.check=n=>{X5(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}}),Sk=/^[A-Za-z0-9_-]*$/;function dG(t){if(!Sk.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return X5(n)}const fG=me("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Sk),Un.init(t,e),t._zod.check=n=>{dG(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),hG=me("$ZodE164",(t,e)=>{e.pattern??(e.pattern=hq),Un.init(t,e)});function pG(t,e=null){try{const n=t.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||e&&(!("alg"in s)||s.alg!==e))}catch{return!1}}const mG=me("$ZodJWT",(t,e)=>{Un.init(t,e),t._zod.check=n=>{pG(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),J5=me("$ZodNumber",(t,e)=>{Xn.init(t,e),t._zod.pattern=wk,t._zod.parse=(n,r)=>{if(e.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:t,...i?{received:i}:{}}),n}}),gG=me("$ZodNumberFormat",(t,e)=>{kq.init(t,e),J5.init(t,e)}),vG=me("$ZodBoolean",(t,e)=>{Xn.init(t,e),t._zod.pattern=wq,t._zod.parse=(n,r)=>{if(e.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:t}),n}}),yG=me("$ZodUnknown",(t,e)=>{Xn.init(t,e),t._zod.parse=n=>n}),_G=me("$ZodNever",(t,e)=>{Xn.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function wG(t,e){const n=nT(t._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=t._zod.parse;t._zod.parse=(i,o)=>{const l=e(i.value);if(l>r&&!(o!=null&&o.skipChecks)&&(o==null?void 0:o.direction)!=="backward"){for(const[c,d]of nT(t._zod.def.checks))if(l>c&&d._zod.def.when(i)){const f=i.issues.length;return d._zod.check(i),i.issues[f].continue=!1,Hb(i.issues,f,t),i}}return s(i,o)}}const bG=t=>Array.isArray(t)?t.length:-1;function lT(t,e,n){t.issues.length&&e.issues.push(...zd(n,t.issues)),e.value[n]=t.value}const xG=me("$ZodArray",(t,e)=>{Xn.init(t,e);const n=So.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=n?n.alloc(t,r,Array(i.length),s):Array(i.length);const o=[],l=s==null?void 0:s.abortEarly;for(let c=0;c<i.length;c++){const d=i[c],f=e.element._zod.run({value:d,issues:[]},s);if(f instanceof Promise)o.push(f.then(h=>lT(h,r,c)));else if(lT(f,r,c),l&&f.issues.length!==0&&Za(f))break}return o.length?Promise.all(o).then(()=>r):r},wG(t,bG)});function jv(t,e,n,r,s,i){const o=n in r,l=i==="optional";if(!(!o&&l&&s==="optional")){if(t.issues.length){if(s!==void 0&&l&&!o)return;e.issues.push(...zd(n,t.issues))}if(!o&&s===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?(o||s==="defaulted"&&!l)&&(e.value[n]=void 0):e.value[n]=t.value}}const SG=[];function eN(t){var o,l,c,d;const e=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),r=n.length?n:SG,s=r.length?[...e,...r]:e;for(const f of s)if(!((d=(c=(l=(o=t.shape)==null?void 0:o[f])==null?void 0:l._zod)==null?void 0:c.traits)!=null&&d.has("$ZodType")))throw new Error(`Invalid element at key "${String(f)}": expected a Zod schema`);const i=lK(t.shape);return{...t,allKeys:s,symbolKeys:r,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function tN(t,e,n,r,s,i,o){const l=[],c=s.keySet,d=s.catchall._zod,f=d.def.type,h=d.optin,m=d.optout;let v=0;for(const y in e){if(o&&n.issues.length!==v){if(Za(n,v))break;v=n.issues.length}if(c.has(y))continue;if(y==="__proto__"){f==="never"&&l.push(y);continue}if(f==="never"){l.push(y);continue}const _=d.run({value:e[y],issues:[]},r);_ instanceof Promise?t.push(_.then(b=>jv(b,n,y,e,h,m))):jv(_,n,y,e,h,m)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:e,inst:i,continue:!0}),t.length?Promise.all(t).then(()=>n):n}const kG=me("$ZodObject",(t,e)=>{Xn.init(t,e);const n=Object.getOwnPropertyDescriptor(e,"shape"),r=n!=null&&n.get?n.get.raw:e.shape??{};if(r){const d=()=>{const f={...r};return Object.defineProperty(e,"shape",{value:f}),d.raw=f,f};d.raw=r,Object.defineProperty(e,"shape",{get:d})}const s=L1(()=>eN(e));an(t,"propValues",d=>{const f=d.def.shape,h={};for(const m in f){const v=f[m]._zod;if(v.values){Object.prototype.hasOwnProperty.call(h,m)||nl(h,m,new Set);for(const y of v.values)h[m].add(y);v.optin!==void 0&&h[m].add(void 0)}}return h});const i=Bp,o=e.catchall;let l;const c=So.memoizer;c==null||c.attach(t),t._zod.parse=(d,f)=>{l??(l=s.value);const h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),d;d.value=c?c.alloc(t,d,{},f):{};const m=[],v=l.shape,y=f==null?void 0:f.abortEarly;let _=d.issues.length;for(const b of l.allKeys){if(y&&d.issues.length!==_){if(Za(d,_))break;_=d.issues.length}if(b==="__proto__")continue;const x=v[b],k=x._zod.optin,C=x._zod.optout,P=x._zod.run({value:h[b],issues:[]},f);P instanceof Promise?m.push(P.then(R=>jv(R,d,b,h,k,C))):jv(P,d,b,h,k,C)}return o?tN(m,h,d,f,s.value,t,y===!0):m.length?Promise.all(m).then(()=>d):d}}),EG=me("$ZodObjectJIT",(t,e)=>{kG.init(t,e);const n=t._zod.parse,r=L1(()=>eN(e)),s=So.memoizer,i=v=>{var R,O;const y=r.value,_=y.symbolKeys,b=new Lq(["payload","ctx"],{shape:v,inst:t,memo:s,syms:_}),x=I=>`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`,k=(I,A)=>`
26
- let ${I}_ab = false;
27
- for (let i = 0; i < ${I}.issues.length; i++) {
28
- const iss = ${I}.issues[i];
29
- iss.path = iss.path ? [${A}, ...iss.path] : [${A}];
30
- payload.issues.push(iss);
31
- if (iss.continue !== true) ${I}_ab = true;
32
- }
33
- if (${I}_ab && ctx && ctx.abortEarly) {
34
- payload.value = newResult;
35
- return payload;
36
- }`;b.write("const input = payload.value;");const C=Object.create(null);let P=0;for(const I of y.allKeys)C[I]=`key_${P++}`;b.write(s?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const I of y.allKeys){if(I==="__proto__")continue;const A=C[I],M=typeof I=="symbol"?`syms[${_.indexOf(I)}]`:sK(I),L=`${M} in input`,z=v[I],$=(R=z==null?void 0:z._zod)==null?void 0:R.optin,q=$!==void 0,X=((O=z==null?void 0:z._zod)==null?void 0:O.optout)==="optional";if(b.write(`const ${A} = ${x(M)};`),q&&X){const j=$==="optional"?`${A}_present`:`${A}.value !== undefined || ${A}_present`;b.write(`
37
- const ${A}_present = ${L};
38
- if (!${A}.issues.length || ${A}_present) {
39
- if (${A}.issues.length) {${k(A,M)}
40
- }
41
-
42
- if (${j}) {
43
- newResult[${M}] = ${A}.value;
44
- }
45
- }
46
-
47
- `)}else q?(b.write(`
48
- if (${A}.issues.length) {${k(A,M)}
49
- }
50
- `),$==="defaulted"?b.write(`newResult[${M}] = ${A}.value;`):b.write(`
51
- if (${A}.value !== undefined || ${L}) {
52
- newResult[${M}] = ${A}.value;
53
- }
54
- `)):b.write(`
55
- const ${A}_present = ${L};
56
- if (${A}.issues.length) {${k(A,M)}
57
- }
58
- if (!${A}_present && !${A}.issues.length) {
59
- payload.issues.push({
60
- code: "invalid_type",
61
- expected: "nonoptional",
62
- input: undefined,
63
- path: [${M}]
64
- });
65
- if (ctx && ctx.abortEarly) {
66
- payload.value = newResult;
67
- return payload;
68
- }
69
- }
70
-
71
- if (${A}_present) {
72
- newResult[${M}] = ${A}.value;
73
- }
74
-
75
- `)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()};let o;const l=Bp,c=!So.jitless,f=c&&oK.value,h=e.catchall;let m;t._zod.parse=(v,y)=>{m??(m=r.value);const _=v.value;return l(_)?c&&f&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(o||(o=i(e.shape)),v=o(v,y),h?tN([],_,v,y,m,t,(y==null?void 0:y.abortEarly)===!0):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),v)}});function cT(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const s=t.filter(i=>!Za(i));return s.length===1?(e.value=s[0].value,s[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(o=>sc(o,r,aa())))}),e)}const nN=me("$ZodUnion",(t,e)=>{Xn.init(t,e),an(t,"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),an(t,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),an(t,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),an(t,"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=>fk(i.source)).join("|")})$`)}});const n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const l of e.options){const c=l._zod.run({value:r.value,issues:[]},s);if(c instanceof Promise)o.push(c),i=!0;else{if(c.issues.length===0)return c;o.push(c)}}return i?Promise.all(o).then(l=>cT(l,r,t,s)):cT(o,r,t,s)}});function CG(t){var n;const e=new Map;for(const r of t.options){const s=(n=r._zod.propValues)==null?void 0:n[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const i of s)if(e.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);e.set(i,null)}else e.set(i,r)}return e}const PG=me("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,nN.init(t,e);const n=t._zod.parse;an(t,"propValues",s=>{var l,c;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)}"`);(l=f[s.def.discriminator])!=null&&l.has(void 0)&&o++;for(const[h,m]of Object.entries(f)){Object.prototype.hasOwnProperty.call(i,h)||nl(i,h,new Set);for(const v of m)i[h].add(v)}}return!s.def.unionFallback&&o>1&&((c=i[s.def.discriminator])==null||c.delete(void 0)),i}),e.options.forEach((s,i)=>{const o=hk(s._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,e.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=L1(()=>CG(e));t._zod.parse=(s,i)=>{const o=s.value;if(!Bp(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),s;const l=o==null?void 0:o[e.discriminator],c=r.value.get(l);return c&&(l!==void 0||i.direction!=="backward")?c._zod.run(s,i):e.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(r.value.keys()).filter(d=>r.value.get(d)!==null),input:o,path:[e.discriminator],inst:t}),s)}}),TG=me("$ZodIntersection",(t,e)=>{Xn.init(t,e),t._zod.parse=(n,r)=>{const s=n.value,i=e.left._zod.run({value:s,issues:[]},r),o=e.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([c,d])=>uT(n,c,d)):uT(n,i,o)}});function Bb(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(kf(t)&&kf(e)){const n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),s={...t,...e};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const o=Bb(t[i],e[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r],o=Bb(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 uT(t,e,n){const r=new Map;let s;const i=new Map,o=(d,f)=>{var m,v;let h;if(d.code==="unrecognized_keys"&&!((m=d.path)!=null&&m.length))s??(s=d),h=d.keys;else if(d.code==="invalid_key"&&d.origin==="record"&&((v=d.path)==null?void 0:v.length)===1){const y=String(d.path[0]);i.has(y)||i.set(y,d),h=[y]}else return!1;for(const y of h)r.has(y)||r.set(y,{}),r.get(y)[f]=!0;return!0};for(const d of e.issues)o(d,"l")||t.issues.push(d);for(const d of n.issues)o(d,"r")||t.issues.push(d);const l=[...r].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(l.length){const d=s?l.filter(f=>s.keys.includes(f)):[];d.length&&t.issues.push({...s,keys:d});for(const f of l)!d.includes(f)&&i.has(f)&&t.issues.push(i.get(f))}const c=Bb(e.value,n.value);if(!c.valid){if(Za(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return t.value=c.data,t}const RG=me("$ZodRecord",(t,e)=>{Xn.init(t,e);const n=So.memoizer;n==null||n.attach(t),t._zod.parse=(r,s)=>{const i=r.value;if(!kf(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;const o=[],l=e.keyType._zod.values;if(l&&!e.partial){r.value=n?n.alloc(t,r,{},s):{};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(c.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;const h=e.keyType._zod.run({value:f,issues:[]},s);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(y=>sc(y,s,aa())),input:f,path:[f],inst:t});continue}const m=h.value;if(m==="__proto__")continue;const v=e.valueType._zod.run({value:i[f],issues:[]},s);v instanceof Promise?o.push(v.then(y=>{y.issues.length&&r.issues.push(...zd(f,y.issues)),r.value[m]=y.value})):(v.issues.length&&r.issues.push(...zd(f,v.issues)),r.value[m]=v.value)}let d;for(const f in i)if(!c.has(f))if(e.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:t,keys:d,continue:!0})}else{r.value=n?n.alloc(t,r,{},s):{};let c;for(const d of Reflect.ownKeys(i)){if(d==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,d))continue;let f=e.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"&&wk.test(d)&&f.issues.length){const y=e.keyType._zod.run({value:Number(d),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(f=y)}if(f.issues.length){e.mode==="loose"?r.value[d]=i[d]:l?(c=c??[],c.push(d)):r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(y=>sc(y,s,aa())),input:d,path:[d],inst:t});continue}const m=f.value;if(m==="__proto__")continue;const v=e.valueType._zod.run({value:i[d],issues:[]},s);v instanceof Promise?o.push(v.then(y=>{y.issues.length&&r.issues.push(...zd(d,y.issues)),r.value[m]=y.value})):(v.issues.length&&r.issues.push(...zd(d,v.issues)),r.value[m]=v.value)}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),AG=me("$ZodEnum",(t,e)=>{Xn.init(t,e);const n=zb(e.entries),r=new Set(n);t._zod.values=r,an(t,"pattern",s=>{const i=zb(s.def.entries).filter(o=>aK.has(typeof o));return new RegExp(i.length?`^(${i.map(o=>Ef(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:t}),s}}),IG=me("$ZodLiteral",(t,e)=>{Xn.init(t,e);const n=new Set(e.values);t._zod.values=n,an(t,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?Ef(i):i?Ef(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),r}}),OG=me("$ZodTransform",(t,e)=>{var n;Xn.init(t,e),t._zod.optin="optional",(n=So.memoizer)==null||n.guard(t),t._zod.parse=(r,s)=>{if(s.direction==="backward")throw new V5(t.constructor.name);const i=e.transform(r.value,r);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(r.value=l,r));if(i instanceof Promise)throw new xu;return r.value=i,r}});function dT(t,e){return t.value=e.issues.length?void 0:e.value,t}const rN=me("$ZodOptional",(t,e)=>{Xn.init(t,e),an(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",an(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),an(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${fk(r.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(n.value===void 0){if(e.innerType._zod.optin!=="defaulted")return n;const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>dT(n,i)):dT(n,s)}return e.innerType._zod.run(n,r)}}),MG=me("$ZodExactOptional",(t,e)=>{rN.init(t,e),an(t,"values",n=>n.def.innerType._zod.values),an(t,"pattern",n=>n.def.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),NG=me("$ZodNullable",(t,e)=>{Xn.init(t,e),an(t,"optin",n=>n.def.innerType._zod.optin),an(t,"optout",n=>n.def.innerType._zod.optout),an(t,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${fk(r.source)}|null)$`):void 0}),an(t,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),LG=me("$ZodDefault",(t,e)=>{Xn.init(t,e),t._zod.optin="defaulted",an(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>fT(i,e)):fT(s,e)}});function fT(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const DG=me("$ZodPrefault",(t,e)=>{Xn.init(t,e),t._zod.optin="defaulted",an(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),$G=me("$ZodNonOptional",(t,e)=>{Xn.init(t,e),an(t,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),t._zod.parse=(n,r)=>{const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>hT(i,t)):hT(s,t)}});function hT(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function pT(t,e,n,r){return e.issues.length?(t.value=n.catchValue({...e,value:t.value,error:{issues:e.issues.map(s=>sc(s,r,aa()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}const FG=me("$ZodCatch",(t,e)=>{Xn.init(t,e),an(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),an(t,"optout",n=>n.def.innerType._zod.optout),an(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>pT(n,i,e,r)):pT(n,s,e,r)}}),jG=me("$ZodPipe",(t,e)=>{Xn.init(t,e),an(t,"values",n=>n.def.in._zod.values),an(t,"optin",n=>n.def.in._zod.optin),an(t,"optout",n=>n.def.out._zod.optout),an(t,"propValues",n=>n.def.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>ig(o,e.in,r)):ig(i,e.in,r)}const s=e.in._zod.run(n,r);return s instanceof Promise?s.then(i=>ig(i,e.out,r)):ig(s,e.out,r)}});function ig(t,e,n){return t.issues.some(r=>r.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const zG=me("$ZodReadonly",(t,e)=>{Xn.init(t,e),an(t,"propValues",n=>n.def.innerType._zod.propValues),an(t,"values",n=>n.def.innerType._zod.values),an(t,"optin",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optin}),an(t,"optout",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optout}),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(mT):mT(s)}});function mT(t){return t.memo||(t.value=Object.freeze(t.value)),t}const VG=me("$ZodCustom",(t,e)=>{ii.init(t,e),Xn.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,s=e.fn(r);if(s instanceof Promise)return s.then(i=>gT(i,n,r,t));gT(s,n,r,t)}});function gT(t,e,n,r){if(!t){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),e.issues.push(Zp(s))}}class HG extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Zb="~memo",vT=[];function sN(t){return t!==null&&typeof t=="object"}function K2(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const iN=new WeakMap,rp=0,Ug=1,kp=2;function Bg(t,e,n){const r=iN.get(t);if(r!==void 0)return r?kp:rp;if(e.has(t))return kp;e.add(t);let s=rp;const i=f=>{if(s!==kp&&(f!=null&&f._zod)){const h=Bg(f,e);h>s&&(s=h)}},o=(f,h)=>{var v;let m=rp;for(const y of Reflect.ownKeys(f)){const _=Object.getOwnPropertyDescriptor(f,y);if(!_.enumerable)continue;const b=_.get?Ug:(v=_.value)!=null&&v._zod?Bg(_.value,e):rp;b>m&&(m=b)}return m},l=f=>{f>s&&(s=f)},c=t._zod.def;switch(c.type){case"object":{const f=hk(c);l(f?o(f):Ug),i(c.catchall);break}case"array":i(c.element);break;case"tuple":for(const f of c.items)i(f);i(c.rest);break;case"record":case"map":i(c.keyType),i(c.valueType);break;case"set":i(c.valueType);break;case"union":for(const f of c.options)i(f);break;case"intersection":i(c.left),i(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(c.innerType);break;case"pipe":i(c.in),i(c.out);break;case"function":i(c.input),i(c.output);break;case"lazy":{const f=c._cachedInner??void 0;l(f?Bg(f,e):Ug);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 c){const h=Object.getOwnPropertyDescriptor(c,f);if(!h||h.get)continue;const m=h.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const v of m)i(v)}}}return e.delete(t),UG(t,s)}function UG(t,e){return e!==Ug&&iN.set(t,e===kp),e}function BG(t,e){let n=t.buckets.get(e);return n||(n=new WeakMap,t.buckets.set(e,n)),n}let og;const ag=[],ZG={alloc(t,e,n){const r=og;if(!r)return n;og=void 0;const s={value:n,issues:null};return r.set(e.value,s),ag.push(s),n},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const n=t._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&KG(i,s.value))throw new HG;return n(s,i)};t._zod.parse=r,t._zod.run===n&&(t._zod.run=r)})},attach(t){var e;let n,r=!1,s,i;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const o=t._zod.parse,l=(c,d)=>{if(n===void 0){const x=Bg(t,new Set);if(x===rp)return t._zod.parse=o,t._zod.run===l&&(t._zod.run=o),o(c,d);x===kp||r?n=!0:r=!0}const f=c.value;if(!sN(f))return o(c,d);let h=d[Zb];h||(h={buckets:new WeakMap,backEdges:void 0},d[Zb]=h);let m;s===d?m=i:(m=BG(h,t),s=d,i=m);const v=m.get(f);if(v)return c.value=v.value,v.issues?v.issues.length&&c.issues.push(...K2(v.issues)):(c.memo=!0,h.backEdges??(h.backEdges=new WeakSet),h.backEdges.add(v.value)),c;og=m;const y=ag.length,_=o(c,d);og=void 0;const b=ag.length>y?ag.pop():void 0;return _ instanceof Promise?_.then(x=>(b&&(b.issues=x.issues.length?K2(x.issues):vT),x)):(b&&(b.issues=_.issues.length?K2(_.issues):vT),_)};t._zod.parse=l,t._zod.run===o&&(t._zod.run=l)})}};function WG(){return ZG}function KG(t,e){var r;const n=(r=t[Zb])==null?void 0:r.backEdges;return n!==void 0&&sN(e)&&n.has(e)}const qG=()=>{const t={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 e(i){return t[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),l=yK(i.input),c=s(l,i.input);return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${L5(i.values[0])}`:`Invalid option: expected one of ${eT(i.values,"|")}`;case"too_big":{const o=i.exact?"exactly ":i.inclusive?"<=":"<",l=e(i.origin);return l?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${l.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.exact?"exactly ":i.inclusive?">=":">",l=e(i.origin);return l?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${l.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":""}: ${eT(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(l=>`'${l}'`).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 GG(){return{localeError:qG()}}var yT;class YG{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function XG(){return new YG}(yT=globalThis).__zod_globalRegistry??(yT.__zod_globalRegistry=XG());const sp=globalThis.__zod_globalRegistry;function oN(t){return t.checks&&(t.checks=[...t.checks]),t}function QG(t,e){return new t(oN({type:"string",...rt(e)}))}function JG(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...rt(e)})}function eY(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...rt(e)})}function tY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...rt(e)})}function nY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...rt(e)})}function rY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...rt(e)})}function sY(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...rt(e)})}function iY(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...rt(e)})}function oY(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...rt(e)})}function aY(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...rt(e)})}function lY(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...rt(e)})}function cY(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...rt(e)})}function uY(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...rt(e)})}function dY(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...rt(e)})}function fY(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...rt(e)})}function hY(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...rt(e)})}function pY(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...rt(e)})}function mY(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...rt(e)})}function gY(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...rt(e)})}function vY(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...rt(e)})}function yY(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...rt(e)})}function _Y(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...rt(e)})}function wY(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...rt(e)})}function bY(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...rt(e)})}function xY(t,e){return new t({type:"string",format:"date",check:"string_format",...rt(e)})}function SY(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...rt(e)})}function kY(t,e){return new t({type:"string",format:"duration",check:"string_format",...rt(e)})}function EY(t,e){return new t(oN({type:"number",checks:[],...rt(e)}))}function CY(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...rt(e)})}function PY(t,e){return new t({type:"boolean",...rt(e)})}function TY(t){return new t({type:"unknown"})}function RY(t,e){return new t({type:"never",...rt(e)})}function _T(t,e){return new B5({check:"less_than",...rt(e),value:t,inclusive:!1})}function q2(t,e){return new B5({check:"less_than",...rt(e),value:t,inclusive:!0})}function wT(t,e){return new Z5({check:"greater_than",...rt(e),value:t,inclusive:!1})}function G2(t,e){return new Z5({check:"greater_than",...rt(e),value:t,inclusive:!0})}function bT(t,e){return new Sq({check:"multiple_of",...rt(e),value:t})}function aN(t,e){return new Eq({check:"max_length",...rt(e),maximum:t})}function zv(t,e){return new Cq({check:"min_length",...rt(e),minimum:t})}function lN(t,e){return new Pq({check:"length_equals",...rt(e),length:t})}function AY(t,e){return new Tq({check:"string_format",format:"regex",...rt(e),pattern:t})}function IY(t){return new Rq({check:"string_format",format:"lowercase",...rt(t)})}function OY(t){return new Aq({check:"string_format",format:"uppercase",...rt(t)})}function MY(t,e){return new Iq({check:"string_format",format:"includes",...rt(e),includes:t})}function NY(t,e){return new Oq({check:"string_format",format:"starts_with",...rt(e),prefix:t})}function LY(t,e){return new Mq({check:"string_format",format:"ends_with",...rt(e),suffix:t})}function Kf(t){return new Nq({check:"overwrite",tx:t})}function DY(t){return Kf(e=>e.normalize(t))}function $Y(){return Kf(t=>t.trim())}function FY(){return Kf(t=>t.toLowerCase())}function jY(){return Kf(t=>t.toUpperCase())}function zY(){return Kf(t=>iK(t))}function VY(t,e,n){return new t({type:"array",element:e,...rt(n)})}function HY(t,e,n){return new t({type:"custom",check:"custom",fn:e,...rt(n)})}function UY(t,e){const n=BY(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Zp(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(Zp(i))}},t(r.value,r)),e);return n}function BY(t,e){const n=new ii({check:"custom",...rt(e)});return n._zod.check=t,n}function Ep(t,...e){for(const n of e)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&nl(t,r,n[r]);return t}function cN(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??sp,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",intersections:[],deferred:[],external:(t==null?void 0:t.external)??void 0}}function oc(t,e,n,r,s){const i=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:r.path,message:s}):e.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function xr(t,e,n={path:[],schemaPath:[]}){var f,h;var r;const s=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;const l=(h=(f=t._zod).toJSONSchema)==null?void 0:h.call(f);if(l)o.schema=l;else{const m={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,m);else{const y=o.schema,_=e.processors[s.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);_(t,e,y,m)}const v=t._zod.parent;v&&(o.ref||(o.ref=v),xr(v,e,m),e.seen.get(v).isParent=!0)}const c=e.metadataRegistry.get(t);return c&&Ep(o.schema,c),e.io==="input"&&Ts(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function xT(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function uN(t,e){var o,l,c,d;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;const r=new Map;for(const f of t.seen.entries()){const h=(o=t.metadataRegistry.get(f[0]))==null?void 0:o.id;if(h){const m=r.get(h);if(m&&m!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,f[0])}}const s=f=>{var _;const h=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const b=(_=t.external.registry.get(f[0]))==null?void 0:_.id,x=t.external.uri??(C=>C);if(b)return{ref:x(b)};const k=f[1].defId??f[1].schema.id??`schema${t.counter++}`;return f[1].defId=k,{defId:k,ref:`${x("__shared")}#/${h}/${xT(k)}`}}const m="#",v=`${m}/${h}/`;if(f[1]===n&&!f[1].schema.id)return{ref:m};const y=f[1].schema.id??`__schema${t.counter++}`;return{defId:y,ref:v+xT(y)}},i=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:m,defId:v}=s(f);h.def={...h.schema},v&&(h.defId=v);const y=h.schema;for(const _ in y)delete y[_];y.$ref=m};if(t.cycles==="throw")for(const f of t.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${(l=h.cycle)==null?void 0:l.join("/")}/<root>
76
-
77
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of t.seen.entries()){const h=f[1];if(e===f[0]){i(f);continue}if(t.external){const v=(c=t.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&v){i(f);continue}}if((d=t.metadataRegistry.get(f[0]))==null?void 0:d.id){i(f);continue}if(h.cycle){i(f);continue}h.count>1&&t.reused==="ref"&&i(f)}t.external&&(t.sharedDefsExtractedFor=t.external)}function dN(t){const e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;const n=[];for(const r of e){if(!r||typeof r!="object")return;dN(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 t.anyOf,t.type=n.length===1?n[0]:n}const fN=new Set(["type","properties","required","additionalProperties"]),ST=["oneOf","anyOf"];function kT(t){const e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function Wb(t){var i;const e=[];for(const o of t){if(typeof o!="object"||o.type!=="object")return null;for(const l in o)if(!fN.has(l))return null;e.push(o)}const n={},r=new Set;for(const o of e){for(const l in o.properties){if(Object.prototype.hasOwnProperty.call(n,l))continue;const c=[];for(const f of e){const h=((i=f.properties)==null?void 0:i[l])??kT(f);h!=null&&(c.some(m=>JSON.stringify(m)===JSON.stringify(h))||c.push(h))}const d=c.length===1?c[0]:Wb(c)??{allOf:c};nl(n,l,d)}for(const l of o.required??[])r.add(l)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),e.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{const o=[];for(const l of e){const c=kT(l);c&&!o.some(d=>JSON.stringify(d)===JSON.stringify(c))&&o.push(c)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function ZY(t){const e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(const s of fN)if(s in t)return;const n=e.filter(s=>ST.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=Wb(e);else{const s=n[0],i=ST.find(c=>Array.isArray(s[c]));if(Object.keys(s).length!==1)return;const o=e.filter(c=>c!==s),l=s[i].map(c=>Wb([...o,c]));if(l.some(c=>!c))return;r={[i]:l}}r&&(delete t.allOf,Ep(t,r))}function hN(t,e){var l,c,d,f;const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=h=>{const m=t.seen.get(h);if(m.ref===null)return;const v=m.def??m.schema,y={...v},_=m.ref;if(m.ref=null,_){r(_);const x=t.seen.get(_),k=x.schema;if(k.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(k)):Ep(v,k),Ep(v,y),h._zod.parent===_)for(const P in v)P==="$ref"||P==="allOf"||P in y||delete v[P];if(k.$ref&&x.def)for(const P in v)P==="$ref"||P==="allOf"||P in x.def&&JSON.stringify(v[P])===JSON.stringify(x.def[P])&&delete v[P]}const b=h._zod.parent;if(b&&b!==_){r(b);const x=t.seen.get(b);if(x!=null&&x.schema.$ref&&(v.$ref=x.schema.$ref,x.def))for(const k in v)k==="$ref"||k==="allOf"||k in x.def&&JSON.stringify(v[k])===JSON.stringify(x.def[k])&&delete v[k]}t.override({zodSchema:h,jsonSchema:v,path:m.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(const h of[...t.seen.entries()].reverse())r(h[0]);if(t.target!=="openapi-3.0")for(const h of t.seen.entries())dN(h[1].def??h[1].schema);for(const h of t.deferred)h();if(t.intersections.length){const h=new Map;for(const m of t.seen.values())for(const v of[m.schema,m.def]){const y=v==null?void 0:v.allOf;if(!Array.isArray(y))continue;const _=h.get(y);_?_.push(v):h.set(y,[v])}for(const m of t.intersections)for(const v of h.get(m)??[])ZY(v)}}const s={};if(t.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":t.target,(l=t.external)!=null&&l.uri){const h=(c=t.external.registry.get(e))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");s.$id=t.external.uri(h)}Ep(s,n.defId?n.schema:n.def??n.schema);const i=(d=t.metadataRegistry.get(e))==null?void 0:d.id;i!==void 0&&s.id===i&&delete s.id;const o=((f=t.external)==null?void 0:f.defs)??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(const h of t.seen.entries()){const m=h[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,nl(o,m.defId,m.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const h=JSON.parse(JSON.stringify(s));return Object.defineProperty(h,"~standard",{value:{...e["~standard"],jsonSchema:{input:Vv(e,"input",t.processors),output:Vv(e,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Ts(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ts(r.element,n);if(r.type==="set")return Ts(r.valueType,n);if(r.type==="lazy")return Ts(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 Ts(r.innerType,n);if(r.type==="intersection")return Ts(r.left,n)||Ts(r.right,n);if(r.type==="record"||r.type==="map")return Ts(r.keyType,n)||Ts(r.valueType,n);if(r.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ts(r.in,n)||Ts(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Ts(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Ts(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Ts(s,n))return!0;return!!(r.rest&&Ts(r.rest,n))}return!1}const WY=(t,e={})=>n=>{const r=cN({...n,processors:e});return xr(t,r),uN(r,t),hN(r,t)},Vv=(t,e,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=cN({...s??{},target:i,io:e,processors:n});return xr(t,o),uN(o,t),hN(o,t)},Cf=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},Pf=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},ET=(t,e)=>{Cf(t,"minimum",e),Pf(t,"maximum",e)},pN=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},mN=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},gN=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},vN=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},CT=(t,e)=>Cf(t,"minimum",e.minimum),PT=(t,e)=>Pf(t,"maximum",e.maximum),TT=t=>(e,n)=>{vN(e,n.format);const[r,s]=t[n.format];Cf(e,"minimum",r),Pf(e,"maximum",s)},Y2={greater_than:(t,e)=>Cf(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>Pf(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>pN(t,e.value),number_format:TT(D5),bigint_format:TT(cK),min_length:CT,max_length:PT,length_equals:(t,e)=>ET(t,e.length),min_size:CT,max_size:PT,size_equals:(t,e)=>ET(t,e.size),string_format:(t,e)=>{vN(t,e.format),e.pattern&&mN(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>gN(t,e.mime)};function bo(t){var i;const e={},n=t._zod.def,r=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(const o of r)(i=Y2[o._zod.def.check])==null||i.call(Y2,e,o._zod.def);const s=t._zod.bag;s.minimum!==void 0&&Cf(e,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&Cf(e,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&Pf(e,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&Pf(e,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&pN(e,s.multipleOf),s.format!==void 0&&(e.format??(e.format=s.format),s.format.includes("int")&&(e.isInt=!0)),s.mime&&gN(e,s.mime);for(const o of s.patterns??[])mN(e,o);return e}const KY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qY=new Map([[Q5,uq],[Sk,dq]]),yN=t=>qY.get(t)??t,GY=(t,e,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:l,patterns:c,contentEncoding:d,laxFormat:f}=bo(t);if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),l&&(s.format=KY[l]??l,s.format===""&&delete s.format,(l==="time"||f)&&delete s.format),d&&(s.contentEncoding=d),c&&c.size>0){const h=[...c].map(yN);h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},YY=(t,e,n,r)=>{const s=n,{minimum:i,maximum:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d,isInt:f}=bo(t);s.type=f?"integer":"number";const h=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),v=e.target==="draft-04"||e.target==="openapi-3.0";if(h?v?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),m?v?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),l){const y=new Set;for(const x of l)Number.isFinite(x)&&x!==0?y.add(Math.abs(x)):oc(t,e,s,r,`A multipleOf divisor of ${x} cannot be represented in JSON Schema`);const[_,...b]=y;_!==void 0&&(s.multipleOf=_),b.length&&(s.allOf=[...s.allOf??[],...b.map(x=>({multipleOf:x}))])}},XY=(t,e,n,r)=>{n.type="boolean"},QY=(t,e,n,r)=>{n.not={}},JY=(t,e,n,r)=>{},eX=(t,e,n,r)=>{const s=t._zod.def,i=zb(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},tX=(t,e,n,r)=>{const s=t._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const o of s.values)if(o===void 0){if(oc(t,e,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o=="bigint"){if(oc(t,e,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,e.target==="draft-04"||e.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},nX=(t,e,n,r)=>{oc(t,e,n,r,"Custom types cannot be represented in JSON Schema")},rX=(t,e,n,r)=>{oc(t,e,n,r,"Transforms cannot be represented in JSON Schema")},sX=(t,e,n,r)=>{const s=n,i=t._zod.def,{minimum:o,maximum:l}=bo(t);typeof o=="number"&&(s.minItems=o),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=xr(i.element,e,{...r,path:[...r.path,"items"]})};function Hv(t){const e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?Hv(e.out):e.type==="catch"?Hv(e.innerType):t._zod.optin}const iX=(t,e,n,r)=>{var d;const s=n,i=t._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&oc(t,e,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const f in o)nl(s.properties,f,xr(o[f],e,{...r,path:[...r.path,"properties",f]}));const c=[];for(const f of Object.keys(o)){const h=i.shape[f];(e.io==="input"?Hv(h)===void 0:h._zod.optout===void 0)&&c.push(f)}c.length>0&&(s.required=c),((d=i.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=xr(i.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(s.additionalProperties=!1)},oX=(t,e,n,r)=>{const s=t._zod.def,i=s.inclusive===!1,o=s.options.map((l,c)=>xr(l,e,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},aX=(t,e,n,r)=>{const s=t._zod.def,i=xr(s.left,e,{...r,path:[...r.path,"allOf",0]}),o=xr(s.right,e,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(i)?i.allOf:[i],...l(o)?o.allOf:[o]];n.allOf=c,e.intersections.push(c)};function Kb(t,e,n){var y;if(e.$ref){if(n.has(e))return e;n.add(e);const _=(y=t.get(e))==null?void 0:y.def;if(!_)return e;const b=Kb(t,_,n);return b===_?e:b}for(const _ of["anyOf","oneOf"]){const b=e[_];if(!Array.isArray(b))continue;const x=b.map(k=>Kb(t,k,n));x.some((k,C)=>k!==b[C])&&(e={...e,[_]:x})}const r=Array.isArray(e.type)?e.type:[e.type],s=!r.includes("string")&&r.some(_=>_==="number"||_==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!s&&!(i!=null&&i.some(_=>typeof _=="number")))return e;const{minimum:o,maximum:l,exclusiveMinimum:c,exclusiveMaximum:d,multipleOf:f,format:h,id:m,...v}=e;return v.enum?v.enum=v.enum.map(_=>typeof _=="number"?String(_):_):typeof v.const=="number"&&(v.const=String(v.const)),s&&(v.type="string",i||(v.pattern=(r.includes("number")?wk:_q).source)),v}const qb=new WeakMap;function lX(t){var r;const e=new Map;for(const s of t.seen.values())s.def&&!e.has(s.schema)&&e.set(s.schema,s);const n=new Map;for(const s of qb.get(t)??[]){const i=t.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 l=Kb(e,o,new Set);l!==o&&n.set(o,l)}if(n.size)for(const s of t.seen.values())for(const i of[s.schema,s.def]){const o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}const cX=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object";const o=i.keyType,l=bo(o).patterns;if(i.mode==="loose"&&l&&l.size>0){const f=xr(i.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const h of l)nl(s.patternProperties,yN(h).source,f)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){s.propertyNames=xr(i.keyType,e,{...r,path:[...r.path,"propertyNames"]});let f=qb.get(e);f||(f=[],qb.set(e,f),e.deferred.push(()=>lX(e))),f.push(t)}s.additionalProperties=xr(i.valueType,e,{...r,path:[...r.path,"additionalProperties"]})}const c=o._zod.values,d=e.io==="input"&&Hv(i.valueType)!==void 0;if(c&&!i.partial&&!d){const f=[...c].filter(h=>typeof h=="string"||typeof h=="number");f.length>0&&(s.required=f.map(String))}},uX=(t,e,n,r)=>{const s=t._zod.def,i=xr(s.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},dX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},kk=Symbol();function _N(t,e,n,r,s){let i=!1;const o=JSON.stringify(t,(l,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(oc(e,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),kk):JSON.parse(o)}const fX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;const o=_N(s.defaultValue,t,e,n,r);o!==kk&&(n.default=o)},hX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);if(i.ref=s.innerType,e.io!=="input")return;const o=_N(s.defaultValue,t,e,n,r);o!==kk&&(n._prefault=o)},pX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{oc(t,e,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},mX=(t,e,n,r)=>{const s=t._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?i?s.out:s.in:s.out;xr(o,e,r);const l=e.seen.get(t);l.ref=o},gX=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.readOnly=!0},wN=(t,e,n,r)=>{const s=t._zod.def;xr(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},RT=new WeakSet([Object.prototype,Error.prototype]);function lg(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,e,{value:r,configurable:!0,writable:!0})}})}const vX=(t,e)=>{IK.init(t,e),t.name="ZodError";const n=Object.getPrototypeOf(t);RT.has(n)||(RT.add(n),lg(n,"format",r=>s=>NK(r,s)),lg(n,"flatten",r=>s=>MK(r,s)),lg(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,Vb,2)}),lg(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,Vb,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},eo=me("ZodError",vX,void 0,{Parent:Error}),yX=gk(eo),_X=vk(eo),wX=yk(eo),bX=_k(eo),xX=zK(eo),SX=VK(eo),kX=HK(eo),EX=UK(eo),CX=BK(eo),PX=ZK(eo),TX=WK(eo),RX=KK(eo);function AX(){So.localeError||aa(GG())}function j1(){So.memoizer||aa({memoizer:WG()})}const Qn=me("ZodType",(t,e)=>(AX(),Xn.init(t,e),t.def=e,t.type=e.type,t),{check(...t){const e=this.def;return this.clone(wi(e,{checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return _c(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(PQ(t,e))},superRefine(t,e){return this.check(TQ(t,e))},overwrite(t){return this.check(Kf(t))},optional(){return OT(this)},exactOptional(){return pQ(this)},nullable(){return MT(this)},nullish(){return OT(MT(this))},nonoptional(t){return wQ(this,t)},array(){return Rt(this)},or(t){return Am([this,t])},and(t){return uQ(this,t)},transform(t){return NT(this,hQ(t))},default(t){return vQ(this,t)},prefault(t){return _Q(this,t)},catch(t){return xQ(this,t)},pipe(t){return NT(this,t)},readonly(){return EQ(this)},describe(t){const e=this.clone();return sp.add(e,{description:t}),e},meta(...t){if(t.length===0)return sp.get(this);const e=this.clone();return sp.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return F5(this,"~standard",{...K5(this),jsonSchema:{input:Vv(this,"input"),output:Vv(this,"output")}})},set"~standard"(t){ic(this,"~standard",t)},parse:function t(e,n){return yX(this,e,n,{callee:t})},parseAsync:async function t(e,n){return await _X(this,e,n,{callee:t})},safeParse(t,e){return wX(this,t,e)},async safeParseAsync(t,e){return bX(this,t,e)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(t){ic(this,"spa",t)},validate(t,e){return $K(this,t,e)},validateAsync(t,e){return jK(this,t,e)},encode:function t(e,n){return xX(this,e,n,{callee:t})},decode:function t(e,n){return SX(this,e,n,{callee:t})},encodeAsync:async function t(e,n){return await kX(this,e,n,{callee:t})},decodeAsync:async function t(e,n){return await EX(this,e,n,{callee:t})},safeEncode(t,e){return CX(this,t,e)},safeDecode(t,e){return PX(this,t,e)},async safeEncodeAsync(t,e){return TX(this,t,e)},async safeDecodeAsync(t,e){return RX(this,t,e)},toJSONSchema(t){return WY(this,{})(t)},get description(){var t;return(t=sp.get(this))==null?void 0:t.description},get _def(){return this._zod.def}}),bN=me("_ZodString",(t,e)=>{xk.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>GY(t,n,r)},j5({format:t=>bo(t).format??null,minLength:t=>bo(t).minimum??null,maxLength:t=>bo(t).maximum??null},{regex(...t){return this.check(AY(...t))},includes(...t){return this.check(MY(...t))},startsWith(...t){return this.check(NY(...t))},endsWith(...t){return this.check(LY(...t))},min(...t){return this.check(zv(...t))},max(...t){return this.check(aN(...t))},length(...t){return this.check(lN(...t))},nonempty(...t){return this.check(zv(1,...t))},lowercase(t){return this.check(IY(t))},uppercase(t){return this.check(OY(t))},trim(){return this.check($Y())},normalize(...t){return this.check(DY(...t))},toLowerCase(){return this.check(FY())},toUpperCase(){return this.check(jY())},slugify(){return this.check(zY())}})),IX=me("ZodString",(t,e)=>{xk.init(t,e),bN.init(t,e)},{email(t){return this.check(JG(DX,t))},url(t){return this.check(iY(FX,t))},jwt(t){return this.check(wY(JX,t))},emoji(t){return this.check(oY(jX,t))},guid(t){return this.check(eY($X,t))},uuid(t){return this.check(tY(cg,t))},uuidv4(t){return this.check(nY(cg,t))},uuidv6(t){return this.check(rY(cg,t))},uuidv7(t){return this.check(sY(cg,t))},nanoid(t){return this.check(aY(zX,t))},cuid(t){return this.check(lY(VX,t))},cuid2(t){return this.check(cY(HX,t))},ulid(t){return this.check(uY(UX,t))},base64(t){return this.check(vY(YX,t))},base64url(t){return this.check(yY(XX,t))},xid(t){return this.check(dY(BX,t))},ksuid(t){return this.check(fY(ZX,t))},ipv4(t){return this.check(hY(WX,t))},ipv6(t){return this.check(pY(KX,t))},cidrv4(t){return this.check(mY(qX,t))},cidrv6(t){return this.check(gY(GX,t))},e164(t){return this.check(_Y(QX,t))},datetime(t){return this.check(bY(OX,t))},date(t){return this.check(xY(MX,t))},time(t){return this.check(SY(NX,t))},duration(t){return this.check(kY(LX,t))}});function re(t){return QG(IX,t)}const Jn=me("ZodStringFormat",(t,e)=>{Un.init(t,e),bN.init(t,e)}),OX=me("ZodISODateTime",(t,e)=>{eG.init(t,e),Jn.init(t,e)}),MX=me("ZodISODate",(t,e)=>{tG.init(t,e),Jn.init(t,e)}),NX=me("ZodISOTime",(t,e)=>{nG.init(t,e),Jn.init(t,e)}),LX=me("ZodISODuration",(t,e)=>{rG.init(t,e),Jn.init(t,e)}),DX=me("ZodEmail",(t,e)=>{zq.init(t,e),Jn.init(t,e)}),$X=me("ZodGUID",(t,e)=>{Fq.init(t,e),Jn.init(t,e)}),cg=me("ZodUUID",(t,e)=>{jq.init(t,e),Jn.init(t,e)}),FX=me("ZodURL",(t,e)=>{Wq.init(t,e),Jn.init(t,e)}),jX=me("ZodEmoji",(t,e)=>{Kq.init(t,e),Jn.init(t,e)}),zX=me("ZodNanoID",(t,e)=>{qq.init(t,e),Jn.init(t,e)}),VX=me("ZodCUID",(t,e)=>{Gq.init(t,e),Jn.init(t,e)}),HX=me("ZodCUID2",(t,e)=>{Yq.init(t,e),Jn.init(t,e)}),UX=me("ZodULID",(t,e)=>{Xq.init(t,e),Jn.init(t,e)}),BX=me("ZodXID",(t,e)=>{Qq.init(t,e),Jn.init(t,e)}),ZX=me("ZodKSUID",(t,e)=>{Jq.init(t,e),Jn.init(t,e)}),WX=me("ZodIPv4",(t,e)=>{sG.init(t,e),Jn.init(t,e)}),KX=me("ZodIPv6",(t,e)=>{oG.init(t,e),Jn.init(t,e)}),qX=me("ZodCIDRv4",(t,e)=>{aG.init(t,e),Jn.init(t,e)}),GX=me("ZodCIDRv6",(t,e)=>{cG.init(t,e),Jn.init(t,e)}),YX=me("ZodBase64",(t,e)=>{uG.init(t,e),Jn.init(t,e)}),XX=me("ZodBase64URL",(t,e)=>{fG.init(t,e),Jn.init(t,e)}),QX=me("ZodE164",(t,e)=>{hG.init(t,e),Jn.init(t,e)}),JX=me("ZodJWT",(t,e)=>{mG.init(t,e),Jn.init(t,e)}),xN=me("ZodNumber",(t,e)=>{J5.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>YY(t,n,r,s),t.isFinite=!0},j5({minValue:t=>{const{minimum:e,exclusiveMinimum:n}=bo(t);return Math.max(e??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:t=>{const{maximum:e,exclusiveMaximum:n}=bo(t);return Math.min(e??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:t=>{const{isInt:e,multipleOf:n}=bo(t);return!!e||!!(n!=null&&n.some(Number.isSafeInteger))},format:t=>bo(t).format??null},{gt(t,e){return this.check(wT(t,e))},gte(t,e){return this.check(G2(t,e))},min(t,e){return this.check(G2(t,e))},lt(t,e){return this.check(_T(t,e))},lte(t,e){return this.check(q2(t,e))},max(t,e){return this.check(q2(t,e))},int(t){return this.check(AT(t))},safe(t){return this.check(AT(t))},positive(t){return this.check(wT(0,t))},nonnegative(t){return this.check(G2(0,t))},negative(t){return this.check(_T(0,t))},nonpositive(t){return this.check(q2(0,t))},multipleOf(t,e){return this.check(bT(t,e))},step(t,e){return this.check(bT(t,e))},finite(){return this}}));function Dn(t){return EY(xN,t)}const eQ=me("ZodNumberFormat",(t,e)=>{gG.init(t,e),xN.init(t,e)});function AT(t){return CY(eQ,t)}const tQ=me("ZodBoolean",(t,e)=>{vG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>XY(t,n,r)});function Xs(t){return PY(tQ,t)}const nQ=me("ZodUnknown",(t,e)=>{yG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>JY()});function Gb(){return TY(nQ)}const rQ=me("ZodNever",(t,e)=>{_G.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>QY(t,n,r)});function sQ(t){return RY(rQ,t)}const iQ=me("ZodArray",(t,e)=>{j1(),xG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>sX(t,n,r,s),t.element=e.element},{min(t,e){return this.check(zv(t,e))},nonempty(t){return this.check(zv(1,t))},max(t,e){return this.check(aN(t,e))},length(t,e){return this.check(lN(t,e))},unwrap(){return this.element}});function Rt(t,e){return VY(iQ,t,e)}const oQ=me("ZodObject",(t,e)=>{j1(),EG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>iX(t,n,r,s),SK(t,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Vt(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(wi(this._zod.def,{catchall:t}))},passthrough(){return this.clone(wi(this._zod.def,{catchall:Gb()}))},loose(){return this.clone(wi(this._zod.def,{catchall:Gb()}))},strict(){return this.clone(wi(this._zod.def,{catchall:sQ()}))},strip(){return this.clone(wi(this._zod.def,{catchall:void 0}))},extend(t){return fK(this,t)},safeExtend(t){return hK(this,t)},merge(t){return pK(this,t)},pick(t){return uK(this,t)},omit(t){return dK(this,t)},partial(...t){return tT(kN,this,t[0])},exactPartial(...t){return tT(EN,this,t[0],"exactPartial")},required(...t){return mK(CN,this,t[0])}});function ze(t,e){const n={type:"object",shape:t??{},...rt(e)};return new oQ(n)}const SN=me("ZodUnion",(t,e)=>{nN.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>oX(t,n,r,s),t.options=e.options});function Am(t,e){return new SN({type:"union",options:t,...rt(e)})}const aQ=me("ZodDiscriminatedUnion",(t,e)=>{SN.init(t,e),PG.init(t,e)});function lQ(t,e,n){return new aQ({type:"union",options:e,discriminator:t,...rt(n)})}const cQ=me("ZodIntersection",(t,e)=>{TG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>aX(t,n,r,s)});function uQ(t,e){return new cQ({type:"intersection",left:t,right:e})}const IT=me("ZodRecord",(t,e)=>{j1(),RG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>cX(t,n,r,s),t.keyType=e.keyType,t.valueType=e.valueType});function Ek(t,e,n){return!e||!e._zod?new IT({type:"record",keyType:re(),valueType:t,...rt(e)}):new IT({type:"record",keyType:t,valueType:e,...rt(n)})}const Yb=me("ZodEnum",(t,e)=>{AG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(r,s,i)=>eX(t,r,s),t.enum=e.entries,t.options=[...t._zod.values];const n=new Set(Object.keys(e.entries));t.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Yb({...e,checks:[],...rt(s),entries:i})},t.exclude=(r,s)=>{const i={...e.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 Yb({...e,checks:[],...rt(s),entries:i})}});function Vt(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Yb({type:"enum",entries:n,...rt(e)})}const dQ=me("ZodLiteral",(t,e)=>{IG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>tX(t,n,r,s),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Tf(t,e){return new dQ({type:"literal",values:Array.isArray(t)?t:[t],...rt(e)})}const fQ=me("ZodTransform",(t,e)=>{j1(),OG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>rX(t,n,r,s),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new V5(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Zp(i,n.value,e));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=t),n.issues.push(Zp(o))}};const s=e.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function hQ(t){return new fQ({type:"transform",transform:t})}const kN=me("ZodOptional",(t,e)=>{rN.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>wN(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function OT(t){return new kN({type:"optional",innerType:t})}const EN=me("ZodExactOptional",(t,e)=>{MG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>wN(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function pQ(t){return new EN({type:"optional",innerType:t})}const mQ=me("ZodNullable",(t,e)=>{NG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>uX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function MT(t){return new mQ({type:"nullable",innerType:t})}const gQ=me("ZodDefault",(t,e)=>{LG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>fX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function vQ(t,e){return new gQ({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():N5(e)}})}const yQ=me("ZodPrefault",(t,e)=>{DG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>hX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function _Q(t,e){return new yQ({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():N5(e)}})}const CN=me("ZodNonOptional",(t,e)=>{$G.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>dX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function wQ(t,e){return new CN({type:"nonoptional",innerType:t,...rt(e)})}const bQ=me("ZodCatch",(t,e)=>{FG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>pX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function xQ(t,e){return new bQ({type:"catch",innerType:t,catchValue:typeof e=="function"?e:EK(e)})}const SQ=me("ZodPipe",(t,e)=>{jG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>mX(t,n,r,s),t.in=e.in,t.out=e.out});function NT(t,e){return new SQ({type:"pipe",in:t,out:e})}const kQ=me("ZodReadonly",(t,e)=>{zG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>gX(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function EQ(t){return new kQ({type:"readonly",innerType:t})}const CQ=me("ZodCustom",(t,e)=>{VG.init(t,e),Qn.init(t,e),t._zod.processJSONSchema=(n,r,s)=>nX(t,n,r,s)});function PQ(t,e={}){return HY(CQ,t,e)}function TQ(t,e){return UY(t,e)}const PN={custom:"custom"},Ys=(t,e=String(t))=>t instanceof Error?t.message:e,RQ=["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"],TN=["ENOENT","EACCES","EPERM","EEXIST","ENOTDIR","EISDIR","ELOOP","ENOSPC","EMFILE","EADDRINUSE","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EBUSY","ENOTSUP","EINVAL","ENOTEMPTY","EROFS","EAI_AGAIN"],AQ=["timeout","aborted","unknown"],RN=[...RQ,...TN,...AQ];new Set(RN);new Set(TN);const mi=Dn().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),IQ=ze({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(RN).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:mi.int().optional(),verification_duration_ms:mi.optional(),ok:Xs().optional(),is_recoverable:Xs().optional(),is_fresh:Xs().optional(),duration_ms:mi.optional(),dwell_ms_from_terminal:mi.optional(),exit_code:mi.optional(),requested_count:mi.optional(),accepted_count:mi.optional(),work_item_count:mi.optional(),completed_count:mi.optional(),failed_count:mi.optional(),cancelled_count:mi.optional(),reference_count:mi.optional(),changed_files_count:mi.optional()}),OQ=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"]),MQ=(t,e)=>{if(!OQ.has(t))return null;const n={};for(const[r,s]of Object.entries(IQ.shape)){const i=s.safeParse(e[r]);i.success&&i.data!==void 0&&(n[r]=i.data)}return n};var en;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(en||(en={}));var LT;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(LT||(LT={}));const Ye=en.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ol=t=>{switch(typeof t){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(t)?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(t)?Ye.array:t===null?Ye.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ye.promise:typeof Map<"u"&&t instanceof Map?Ye.map:typeof Set<"u"&&t instanceof Set?Ye.set:typeof Date<"u"&&t instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Re=en.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 Ya extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const d=o.path[c],f=c===o.path.length-1;if(d==="_errors"){f&&l._errors.push(n(o)),c++;continue}Object.prototype.hasOwnProperty.call(l,d)||(d==="__proto__"?Object.defineProperty(l,d,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):l[d]={_errors:[]}),l=l[d],f&&l._errors.push(n(o)),c++}}};return s(this),r}static assert(e){if(!(e instanceof Ya))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,en.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=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(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ya.create=t=>new Ya(t);const Xb=(t,e)=>{let n;switch(t.code){case Re.invalid_type:t.received===Ye.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,en.jsonStringifyReplacer)}`;break;case Re.unrecognized_keys:n=`Unrecognized key(s) in object: ${en.joinValues(t.keys,", ")}`;break;case Re.invalid_union:n="Invalid input";break;case Re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${en.joinValues(t.options)}`;break;case Re.invalid_enum_value:n=`Invalid enum value. Expected ${en.joinValues(t.options)}, received '${t.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 t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:en.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Re.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Re.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case 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 ${t.multipleOf}`;break;case Re.not_finite:n="Number must be finite";break;default:n=e.defaultError,en.assertNever(t)}return{message:n}};let NQ=Xb;function LQ(){return NQ}const DQ=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const c=r.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function je(t,e){const n=LQ(),r=DQ({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Xb?void 0:Xb].filter(s=>!!s)});t.common.issues.push(r)}class Ti{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return wt;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Ti.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return wt;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const wt=Object.freeze({status:"aborted"}),ip=t=>({status:"dirty",value:t}),to=t=>({status:"valid",value:t}),DT=t=>t.status==="aborted",$T=t=>t.status==="dirty",Rf=t=>t.status==="valid",Uv=t=>typeof Promise<"u"&&t instanceof Promise;var tt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(tt||(tt={}));class ac{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const FT=(t,e)=>{if(Rf(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ya(t.common.issues);return this._error=n,this._error}}};function Mt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class Xt{get description(){return this._def.description}_getType(e){return Ol(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ol(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ti,ctx:{common:e.parent.common,data:e.data,parsedType:Ol(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Uv(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ol(e)},s=this._parseSync({data:e,path:r.path,parent:r});return FT(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ol(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return Rf(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Rf(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ol(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Uv(s)?s:Promise.resolve(s));return FT(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),l=()=>i.addIssue({code:Re.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new If({schema:this,typeName:bt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ec.create(this,this._def)}nullable(){return Of.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Kv.create(this,this._def)}or(e){return Zv.create([this,e],this._def)}and(e){return Wv.create(this,e,this._def)}transform(e){return new If({...Mt(this._def),schema:this,typeName:bt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Jb({...Mt(this._def),innerType:this,defaultValue:n,typeName:bt.ZodDefault})}brand(){return new iJ({typeName:bt.ZodBranded,type:this,...Mt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ex({...Mt(this._def),innerType:this,catchValue:n,typeName:bt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ck.create(this,e)}readonly(){return tx.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $Q=/^c[^\s-]{8,}$/i,FQ=/^[0-9a-z]+$/,jQ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zQ=/^[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,VQ=/^[a-z0-9_-]{21}$/i,HQ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,UQ=/^[-+]?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)?)??$/,BQ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZQ="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";let X2;const WQ=/^(?:(?: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])$/,KQ=/^(?:(?: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])$/,qQ=/^(([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]))$/,GQ=/^(([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])$/,YQ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,XQ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,AN="((\\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])))",QQ=new RegExp(`^${AN}$`);function IN(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function JQ(t){return new RegExp(`^${IN(t)}$`)}function eJ(t){let e=`${AN}T${IN(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function tJ(t,e){return!!((e==="v4"||!e)&&WQ.test(t)||(e==="v6"||!e)&&qQ.test(t))}function nJ(t,e){if(!HQ.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function rJ(t,e){return!!((e==="v4"||!e)&&KQ.test(t)||(e==="v6"||!e)&&GQ.test(t))}class Wl extends Xt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ye.string){const i=this._getOrReturnCtx(e);return je(i,{code:Re.invalid_type,expected:Ye.string,received:i.parsedType}),wt}const r=new Ti;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,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")e.data.length>i.value&&(s=this._getOrReturnCtx(e,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=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?je(s,{code:Re.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&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")BQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"email",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")X2||(X2=new RegExp(ZQ,"u")),X2.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"emoji",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")zQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"uuid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")VQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"nanoid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")$Q.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cuid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")FQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cuid2",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")jQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"ulid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,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(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"regex",code:Re.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),je(s,{code:Re.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),je(s,{code:Re.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),je(s,{code:Re.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?eJ(i).test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Re.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?QQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Re.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?JQ(i).test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{code:Re.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?UQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"duration",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?tJ(e.data,i.version)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"ip",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?nJ(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"jwt",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?rJ(e.data,i.version)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"cidr",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?YQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"base64",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?XQ.test(e.data)||(s=this._getOrReturnCtx(e,s),je(s,{validation:"base64url",code:Re.invalid_string,message:i.message}),r.dirty()):en.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:Re.invalid_string,...tt.errToObj(r)})}_addCheck(e){return new Wl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...tt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...tt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...tt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...tt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...tt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...tt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...tt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...tt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...tt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...tt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...tt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...tt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...tt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...tt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...tt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...tt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...tt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...tt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...tt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...tt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...tt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...tt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...tt.errToObj(n)})}nonempty(e){return this.min(1,tt.errToObj(e))}trim(){return new Wl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Wl.create=t=>new Wl({checks:[],typeName:bt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});function sJ(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class Wp extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ye.number){const i=this._getOrReturnCtx(e);return je(i,{code:Re.invalid_type,expected:Ye.number,received:i.parsedType}),wt}let r;const s=new Ti;for(const i of this._def.checks)i.kind==="int"?en.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),je(r,{code:Re.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),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?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,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"?sJ(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),je(r,{code:Re.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),je(r,{code:Re.not_finite,message:i.message}),s.dirty()):en.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,tt.toString(n))}setLimit(e,n,r,s){return new Wp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(e){return new Wp({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:tt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:tt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:tt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&en.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Wp.create=t=>new Wp({checks:[],typeName:bt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class Kp extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ye.bigint)return this._getInvalidInput(e);let r;const s=new Ti;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Re.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Re.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),je(r,{code:Re.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):en.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return je(n,{code:Re.invalid_type,expected:Ye.bigint,received:n.parsedType}),wt}gte(e,n){return this.setLimit("min",e,!0,tt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,tt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,tt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,tt.toString(n))}setLimit(e,n,r,s){return new Kp({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(e){return new Kp({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:tt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Kp.create=t=>new Kp({checks:[],typeName:bt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});class jT extends Xt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ye.boolean){const r=this._getOrReturnCtx(e);return je(r,{code:Re.invalid_type,expected:Ye.boolean,received:r.parsedType}),wt}return to(e.data)}}jT.create=t=>new jT({typeName:bt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class Bv extends Xt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ye.date){const i=this._getOrReturnCtx(e);return je(i,{code:Re.invalid_type,expected:Ye.date,received:i.parsedType}),wt}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return je(i,{code:Re.invalid_date}),wt}const r=new Ti;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Re.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),je(s,{code:Re.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):en.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Bv({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:tt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:tt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Bv.create=t=>new Bv({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:bt.ZodDate,...Mt(t)});class zT extends Xt{_parse(e){if(this._getType(e)!==Ye.symbol){const r=this._getOrReturnCtx(e);return je(r,{code:Re.invalid_type,expected:Ye.symbol,received:r.parsedType}),wt}return to(e.data)}}zT.create=t=>new zT({typeName:bt.ZodSymbol,...Mt(t)});class VT extends Xt{_parse(e){if(this._getType(e)!==Ye.undefined){const r=this._getOrReturnCtx(e);return je(r,{code:Re.invalid_type,expected:Ye.undefined,received:r.parsedType}),wt}return to(e.data)}}VT.create=t=>new VT({typeName:bt.ZodUndefined,...Mt(t)});class HT extends Xt{_parse(e){if(this._getType(e)!==Ye.null){const r=this._getOrReturnCtx(e);return je(r,{code:Re.invalid_type,expected:Ye.null,received:r.parsedType}),wt}return to(e.data)}}HT.create=t=>new HT({typeName:bt.ZodNull,...Mt(t)});class UT extends Xt{constructor(){super(...arguments),this._any=!0}_parse(e){return to(e.data)}}UT.create=t=>new UT({typeName:bt.ZodAny,...Mt(t)});class BT extends Xt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return to(e.data)}}BT.create=t=>new BT({typeName:bt.ZodUnknown,...Mt(t)});class lc extends Xt{_parse(e){const n=this._getOrReturnCtx(e);return je(n,{code:Re.invalid_type,expected:Ye.never,received:n.parsedType}),wt}}lc.create=t=>new lc({typeName:bt.ZodNever,...Mt(t)});class ZT extends Xt{_parse(e){if(this._getType(e)!==Ye.undefined){const r=this._getOrReturnCtx(e);return je(r,{code:Re.invalid_type,expected:Ye.void,received:r.parsedType}),wt}return to(e.data)}}ZT.create=t=>new ZT({typeName:bt.ZodVoid,...Mt(t)});class na extends Xt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Ye.array)return je(n,{code:Re.invalid_type,expected:Ye.array,received:n.parsedType}),wt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(je(n,{code:o?Re.too_big:Re.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(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,l)=>s.type._parseAsync(new ac(n,o,n.path,l)))).then(o=>Ti.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new ac(n,o,n.path,l)));return Ti.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new na({...this._def,minLength:{value:e,message:tt.toString(n)}})}max(e,n){return new na({...this._def,maxLength:{value:e,message:tt.toString(n)}})}length(e,n){return new na({...this._def,exactLength:{value:e,message:tt.toString(n)}})}nonempty(e){return this.min(1,e)}}na.create=(t,e)=>new na({type:t,minLength:null,maxLength:null,exactLength:null,typeName:bt.ZodArray,...Mt(e)});function Md(t){if(t instanceof yr){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ec.create(Md(r))}return new yr({...t._def,shape:()=>e})}else return t instanceof na?new na({...t._def,type:Md(t.element)}):t instanceof ec?ec.create(Md(t.unwrap())):t instanceof Of?Of.create(Md(t.unwrap())):t instanceof Lu?Lu.create(t.items.map(e=>Md(e))):t}class yr extends Xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=en.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ye.object){const d=this._getOrReturnCtx(e);return je(d,{code:Re.invalid_type,expected:Ye.object,received:d.parsedType}),wt}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof lc&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const c=[];for(const d of o){const f=i[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new ac(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof lc){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(je(s,{code:Re.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const h=s.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new ac(s,h,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of c){const h=await f.key,m=await f.value;d.push({key:h,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>Ti.mergeObjectSync(r,d)):Ti.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return tt.errToObj,new yr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:tt.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new yr({...this._def,unknownKeys:"strip"})}passthrough(){return new yr({...this._def,unknownKeys:"passthrough"})}extend(e){return new yr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new yr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:bt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new yr({...this._def,catchall:e})}pick(e){const n={};for(const r of en.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new yr({...this._def,shape:()=>n})}omit(e){const n={};for(const r of en.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new yr({...this._def,shape:()=>n})}deepPartial(){return Md(this)}partial(e){const n={};for(const r of en.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new yr({...this._def,shape:()=>n})}required(e){const n={};for(const r of en.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ec;)i=i._def.innerType;n[r]=i}return new yr({...this._def,shape:()=>n})}keyof(){return ON(en.objectKeys(this.shape))}}yr.create=(t,e)=>new yr({shape:()=>t,unknownKeys:"strip",catchall:lc.create(),typeName:bt.ZodObject,...Mt(e)});yr.strictCreate=(t,e)=>new yr({shape:()=>t,unknownKeys:"strict",catchall:lc.create(),typeName:bt.ZodObject,...Mt(e)});yr.lazycreate=(t,e)=>new yr({shape:t,unknownKeys:"strip",catchall:lc.create(),typeName:bt.ZodObject,...Mt(e)});class Zv extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Ya(l.ctx.common.issues));return je(n,{code:Re.invalid_union,unionErrors:o}),wt}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 c of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=c._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Ya(c));return je(n,{code:Re.invalid_union,unionErrors:l}),wt}}get options(){return this._def.options}}Zv.create=(t,e)=>new Zv({options:t,typeName:bt.ZodUnion,...Mt(e)});function Qb(t,e){const n=Ol(t),r=Ol(e);if(t===e)return{valid:!0,data:t};if(n===Ye.object&&r===Ye.object){const s=en.objectKeys(e),i=en.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const l of i){if(l==="__proto__")continue;const c=Qb(t[l],e[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Ye.array&&r===Ye.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],c=Qb(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Ye.date&&r===Ye.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Wv extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(DT(i)||DT(o))return wt;const l=Qb(i.value,o.value);return l.valid?(($T(i)||$T(o))&&n.dirty(),{status:n.value,value:l.data}):(je(r,{code:Re.invalid_intersection_types}),wt)};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}))}}Wv.create=(t,e,n)=>new Wv({left:t,right:e,typeName:bt.ZodIntersection,...Mt(n)});class Lu extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ye.array)return je(r,{code:Re.invalid_type,expected:Ye.array,received:r.parsedType}),wt;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"}),wt;!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,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new ac(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Ti.mergeArray(n,o)):Ti.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Lu({...this._def,rest:e})}}Lu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lu({items:t,typeName:bt.ZodTuple,rest:null,...Mt(e)})};class WT extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ye.map)return je(r,{code:Re.invalid_type,expected:Ye.map,received:r.parsedType}),wt;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],d)=>({key:s._parse(new ac(r,l,r.path,[d,"key"])),value:i._parse(new ac(r,c,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const d=await c.key,f=await c.value;if(d.status==="aborted"||f.status==="aborted")return wt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const d=c.key,f=c.value;if(d.status==="aborted"||f.status==="aborted")return wt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}WT.create=(t,e,n)=>new WT({valueType:e,keyType:t,typeName:bt.ZodMap,...Mt(n)});class qp extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ye.set)return je(r,{code:Re.invalid_type,expected:Ye.set,received:r.parsedType}),wt;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(c){const d=new Set;for(const f of c){if(f.status==="aborted")return wt;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((c,d)=>i._parse(new ac(r,c,r.path,d)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(e,n){return new qp({...this._def,minSize:{value:e,message:tt.toString(n)}})}max(e,n){return new qp({...this._def,maxSize:{value:e,message:tt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}qp.create=(t,e)=>new qp({valueType:t,minSize:null,maxSize:null,typeName:bt.ZodSet,...Mt(e)});class KT extends Xt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}KT.create=(t,e)=>new KT({getter:t,typeName:bt.ZodLazy,...Mt(e)});class qT extends Xt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return je(n,{received:n.data,code:Re.invalid_literal,expected:this._def.value}),wt}return{status:"valid",value:e.data}}get value(){return this._def.value}}qT.create=(t,e)=>new qT({value:t,typeName:bt.ZodLiteral,...Mt(e)});function ON(t,e){return new Af({values:t,typeName:bt.ZodEnum,...Mt(e)})}class Af extends Xt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return je(n,{expected:en.joinValues(r),received:n.parsedType,code:Re.invalid_type}),wt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return je(n,{received:n.data,code:Re.invalid_enum_value,options:r}),wt}return to(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Af.create(e,{...this._def,...n})}exclude(e,n=this._def){return Af.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Af.create=ON;class GT extends Xt{_parse(e){const n=en.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ye.string&&r.parsedType!==Ye.number){const s=en.objectValues(n);return je(r,{expected:en.joinValues(s),received:r.parsedType,code:Re.invalid_type}),wt}if(this._cache||(this._cache=new Set(en.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=en.objectValues(n);return je(r,{received:r.data,code:Re.invalid_enum_value,options:s}),wt}return to(e.data)}get enum(){return this._def.values}}GT.create=(t,e)=>new GT({values:t,typeName:bt.ZodNativeEnum,...Mt(e)});class Kv extends Xt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ye.promise&&n.common.async===!1)return je(n,{code:Re.invalid_type,expected:Ye.promise,received:n.parsedType}),wt;const r=n.parsedType===Ye.promise?n.data:Promise.resolve(n.data);return to(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Kv.create=(t,e)=>new Kv({type:t,typeName:bt.ZodPromise,...Mt(e)});class If extends Xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===bt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{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 l=>{if(n.value==="aborted")return wt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?wt:c.status==="dirty"||n.value==="dirty"?ip(c.value):c});{if(n.value==="aborted")return wt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?wt:l.status==="dirty"||n.value==="dirty"?ip(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?wt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?wt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Rf(o))return wt;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Rf(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):wt);en.assertNever(s)}}If.create=(t,e,n)=>new If({schema:t,typeName:bt.ZodEffects,effect:e,...Mt(n)});If.createWithPreprocess=(t,e,n)=>new If({schema:e,effect:{type:"preprocess",transform:t},typeName:bt.ZodEffects,...Mt(n)});class ec extends Xt{_parse(e){return this._getType(e)===Ye.undefined?to(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ec.create=(t,e)=>new ec({innerType:t,typeName:bt.ZodOptional,...Mt(e)});class Of extends Xt{_parse(e){return this._getType(e)===Ye.null?to(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Of.create=(t,e)=>new Of({innerType:t,typeName:bt.ZodNullable,...Mt(e)});class Jb extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e);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}}Jb.create=(t,e)=>new Jb({innerType:t,typeName:bt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Mt(e)});class ex extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Uv(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ya(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ya(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ex.create=(t,e)=>new ex({innerType:t,typeName:bt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Mt(e)});class YT extends Xt{_parse(e){if(this._getType(e)!==Ye.nan){const r=this._getOrReturnCtx(e);return je(r,{code:Re.invalid_type,expected:Ye.nan,received:r.parsedType}),wt}return{status:"valid",value:e.data}}}YT.create=t=>new YT({typeName:bt.ZodNaN,...Mt(t)});class iJ extends Xt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ck extends Xt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?wt:i.status==="dirty"?(n.dirty(),ip(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"?wt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new Ck({in:e,out:n,typeName:bt.ZodPipeline})}}class tx extends Xt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Rf(s)&&(s.value=Object.freeze(s.value)),s);return Uv(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}tx.create=(t,e)=>new tx({innerType:t,typeName:bt.ZodReadonly,...Mt(e)});var bt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(bt||(bt={}));const Vd=Wl.create;lc.create;const oJ=na.create,MN=yr.create;Zv.create;Wv.create;Lu.create;const aJ=Af.create;Kv.create;ec.create;Of.create;const lJ=MN({hash:Vd().regex(/^[a-f0-9]{64}$/),mimeType:aJ(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),NN=MN({id:Vd().min(1),title:Vd().trim().min(1),url:Vd().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Vd().optional(),image:lJ.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),cJ=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=NN.safeParse(s);if(!i.success)continue;const o=i.data,l=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||l&&r.has(l)){const c=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));c&&!c.image&&o.image&&(c.id===o.id||!n.has(o.id))&&(c.id=o.id,c.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},uJ=6,Gp=100,XT=100,dJ=35*1024*1024,QT=Math.ceil(dJ/3)*4,fJ=Vt(["pinterest","arena","x","cosmos"]),Pk=Vt(["image",...fJ.options,"text","pdf","variant"]),Im=Vt(["codex","claude","cursor"]),LN=ze({projectId:re().min(1).max(200),sessionId:re().min(1).max(200),variantId:re().min(1).max(200)}).strict();LN.extend({runtime:Im,note:re().trim().max(500).optional(),imageFile:re().min(1).max(2048).optional()});const DN=LN.extend({treeSha:re().max(100).optional()}),hJ=ze({hash:re().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"]),bytes:Dn().int().positive(),representation:Vt(["image","video-cover","page","variant"]).default("image"),page:Dn().int().positive().optional()});ze({provider:Pk,remoteId:re().trim().min(1).max(2048),title:re().trim().min(1).max(500),url:re().url().optional()});const $N=ze({provider:Pk,remoteId:re().trim().min(1).max(2048),title:re().max(1e3),text:re().max(1e5),url:re().url().optional(),media:Rt(hJ).max(100),remoteImages:Rt(re().url()).max(100).optional(),remoteImageRepresentations:Rt(Vt(["image","video-cover"])).max(100).optional(),unsupportedReason:re().max(1e3).optional(),variant:DN.optional(),note:re().max(500).optional()}),FN=ze({inputTokens:Dn().nonnegative().optional(),outputTokens:Dn().nonnegative().optional(),cachedInputTokens:Dn().nonnegative().optional(),allocation:Tf("equal-share").optional()}),Z1e=ze({referenceId:re().min(1),revision:Dn().int().positive(),description:re().trim().min(1).max(8e3),runtime:Am([Im,Tf("user")]),evidence:Vt(["observation","preference"]),usage:FN.optional()}),W1e=$N.extend({id:re(),revision:Dn()}),pJ=ze({requestId:re().min(1).max(200),instruction:re().min(1).max(3e4),runtime:Im,mode:Vt(["auto","off","uploads"]).default("off"),excludedSourceIds:Rt(re()).max(100).default([]),excludedReferenceIds:Rt(re()).max(100).default([]),excludedMediaHashes:Rt(re()).max(100).default([]),suppliedInputHashes:Rt(re().regex(/^[a-f0-9]{64}$/)).max(Gp).optional()});pJ.extend({mode:Vt(["auto","off","uploads"]).default("uploads"),uploads:Rt(re().max(QT+XT)).max(Gp).optional()}).refine(t=>(t.uploads??[]).reduce((e,n)=>e+n.length,0)<=QT+Gp*XT,"Supplied images exceed the profile upload budget");const mJ=Gb().transform((t,e)=>{const n=NN.safeParse(t);return n.success?n.data:(e.addIssue({code:PN.custom,message:"Invalid supplied image reference"}),z5)}),JT=ze({suppliedReferences:Rt(mJ).max(Gp).optional(),failedUploadCount:Dn().int().min(0).max(Gp).optional(),usage:FN.optional(),requestId:re(),status:Vt(["selected","empty","off","unavailable","timeout"]),queries:Rt(re()),candidateIds:Rt(re()),selected:Rt(ze({id:re(),revision:Dn(),title:re().optional(),url:re().url().optional(),mediaHashes:Rt(re().regex(/^[a-f0-9]{64}$/)).optional(),reason:re(),sourceTitles:Rt(re()),variant:DN.optional()})),contextText:re().max(6e3),images:Rt(ze({path:re(),hash:re().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"])})).max(uJ),durationMs:Dn()});JT.pick({requestId:!0,suppliedReferences:!0,failedUploadCount:!0,status:!0,selected:!0,images:!0,durationMs:!0}).extend({requestId:re().min(1).max(200),selected:JT.shape.selected.max(3)});const K1e=200,Tk=ze({id:re(),name:re(),pinnedAt:re().nullable().optional(),lastOpenedAt:re(),projectPath:re(),isAvailable:Xs(),storageKind:Vt(["project","bundle"]),issue:re().optional(),historyIssue:re().optional()}),gJ=ze({dataUrl:re(),label:re(),capturedAt:re()}),vJ=ze({projectId:re(),sessionId:re(),variantId:re(),label:re(),brief:re(),createdAt:re(),hasStaticPreview:Xs(),hasInteractivePreview:Xs()}),q1e=ze({projects:Rt(Tk),variants:Rt(vJ)}),jN=ze({error:re()}),yJ=ze({errorCode:re(),message:re()}),_J=ze({error:re().optional(),details:Am([re(),ze({formErrors:Rt(re()).optional(),fieldErrors:Ek(re(),Rt(re()).optional()).optional()})]).optional()}),wJ=ze({token:re().min(1)}),bJ=ze({url:re().url()}),G1e=ze({projects:Rt(Tk)}),Y1e=ze({project:Tk}),X1e=ze({projectId:re()}),Q1e=ze({preview:gJ.nullable()}),J1e=ze({projectPath:re().nullable()}),eye=ze({editorUrl:re()}),tye=ze({url:re()}),nye=ze({saved:Tf(!0)}),xJ=ze({requestId:re(),sequence:Dn(),projectId:re().optional(),sessionId:re().optional(),variantId:re().optional()}),rye=ze({navigations:Rt(xJ)}),sye=ze({acknowledged:Xs()}),zN=ze({profile:ze({isEnabled:Xs()}),sources:Rt(ze({provider:Pk,title:re(),url:re().nullable()}))}),VN=ze({id:re(),revision:re(),collectionCount:Dn(),referenceCount:Dn(),imageCount:Dn(),reusableCount:Dn(),unsupportedCount:Dn(),scopeDisclosure:re(),usageDisclosure:re()}),SJ=ze({isAuthenticated:Xs(),email:re().optional(),name:re().optional(),userId:re().optional()}),Q2=re().min(1).max(500),HN=ze({pinned:Rt(Q2).max(1e3),order:ze({groups:Rt(Q2).max(1e3),rows:Ek(re(),Rt(Q2).max(1e3))})}),kJ=ze({projectPath:re(),uiState:HN});ze({uiState:HN,projectPath:re().optional()});const EJ=t=>wJ.parse(t).token,eR="The library returned an invalid response.",z1="rivet_library_token";let Xa="",Mf=0,Wa=null,qv=null,tR=!1;const nx=new Set,Yp=()=>nx.forEach(t=>t()),iye=()=>Wa??qv,oye=()=>Mf,Xp=()=>{try{const t=window.localStorage.getItem(z1)??"";Xa!==t&&(Mf+=1),Xa=t,Wa=null}catch{Wa="Rivet cannot access browser storage. Allow site storage and try again."}},UN=()=>{tR||(window.addEventListener("storage",t=>{t.key!==z1&&t.key!==null||(Xp(),Yp())}),tR=!0)},aye=()=>!!Xa,lye=t=>(UN(),nx.add(t),()=>nx.delete(t)),CJ=(t,e)=>{if(e!==void 0&&Xp(),e!==void 0&&e!==Mf)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(z1,t)}catch{throw Wa="Rivet cannot save browser access. Allow site storage and try again.",Yp(),new Error(Wa)}Xa=t,Mf+=1,Wa=null,qv=null,Yp()},BN=()=>{Xa="",Mf+=1,Wa=null;try{window.localStorage.removeItem(z1)}catch{Wa="Rivet cannot clear browser storage. Allow site storage and try again."}Yp()},PJ=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;UN(),Xp();const t=Mf,e=new URLSearchParams(window.location.hash.slice(1)).get("code");if(e){window.history.replaceState(null,"",window.location.pathname+window.location.search);try{const n=await fetch("/api/library/browser-sessions/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})});if(n.ok){CJ(EJ(await n.json()),t);return}n.status>=500&&!Xa&&(qv="Rivet is temporarily unavailable. Please retry this link.")}catch{!Xa&&!Wa&&(qv="Rivet could not open this link. Please retry when the server is available.")}}Yp()},ZN=async(t,e={})=>{Xp();const n=Xa,r=new Headers(e.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(t,{...e,headers:r});return s.status===401&&(Xp(),Xa===n&&BN()),s},TJ=async(t,{schema:e,...n})=>{const r=await ZN(`/api/library${t}`,{method:n.method??"GET",signal:n.signal,headers:{"Content-Type":"application/json"},...n.body!==void 0?{body:JSON.stringify(n.body)}:{}});return RJ(r,e)},RJ=async(t,e)=>{const n=await t.text();let r;try{r=JSON.parse(n)}catch{if(t.ok)throw new Error(eR)}if(!t.ok){if(t.status===401)throw new Error("Sign in to access this library.");const i=jN.safeParse(r),o=i.success&&i.data.error.trim()?i.data.error:`Library request failed (${t.status}).`;throw new Error(o)}const s=e.safeParse(r);if(!s.success)throw new Error(eR);return s.data},Ft=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library")){const n=new Headers(e.headers),r=TH();return r&&CH(t,e.method)&&n.set(SH,r),fetch(t,{...e,headers:n,redirect:"error"})}return ZN(t,e)};let WN="off";const nR=t=>{WN=t},AJ=()=>WN==="full",KN=({userId:t,email:e})=>{AJ()&&(t?(Xe.identify(t,e?{email:e}:{}),e&&Xe.alias(e,t)):e&&Xe.identify(e,{email:e}))},IJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",OJ=3e3,MJ=/^plugin-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,NJ=t=>({person_profiles:"never",autocapture:!1,opt_out_useragent_filter:!0,capture_pageview:!1,capture_pageleave:!1,capture_exceptions:!1,capture_performance:!1,disable_session_recording:!0,enable_recording_console_log:!1,disable_external_dependency_loading:!0,disable_surveys:!0,advanced_disable_flags:!0,advanced_disable_feature_flags:!0,mask_all_text:!0,mask_all_element_attributes:!0,persistence:"memory",bootstrap:{distinctID:t,isIdentifiedID:!1},before_send:e=>{const n=MQ(e.event,e.properties);return n&&Ft("/api/telemetry/events",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e.event,properties:n}),keepalive:!0}).catch(()=>{}),null}}),LJ=async()=>{try{const t=await Ft("/api/telemetry",{signal:AbortSignal.timeout(OJ),cache:"no-store"});if(!t.ok)return;const e=await t.json();if(e.mode!=="full"&&e.mode!=="metrics"||e.mode==="metrics"&&(typeof e.distinctId!="string"||!MJ.test(e.distinctId)))return;const n=e.mode,s={api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...{session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]",blockSelector:"iframe[data-rivet-private]"}},mask_all_text:!1,mask_all_element_attributes:!1,loaded:i=>i.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.28.0",env:"production"})};n==="metrics"&&Object.assign(s,NJ(e.distinctId),{api_host:window.location.origin}),Xe.init(IJ,s),nR(n)}catch{nR("off")}},qN=g.createContext(void 0),Om=t=>{const e=g.useContext(qN);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},DJ=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(qN.Provider,{value:t,children:e})),$J={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Nl,VS,BO,FJ=(BO=class{constructor(){nt(this,Nl,$J);nt(this,VS,!1)}setTimeoutProvider(t){Ne(this,Nl,t)}setTimeout(t,e){return W(this,Nl).setTimeout(t,e)}clearTimeout(t){W(this,Nl).clearTimeout(t)}setInterval(t,e){return W(this,Nl).setInterval(t,e)}clearInterval(t){W(this,Nl).clearInterval(t)}},Nl=new WeakMap,VS=new WeakMap,BO);const ou=new FJ;function jJ(t){setTimeout(t,0)}const zJ=typeof window>"u"||"Deno"in globalThis;function Os(){}function VJ(t,e){return typeof t=="function"?t(e):t}function GN(t){return typeof t=="number"&&t>=0&&t!==1/0}function YN(t,e){return Math.max(t+(e||0)-Date.now(),0)}function zn(t,e){return typeof t=="function"?t(e):t}function rR(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==Rk(o,e.options))return!1}else if(!Nf(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function sR(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Du(e.options.mutationKey)!==Du(i))return!1}else if(!Nf(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Rk(t,e){return((e==null?void 0:e.queryKeyHashFn)||Du)(t)}function Du(t){return JSON.stringify(t,(e,n)=>rx(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Nf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!Nf(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Nf(t[r],e[r]))return!1;return!0}return!1}const XN=Object.prototype.hasOwnProperty;function QN(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=iR(t)&&iR(e);if(!r&&!(rx(t)&&rx(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let c=0;for(let d=0;d<o;d++){const f=r?d:i[d],h=t[f],m=e[f];if(h===m){l[f]=h,(r?d<s:XN.call(t,f))&&c++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[f]=m;continue}const v=QN(h,m,n+1);l[f]=v,v===h&&c++}return s===o&&c===s?t:l}function Zg(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n of Object.keys(t))if(!XN.call(e,n)||t[n]!==e[n])return!1;return!0}function iR(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function rx(t){if(!oR(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!oR(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function oR(t){return Object.prototype.toString.call(t)==="[object Object]"}function HJ(t){return new Promise(e=>{ou.setTimeout(e,t)})}function sx(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?QN(t,e):e}function UJ(t){return t}function BJ(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(-n):r}function ZJ(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,n):r}const Ak=Symbol();function JN(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Ak?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Ik(t,e){return typeof t=="function"?t(...e):!!t}const Ok=Symbol();function WJ(t,e,n,r){let s=!1,i;return Object.defineProperties(t,{[Ok]:{value:r},signal:{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}}),t}let KJ=()=>zJ;const Mk=()=>KJ();var qf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uu,Ll,sf,ZO,qJ=(ZO=class extends qf{constructor(){super();nt(this,uu);nt(this,Ll);nt(this,sf);Ne(this,sf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Ll)||this.setEventListener(W(this,sf))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ll))==null||e.call(this),Ne(this,Ll,void 0))}setEventListener(e){var n;Ne(this,sf,e),(n=W(this,Ll))==null||n.call(this),Ne(this,Ll,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,uu)!==e&&(Ne(this,uu,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,uu)=="boolean"?W(this,uu):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},uu=new WeakMap,Ll=new WeakMap,sf=new WeakMap,ZO);const Nk=new qJ,GJ=jJ;function YJ(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=GJ;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const Ir=YJ();var of,Dl,af,WO,XJ=(WO=class extends qf{constructor(){super();nt(this,of,!0);nt(this,Dl);nt(this,af);Ne(this,af,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Dl)||this.setEventListener(W(this,af))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Dl))==null||e.call(this),Ne(this,Dl,void 0))}setEventListener(e){var n;Ne(this,af,e),(n=W(this,Dl))==null||n.call(this),Ne(this,Dl,e(this.setOnline.bind(this)))}setOnline(e){W(this,of)!==e&&(Ne(this,of,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return W(this,of)}},of=new WeakMap,Dl=new WeakMap,af=new WeakMap,WO);const Gv=new XJ;function QJ(t){return Math.min(1e3*2**t,3e4)}function eL(t){return(t??"online")==="online"?Gv.isOnline():!0}var ix=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function tL(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,C)=>{i=k,o=C});l.catch(Os);const c=()=>s!=="pending",d=k=>{var C;if(!c()){const P=new ix(k);_(P),(C=t.onCancel)==null||C.call(t,P)}},f=()=>{e=!0},h=()=>{e=!1},m=()=>Nk.isFocused()&&(t.networkMode==="always"||Gv.isOnline())&&t.canRun(),v=()=>eL(t.networkMode)&&t.canRun(),y=k=>{c()||(r==null||r(),s="resolved",i(k))},_=k=>{c()||(r==null||r(),s="rejected",o(k))},b=k=>new Promise(C=>{var P;r=R=>{(c()||k())&&C(R)},(P=t.onPause)==null||P.call(t)}).then(()=>{var C;r=void 0,c()||(C=t.onContinue)==null||C.call(t)}),x=()=>{if(c())return;let k;const C=n===0?t.initialPromise:void 0;try{k=C??t.fn()}catch(P){k=Promise.reject(P)}Promise.resolve(k).then(y).catch(P=>{var M;if(c())return;const R=t.retry??(Mk()?0:3),O=t.retryDelay??QJ,I=typeof O=="function"?O(n,P):O,A=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,P);if(e||!A){_(P);return}n++,(M=t.onFail)==null||M.call(t,n,P),HJ(I).then(()=>c()||m()?void 0:b(m)).then(()=>{e?_(P):x()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:h,canStart:v,start:()=>(v()?x():b(v).then(x),l)}}var du,KO,nL=(KO=class{constructor(){nt(this,du)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),GN(this.gcTime)&&Ne(this,du,ou.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Mk()?1/0:3e5))}clearGcTimeout(){W(this,du)!==void 0&&(ou.clearTimeout(W(this,du)),Ne(this,du,void 0))}},du=new WeakMap,KO);function JJ(t){return{onFetch:(e,n)=>{var f,h,m,v,y;const r=e.options,s=(m=(h=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((y=e.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let _=!1;const b=e,x=P=>{WJ(P,()=>e.signal,()=>_=!0,b[Ok])},k=JN(e.options,e.fetchOptions),C=async(P,R,O)=>{if(_)return Promise.reject(e.signal.reason);if(R==null&&P.pages.length)return Promise.resolve(P);const A=(()=>{const $={client:e.client,queryKey:e.queryKey,pageParam:R,direction:O?"backward":"forward",meta:e.options.meta};return x($),$})(),M=await k(A),{maxPages:L}=e.options,z=O?ZJ:BJ;return{pages:z(P.pages,M,L),pageParams:z(P.pageParams,R,L)}};if(s&&i.length){const P=s==="backward",R=P?eee:aR,O={pages:i,pageParams:o};l=await C(O,R(r,O),P)}else{const P=t??i.length;do{const R=c===0?o[0]===void 0?r.initialPageParam:o[0]:aR(r,l);if(c>0&&R==null)break;l=await C(l,R),c++}while(c<P)}return l};e.options.persister?e.fetchFn=()=>{var _,b;return(b=(_=e.options).persister)==null?void 0:b.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function aR(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function eee(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var lf,fu,cf,Wi,hu,Br,Fa,Sm,pu,vo,Ma,qO,tee=(qO=class extends nL{constructor(e){super();nt(this,vo);nt(this,lf);nt(this,fu);nt(this,cf);nt(this,Wi);nt(this,hu);nt(this,Br);nt(this,Fa);nt(this,Sm);nt(this,pu);Ne(this,pu,!1),Ne(this,Sm,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ne(this,hu,e.client),Ne(this,Wi,W(this,hu).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ne(this,fu,cR(this.options)),this.state=e.state??W(this,fu),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,lf)}get promise(){var e;return(e=W(this,Br))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,Sm),...e},e!=null&&e._type&&Ne(this,lf,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=cR(this.options);n.data!==void 0&&(this.setState(lR(n.data,n.dataUpdatedAt)),Ne(this,fu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Wi).remove(this)}setData(e,n){const r=sx(this.state.data,e,this.options);return Et(this,vo,Ma).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){Et(this,vo,Ma).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,Br))==null?void 0:r.promise;return(s=W(this,Br))==null||s.cancel(e),n?n.then(Os).catch(Os):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,fu)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>zn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ak||!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(e=>zn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!YN(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Br))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=W(this,Br))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,Wi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(W(this,Br)&&(W(this,pu)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?W(this,Br).cancel({revert:!0}):W(this,Br).cancelRetry()),this.scheduleGc()),W(this,Wi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Et(this,vo,Ma).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,m,v;if(this.state.fetchStatus!=="idle"&&((f=W(this,Br))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Br)&&W(this,Fa))return W(this,Br).continueRetry(),W(this,Fa)}if(e&&this.setOptions(e),!this.options.queryFn){const y=this.observers.find(_=>_.options.queryFn);y&&this.setOptions(y.options)}const r=new AbortController,s=y=>{Object.defineProperties(y,{[Ok]:{value:r.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(Ne(this,pu,!0),r.signal)}})},i=()=>{const y=JN(this.options,n),b=(()=>{const x={client:W(this,hu),queryKey:this.queryKey,meta:this.meta};return s(x),x})();return Ne(this,pu,!1),this.options.persister?this.options.persister(y,b,this):y(b)},l=(()=>{const y={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,hu),state:this.state,fetchFn:i};return s(y),y})();(h=W(this,lf)==="infinite"?JJ(this.options.pages):this.options.behavior)==null||h.onFetch(l,this),Ne(this,cf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&Et(this,vo,Ma).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta});const c=Ne(this,Br,tL({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:y=>{y instanceof ix&&y.revert&&this.setState({...W(this,cf),fetchStatus:"idle"}),r.abort()},onFail:(y,_)=>{Et(this,vo,Ma).call(this,{type:"failed",failureCount:y,error:_})},onPause:()=>{Et(this,vo,Ma).call(this,{type:"pause"})},onContinue:()=>{Et(this,vo,Ma).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),d=(async()=>{var y,_,b,x,k,C,P,R;try{const O=await c.promise;if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(_=(y=W(this,Wi).config).onSuccess)==null||_.call(y,O,this),(x=(b=W(this,Wi).config).onSettled)==null||x.call(b,O,this.state.error,this),O}catch(O){if(O instanceof ix){if(O.silent){if(W(this,Br)!==c&&W(this,Fa))return W(this,Fa);throw O}else if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw Et(this,vo,Ma).call(this,{type:"error",error:O}),(C=(k=W(this,Wi).config).onError)==null||C.call(k,O,this),(R=(P=W(this,Wi).config).onSettled)==null||R.call(P,this.state.data,O,this),O}finally{W(this,Br)===c&&(Ne(this,Br,void 0),Ne(this,Fa,void 0)),this.scheduleGc()}})();return Ne(this,Fa,d),c.start(),d}},lf=new WeakMap,fu=new WeakMap,cf=new WeakMap,Wi=new WeakMap,hu=new WeakMap,Br=new WeakMap,Fa=new WeakMap,Sm=new WeakMap,pu=new WeakMap,vo=new WeakSet,Ma=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...rL(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...lR(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ne(this,cf,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Ir.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),W(this,Wi).notify({query:this,type:"updated",action:e})})},qO);function rL(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eL(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function lR(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function cR(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rs,zt,km,As,mu,uf,ja,Em,df,ff,gu,vu,$l,hf,ln,op,ox,ax,lx,cx,ux,dx,fx,hx,GO,nee=(GO=class extends qf{constructor(e,n){super();nt(this,ln);nt(this,Rs);nt(this,zt);nt(this,km);nt(this,As);nt(this,mu);nt(this,uf);nt(this,ja);nt(this,Em);nt(this,df);nt(this,ff);nt(this,gu);nt(this,vu);nt(this,$l);nt(this,hf,new Set);this.options=n,Ne(this,Rs,e),Ne(this,ja,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,zt).addObserver(this),uR(W(this,zt),this.options)?Et(this,ln,op).call(this):this.updateResult(),Et(this,ln,ux).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return px(W(this,zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return px(W(this,zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Et(this,ln,dx).call(this),Et(this,ln,fx).call(this),W(this,zt).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,zt);if(this.options=W(this,Rs).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zn(this.options.enabled,W(this,zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Et(this,ln,hx).call(this),W(this,zt).setOptions(this.options),n._defaulted&&!Zg(this.options,n)&&W(this,Rs).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,zt),observer:this});const s=this.hasListeners();s&&dR(W(this,zt),r,this.options,n)&&Et(this,ln,op).call(this),this.updateResult(),s&&(W(this,zt)!==r||zn(this.options.enabled,W(this,zt))!==zn(n.enabled,W(this,zt))||zn(this.options.staleTime,W(this,zt))!==zn(n.staleTime,W(this,zt)))&&Et(this,ln,ax).call(this);const i=Et(this,ln,lx).call(this);s&&(W(this,zt)!==r||zn(this.options.enabled,W(this,zt))!==zn(n.enabled,W(this,zt))||i!==W(this,$l))&&Et(this,ln,cx).call(this,i)}getOptimisticResult(e){const n=W(this,Rs).getQueryCache().build(W(this,Rs),e),r=this.createResult(n,e);return Zg(this.getCurrentResult(),r)||(Ne(this,As,r),Ne(this,uf,this.options),Ne(this,mu,W(this,zt).state)),r}getCurrentResult(){return W(this,As)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){W(this,hf).add(e)}getCurrentQuery(){return W(this,zt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,Rs).defaultQueryOptions(e),r=W(this,Rs).getQueryCache().build(W(this,Rs),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=W(this,Rs).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch(n).then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return Et(this,ln,op).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,As)))}createResult(e,n){var O;const r=W(this,zt),s=this.options,i=W(this,As),o=W(this,mu),l=W(this,uf),c=e!==r?e.state:W(this,km),{state:d}=e;let f={...d},h=!1,m;if(n._optimisticResults){const I=this.hasListeners(),A=!I&&uR(e,n),M=I&&dR(e,r,n,s);(A||M)&&(f={...f,...rL(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:_}=f;m=f.data;let b=!1;if(n.placeholderData!==void 0&&m===void 0&&_==="pending"){let I;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=i.data,b=!0):I=typeof n.placeholderData=="function"?n.placeholderData((O=W(this,ff))==null?void 0:O.state.data,W(this,ff)):n.placeholderData,I!==void 0&&(_="success",m=sx(i==null?void 0:i.data,I,n),h=!0)}if(n.select&&m!==void 0&&!b)if(i&&m===(o==null?void 0:o.data)&&n.select===W(this,Em))m=W(this,df);else try{Ne(this,Em,n.select),m=n.select(m),m=sx(i==null?void 0:i.data,m,n),Ne(this,df,m),Ne(this,ja,null)}catch(I){Ne(this,ja,I)}else m===void 0&&Ne(this,ja,null);W(this,ja)&&(v=W(this,ja),m=W(this,df),y=Date.now(),_="error",h=!1);const x=f.fetchStatus==="fetching",k=_==="pending",C=_==="error",P=k&&x,R=m!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:k,isSuccess:_==="success",isError:C,isInitialLoading:P,isLoading:P,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!k,isLoadingError:C&&!R,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:C&&R,isStale:Lk(e,n),refetch:this.refetch,isEnabled:zn(n.enabled,e)!==!1}}updateResult(){const e=W(this,As),n=this.createResult(W(this,zt),this.options);if(Ne(this,mu,W(this,zt).state),Ne(this,uf,this.options),W(this,mu).data!==void 0&&Ne(this,ff,W(this,zt)),Zg(n,e))return;Ne(this,As,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!W(this,hf).size||this.options.throwOnError&&W(this,As).error!==e.error)return!0;for(const l of o??W(this,hf))if(W(this,As)[l]!==e[l])return!0;return!1})();Ir.batch(()=>{s&&this.listeners.forEach(i=>{i(W(this,As))}),W(this,Rs).getQueryCache().notify({query:W(this,zt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Et(this,ln,ux).call(this)}},Rs=new WeakMap,zt=new WeakMap,km=new WeakMap,As=new WeakMap,mu=new WeakMap,uf=new WeakMap,ja=new WeakMap,Em=new WeakMap,df=new WeakMap,ff=new WeakMap,gu=new WeakMap,vu=new WeakMap,$l=new WeakMap,hf=new WeakMap,ln=new WeakSet,op=function(e){Et(this,ln,hx).call(this);let n=W(this,zt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Os)),n},ox=function(e){return!Mk()&&zn(this.options.enabled,W(this,zt))!==!1&&GN(e)},ax=function(){Et(this,ln,dx).call(this);const e=zn(this.options.staleTime,W(this,zt));if(W(this,As).isStale||!Et(this,ln,ox).call(this,e))return;const n=YN(W(this,As).dataUpdatedAt,e)+1;Ne(this,gu,ou.setTimeout(()=>{W(this,As).isStale||this.updateResult()},n))},lx=function(){return zn(this.options.refetchInterval,W(this,zt))??!1},cx=function(e){Et(this,ln,fx).call(this),Ne(this,$l,e),!(W(this,$l)===0||!Et(this,ln,ox).call(this,W(this,$l)))&&Ne(this,vu,ou.setInterval(()=>{(this.options.refetchIntervalInBackground||Nk.isFocused())&&Et(this,ln,op).call(this)},W(this,$l)))},ux=function(){Et(this,ln,ax).call(this),Et(this,ln,cx).call(this,Et(this,ln,lx).call(this))},dx=function(){W(this,gu)!==void 0&&(ou.clearTimeout(W(this,gu)),Ne(this,gu,void 0))},fx=function(){W(this,vu)!==void 0&&(ou.clearInterval(W(this,vu)),Ne(this,vu,void 0))},hx=function(){const e=W(this,Rs).getQueryCache().build(W(this,Rs),this.options);if(e===W(this,zt))return;const n=W(this,zt);Ne(this,zt,e),Ne(this,km,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},GO);function ree(t,e){return zn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&zn(e.retryOnMount,t)===!1)}function uR(t,e){return ree(t,e)||t.state.data!==void 0&&px(t,e,e.refetchOnMount)}function px(t,e,n){if(zn(e.enabled,t)!==!1&&zn(e.staleTime,t)!=="static"){const r=zn(n,t);return r==="always"||r!==!1&&Lk(t,e)}return!1}function dR(t,e,n,r){return(t!==e||zn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Lk(t,n)}function Lk(t,e){return zn(e.enabled,t)!==!1&&t.isStaleByTime(zn(e.staleTime,t))}var Cm,Zo,ps,yu,Wo,Al,YO,see=(YO=class extends nL{constructor(e){super();nt(this,Wo);nt(this,Cm);nt(this,Zo);nt(this,ps);nt(this,yu);Ne(this,Cm,e.client),this.mutationId=e.mutationId,Ne(this,ps,e.mutationCache),Ne(this,Zo,[]),this.state=e.state||sL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,Zo).includes(e)||(W(this,Zo).push(e),this.clearGcTimeout(),W(this,ps).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ne(this,Zo,W(this,Zo).filter(n=>n!==e)),this.scheduleGc(),W(this,ps).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,Zo).length||(this.state.status==="pending"?this.scheduleGc():W(this,ps).remove(this))}continue(){var e;return((e=W(this,yu))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,c,d,f,h,m,v,y,_,b,x,k,C,P,R,O,I,A;const n=()=>{Et(this,Wo,Al).call(this,{type:"continue"})},r={client:W(this,Cm),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ne(this,yu,tL({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,L)=>{Et(this,Wo,Al).call(this,{type:"failed",failureCount:M,error:L})},onPause:()=>{Et(this,Wo,Al).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,ps).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{Et(this,Wo,Al).call(this,{type:"pending",variables:e,isPaused:o}),W(this,ps).config.onMutate&&await W(this,ps).config.onMutate(e,this,r);const L=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e,r));L!==this.state.context&&Et(this,Wo,Al).call(this,{type:"pending",context:L,variables:e,isPaused:o})}this.state.isPaused&&s.canStart()&&n();const M=await s.start();return await((f=(d=W(this,ps).config).onSuccess)==null?void 0:f.call(d,M,e,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,M,e,this.state.context,r)),await((y=(v=W(this,ps).config).onSettled)==null?void 0:y.call(v,M,null,this.state.variables,this.state.context,this,r)),await((b=(_=this.options).onSettled)==null?void 0:b.call(_,M,null,e,this.state.context,r)),Et(this,Wo,Al).call(this,{type:"success",data:M}),M}catch(M){try{await((k=(x=W(this,ps).config).onError)==null?void 0:k.call(x,M,e,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((P=(C=this.options).onError)==null?void 0:P.call(C,M,e,this.state.context,r))}catch(L){Promise.reject(L)}try{await((O=(R=W(this,ps).config).onSettled)==null?void 0:O.call(R,void 0,M,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((A=(I=this.options).onSettled)==null?void 0:A.call(I,void 0,M,e,this.state.context,r))}catch(L){Promise.reject(L)}throw Et(this,Wo,Al).call(this,{type:"error",error:M}),M}finally{W(this,yu)===s&&Ne(this,yu,void 0),W(this,ps).runNext(this)}}},Cm=new WeakMap,Zo=new WeakMap,ps=new WeakMap,yu=new WeakMap,Wo=new WeakSet,Al=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ir.batch(()=>{W(this,Zo).forEach(r=>{r.onMutationUpdate(e)}),W(this,ps).notify({mutation:this,type:"updated",action:e})})},YO);function sL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fl,yo,Pm,XO,iee=(XO=class extends qf{constructor(e={}){super();nt(this,Fl);nt(this,yo);nt(this,Pm);this.config=e,Ne(this,Fl,new Set),Ne(this,yo,new Map),Ne(this,Pm,0)}build(e,n,r){const s=new see({client:e,mutationCache:this,mutationId:++B0(this,Pm)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,Fl).add(e);const n=ug(e);if(typeof n=="string"){const r=W(this,yo).get(n);r?r.push(e):W(this,yo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,Fl).delete(e)){const n=ug(e);if(typeof n=="string"){const r=W(this,yo).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,yo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=ug(e);if(typeof n=="string"){const s=(r=W(this,yo).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=ug(e);return typeof n=="string"?((s=(r=W(this,yo).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Ir.batch(()=>{const e=this.getAll();W(this,Fl).clear(),W(this,yo).clear(),e.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(W(this,Fl))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>sR(n,r))}findAll(e={}){return this.getAll().filter(n=>sR(e,n))}notify(e){Ir.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ir.batch(()=>Promise.all(e.map(n=>n.continue().catch(Os))))}},Fl=new WeakMap,yo=new WeakMap,Pm=new WeakMap,XO);function ug(t){var e;return(e=t.options.scope)==null?void 0:e.id}var za,jl,ms,Tm,ta,ap,mx,QO,oee=(QO=class extends qf{constructor(n,r){super();nt(this,ta);nt(this,za);nt(this,jl);nt(this,ms);nt(this,Tm);Ne(this,za,n),this.setOptions(r),this.bindMethods(),Et(this,ta,ap).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=W(this,za).defaultMutationOptions(n),Zg(this.options,r)||W(this,za).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,ms),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Du(r.mutationKey)!==Du(this.options.mutationKey)?this.reset():((s=W(this,ms))==null?void 0:s.state.status)==="pending"&&W(this,ms).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&W(this,ms)&&(W(this,ms).addObserver(this),Et(this,ta,ap).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,ms))==null||n.removeObserver(this)}onMutationUpdate(n){Et(this,ta,ap).call(this),Et(this,ta,mx).call(this,n)}getCurrentResult(){return W(this,jl)}reset(){var n;(n=W(this,ms))==null||n.removeObserver(this),Ne(this,ms,void 0),Et(this,ta,ap).call(this),Et(this,ta,mx).call(this)}mutate(n,r){var s;return Ne(this,Tm,r),(s=W(this,ms))==null||s.removeObserver(this),Ne(this,ms,W(this,za).getMutationCache().build(W(this,za),this.options)),W(this,ms).addObserver(this),W(this,ms).execute(n)}},za=new WeakMap,jl=new WeakMap,ms=new WeakMap,Tm=new WeakMap,ta=new WeakSet,ap=function(){var r;const n=((r=W(this,ms))==null?void 0:r.state)??sL();Ne(this,jl,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},mx=function(n){Ir.batch(()=>{var s,i,o,l;const r=W(this,Tm);if(r&&this.hasListeners()){const c=W(this,jl).variables,d=W(this,jl).context,f={client:W(this,za),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,c,d,f)}catch(h){Promise.reject(h)}try{(i=r.onSettled)==null||i.call(r,n.data,null,c,d,f)}catch(h){Promise.reject(h)}}else if((n==null?void 0:n.type)==="error"){try{(o=r.onError)==null||o.call(r,n.error,c,d,f)}catch(h){Promise.reject(h)}try{(l=r.onSettled)==null||l.call(r,void 0,n.error,c,d,f)}catch(h){Promise.reject(h)}}}this.listeners.forEach(c=>{c(W(this,jl))})})},QO),Ko,JO,aee=(JO=class extends qf{constructor(e={}){super();nt(this,Ko);this.config=e,Ne(this,Ko,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Rk(s,n);let o=this.get(i);return o||(o=new tee({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){W(this,Ko).has(e.queryHash)||(W(this,Ko).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){W(this,Ko).get(e.queryHash)===e&&(e.destroy(),W(this,Ko).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ir.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,Ko).get(e)}getAll(){return[...W(this,Ko).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>rR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>rR(e,r)):n}notify(e){Ir.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ir.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ir.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ko=new WeakMap,JO),Wn,zl,Vl,pf,mf,Hl,gf,vf,e4,lee=(e4=class{constructor(t={}){nt(this,Wn);nt(this,zl);nt(this,Vl);nt(this,pf);nt(this,mf);nt(this,Hl);nt(this,gf);nt(this,vf);Ne(this,Wn,t.queryCache||new aee),Ne(this,zl,t.mutationCache||new iee),Ne(this,Vl,t.defaultOptions||{}),Ne(this,pf,new Map),Ne(this,mf,new Map),Ne(this,Hl,0)}mount(){B0(this,Hl)._++,W(this,Hl)===1&&(Ne(this,gf,Nk.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Wn).onFocus())})),Ne(this,vf,Gv.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Wn).onOnline())})))}unmount(){var t,e;B0(this,Hl)._--,W(this,Hl)===0&&((t=W(this,gf))==null||t.call(this),Ne(this,gf,void 0),(e=W(this,vf))==null||e.call(this),Ne(this,vf,void 0))}isFetching(t){return W(this,Wn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,zl).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Wn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,Wn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(zn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,Wn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=W(this,Wn).get(r.queryHash))==null?void 0:o.state.data,i=VJ(e,s);if(i!==void 0)return W(this,Wn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return Ir.batch(()=>W(this,Wn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Wn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,Wn);Ir.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,Wn);return Ir.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=Ir.batch(()=>W(this,Wn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Os).catch(Os)}invalidateQueries(t,e={}){return Ir.batch(()=>(W(this,Wn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Ir.batch(()=>W(this,Wn).findAll(t).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(Os)),o?Promise.resolve():i}));return Promise.all(r).then(Os)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,Wn).build(this,e),r=n.isStaleByTime(zn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,Wn).build(this,e);return n.isStaleByTime(zn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Os).catch(Os)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Os).catch(Os)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Gv.isOnline()?W(this,zl).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Wn)}getMutationCache(){return W(this,zl)}getDefaultOptions(){return W(this,Vl)}setDefaultOptions(t){Ne(this,Vl,t)}setQueryDefaults(t,e){W(this,pf).set(Du(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,pf).values()],n={};return e.forEach(r=>{Nf(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,mf).set(Du(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,mf).values()],n={};return e.forEach(r=>{Nf(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Vl).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Rk(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ak&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Vl).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,Wn).clear(),W(this,zl).clear()}},Wn=new WeakMap,zl=new WeakMap,Vl=new WeakMap,pf=new WeakMap,mf=new WeakMap,Hl=new WeakMap,gf=new WeakMap,vf=new WeakMap,e4);const iL=g.createContext(!1),cee=()=>g.useContext(iL);iL.Provider;function uee(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const dee=g.createContext(uee()),fee=()=>g.useContext(dee),hee=(t,e,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof t.throwOnError=="function"?Ik(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},pee=t=>{g.useEffect(()=>{t.clearReset()},[t])},mee=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||Ik(n,[t.error,r])),gee=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},vee=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,yee=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function _ee(t,e,n){const r=cee(),s=fee(),i=Om(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),c=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":c?"optimistic":void 0,gee(o),hee(o,s,l),pee(s);const[d]=g.useState(()=>new e(i,o)),f=d.getOptimisticResult(o);g.useEffect(()=>{d.setOptions(o)},[o,d]);const h=!r&&c;if(g.useSyncExternalStore(g.useCallback(m=>{const v=h?d.subscribe(Ir.batchCalls(m)):Os;return d.updateResult(),v},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),vee(o,f))throw yee(o,d,s);if(mee({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function la(t,e){return _ee(t,nee)}function oL(t,e){const n=Om(),[r]=g.useState(()=>new oee(n,t));g.useEffect(()=>{r.setOptions(t)},[r,t]);const s=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(Ir.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=g.useCallback((...o)=>{r.mutate(o[0],o[1]).catch(Os)},[r]);if(s.error&&Ik(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const Dk=g.createContext({});function V1(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const wee=typeof window<"u",$k=wee?g.useLayoutEffect:g.useEffect,H1=g.createContext(null);function Fk(t,e){t.indexOf(e)===-1&&t.push(e)}function Yv(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ca=(t,e,n)=>n>e?e:n<t?t:n;let U1=()=>{};const cc={},aL=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),lL=t=>typeof t=="object"&&t!==null,cL=t=>/^0[^.\s]+$/u.test(t);function uL(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ji=t=>t,Mm=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Qp=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class jk{constructor(){this.subscriptions=[]}add(e){return Fk(this.subscriptions,e),()=>Yv(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ki=t=>t*1e3,qi=t=>t/1e3,dL=(t,e)=>e?t*(1e3/e):0,fL=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,bee=1e-7,xee=12;function See(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=fL(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>bee&&++l<xee);return o}function Nm(t,e,n,r){if(t===e&&n===r)return Ji;const s=i=>See(i,0,1,t,n);return i=>i===0||i===1?i:fL(s(i),e,r)}const hL=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pL=t=>e=>1-t(1-e),mL=Nm(.33,1.53,.69,.99),zk=pL(mL),gL=hL(zk),vL=t=>t>=1?1:(t*=2)<1?.5*zk(t):.5*(2-Math.pow(2,-10*(t-1))),Vk=t=>1-Math.sin(Math.acos(t)),yL=pL(Vk),_L=hL(Vk),kee=Nm(.42,0,1,1),Eee=Nm(0,0,.58,1),wL=Nm(.42,0,.58,1),Cee=t=>Array.isArray(t)&&typeof t[0]!="number",bL=t=>Array.isArray(t)&&typeof t[0]=="number",Pee={linear:Ji,easeIn:kee,easeInOut:wL,easeOut:Eee,circIn:Vk,circInOut:_L,circOut:yL,backIn:zk,backInOut:gL,backOut:mL,anticipate:vL},Tee=t=>typeof t=="string",fR=t=>{if(bL(t)){U1(t.length===4);const[e,n,r,s]=t;return Nm(e,n,r,s)}else if(Tee(t))return Pee[t];return t},dg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ree(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(c.schedule(d),t()),d(o)}const c={schedule:(d,f=!1,h=!1)=>{const v=h&&r?e:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,c.process(d))}};return c}const Aee=40;function xL(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=dg.reduce((C,P)=>(C[P]=Ree(i),C),{}),{setup:l,read:c,resolveKeyframes:d,preUpdate:f,update:h,preRender:m,render:v,postRender:y}=o,_=()=>{const C=cc.useManualTiming,P=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,Aee),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),c.process(s),d.process(s),f.process(s),h.process(s),m.process(s),v.process(s),y.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},b=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:dg.reduce((C,P)=>{const R=o[P];return C[P]=(O,I=!1,A=!1)=>(n||b(),R.schedule(O,I,A)),C},{}),cancel:C=>{for(let P=0;P<dg.length;P++)o[dg[P]].cancel(C)},state:s,steps:o}}const{schedule:Cn,cancel:uc,state:Qr,steps:J2}=xL(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ji,!0);let Wg;function Iee(){Wg=void 0}const Ns={now:()=>(Wg===void 0&&Ns.set(Qr.isProcessing||cc.useManualTiming?Qr.timestamp:performance.now()),Wg),set:t=>{Wg=t,queueMicrotask(Iee)}},SL=t=>e=>typeof e=="string"&&e.startsWith(t),kL=SL("--"),Oee=SL("var(--"),Hk=t=>Oee(t)?Mee.test(t.split("/*")[0].trim()):!1,Mee=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function hR(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Gf={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Jp={...Gf,transform:t=>ca(0,1,t)},fg={...Gf,default:1},Cp=t=>Math.round(t*1e5)/1e5,Uk=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Nee(t){return t==null}const Lee=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bk=(t,e)=>n=>!!(typeof n=="string"&&Lee.test(n)&&n.startsWith(t)||e&&!Nee(n)&&Object.prototype.hasOwnProperty.call(n,e)),EL=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Uk);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Dee=t=>ca(0,255,t),ew={...Gf,transform:t=>Math.round(Dee(t))},au={test:Bk("rgb","red"),parse:EL("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ew.transform(t)+", "+ew.transform(e)+", "+ew.transform(n)+", "+Cp(Jp.transform(r))+")"};function $ee(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const gx={test:Bk("#"),parse:$ee,transform:au.transform},Lm=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Na=Lm("deg"),ra=Lm("%"),qe=Lm("px"),Fee=Lm("vh"),jee=Lm("vw"),pR={...ra,parse:t=>ra.parse(t)/100,transform:t=>ra.transform(t*100)},Hd={test:Bk("hsl","hue"),parse:EL("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ra.transform(Cp(e))+", "+ra.transform(Cp(n))+", "+Cp(Jp.transform(r))+")"},_r={test:t=>au.test(t)||gx.test(t)||Hd.test(t),parse:t=>au.test(t)?au.parse(t):Hd.test(t)?Hd.parse(t):gx.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?au.transform(t):Hd.transform(t),getAnimatableNone:t=>{const e=_r.parse(t);return e.alpha=0,_r.transform(e)}},zee=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Vee(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Uk))==null?void 0:e.length)||0)+(((n=t.match(zee))==null?void 0:n.length)||0)>0}const CL="number",PL="color",Hee="var",Uee="var(",mR="${}",Bee=/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 Lf(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(Bee,c=>(_r.test(c)?(r.color.push(i),s.push(PL),n.push(_r.parse(c))):c.startsWith(Uee)?(r.var.push(i),s.push(Hee),n.push(c)):(r.number.push(i),s.push(CL),n.push(parseFloat(c))),++i,mR)).split(mR);return{values:n,split:l,indexes:r,types:s}}function Zee(t){return Lf(t).values}function TL({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===CL?s+=Cp(r[i]):o===PL?s+=_r.transform(r[i]):s+=r[i]}return s}}function Wee(t){return TL(Lf(t))}const Kee=t=>typeof t=="number"?0:_r.test(t)?_r.getAnimatableNone(t):t,qee=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Kee(t);function Gee(t){const e=Lf(t);return TL(e)(e.values.map((r,s)=>qee(r,e.split[s])))}const xo={test:Vee,parse:Zee,createTransformer:Wee,getAnimatableNone:Gee};function tw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Yee({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,c=2*n-l;s=tw(c,l,t+1/3),i=tw(c,l,t),o=tw(c,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Xv(t,e){return n=>n>0?e:t}const En=(t,e,n)=>t+(e-t)*n,nw=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Xee=[gx,au,Hd],Qee=t=>Xee.find(e=>e.test(t));function gR(t){const e=Qee(t);if(!e)return!1;let n=e.parse(t);return e===Hd&&(n=Yee(n)),n}const vR=(t,e)=>{const n=gR(t),r=gR(e);if(!n||!r)return Xv(t,e);const s={...n};return i=>(s.red=nw(n.red,r.red,i),s.green=nw(n.green,r.green,i),s.blue=nw(n.blue,r.blue,i),s.alpha=En(n.alpha,r.alpha,i),au.transform(s))},vx=new Set(["none","hidden"]);function Jee(t,e){return vx.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ete(t,e){return n=>En(t,e,n)}function Zk(t){return typeof t=="number"?ete:typeof t=="string"?Hk(t)?Xv:_r.test(t)?vR:rte:Array.isArray(t)?RL:typeof t=="object"?_r.test(t)?vR:tte:Xv}function RL(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Zk(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function tte(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Zk(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function nte(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const rte=(t,e)=>{const n=xo.createTransformer(e),r=Lf(t),s=Lf(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?vx.has(t)&&!s.values.length||vx.has(e)&&!r.values.length?Jee(t,e):Mm(RL(nte(r,s),s.values),n):Xv(t,e)};function AL(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?En(t,e,n):Zk(t)(t,e)}const ste=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Cn.update(e,n),stop:()=>uc(e),now:()=>Qr.isProcessing?Qr.timestamp:Ns.now()}},IL=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Qv=2e4;function Wk(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Qv;)e+=n,r=t.next(e);return e>=Qv?1/0:e}function ite(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Wk(r),Qv);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:qi(s)}}const or={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 yx(t,e){return t*Math.sqrt(1-e*e)}const ote=12;function ate(t,e,n){let r=n;for(let s=1;s<ote;s++)r=r-t(r)/e(r);return r}const rw=.001;function lte({duration:t=or.duration,bounce:e=or.bounce,velocity:n=or.velocity,mass:r=or.mass}){let s,i,o=1-e;o=ca(or.minDamping,or.maxDamping,o),t=ca(or.minDuration,or.maxDuration,qi(t)),o<1?(s=d=>{const f=d*o,h=f*t,m=f-n,v=yx(d,o),y=Math.exp(-h);return rw-m/v*y},i=d=>{const h=d*o*t,m=h*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,y=Math.exp(-h),_=yx(Math.pow(d,2),o);return(-s(d)+rw>0?-1:1)*((m-v)*y)/_}):(s=d=>{const f=Math.exp(-d*t),h=(d-n)*t+1;return-rw+f*h},i=d=>{const f=Math.exp(-d*t),h=(n-d)*(t*t);return f*h});const l=5/t,c=ate(s,i,l);if(t=ki(t),isNaN(c))return{stiffness:or.stiffness,damping:or.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const cte=["duration","bounce"],ute=["stiffness","damping","mass"];function yR(t,e){return e.some(n=>t[n]!==void 0)}function dte(t){let e={velocity:or.velocity,stiffness:or.stiffness,damping:or.damping,mass:or.mass,isResolvedFromDuration:!1,...t};if(!yR(t,ute)&&yR(t,cte))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ca(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:or.mass,stiffness:s,damping:i}}else{const n=lte({...t,velocity:0});e={...e,...n,mass:or.mass},e.isResolvedFromDuration=!0}return e}function Jv(t=or.visualDuration,e=or.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:d,mass:f,duration:h,velocity:m,isResolvedFromDuration:v}=dte({...n,velocity:-qi(n.velocity||0)}),y=m||0,_=d/(2*Math.sqrt(c*f)),b=o-i,x=qi(Math.sqrt(c/f)),k=Math.abs(b)<5;r||(r=k?or.restSpeed.granular:or.restSpeed.default),s||(s=k?or.restDelta.granular:or.restDelta.default);let C,P,R,O,I,A;if(_<1)R=yx(x,_),O=(y+_*x*b)/R,C=L=>{const z=Math.exp(-_*x*L);return o-z*(O*Math.sin(R*L)+b*Math.cos(R*L))},I=_*x*O+b*R,A=_*x*b-O*R,P=L=>Math.exp(-_*x*L)*(I*Math.sin(R*L)+A*Math.cos(R*L));else if(_===1){C=z=>o-Math.exp(-x*z)*(b+(y+x*b)*z);const L=y+x*b;P=z=>Math.exp(-x*z)*(x*L*z-y)}else{const L=x*Math.sqrt(_*_-1);C=X=>{const j=Math.exp(-_*x*X),K=Math.min(L*X,300);return o-j*((y+_*x*b)*Math.sinh(K)+L*b*Math.cosh(K))/L};const z=(y+_*x*b)/L,$=_*x*z-b*L,q=_*x*b-z*L;P=X=>{const j=Math.exp(-_*x*X),K=Math.min(L*X,300);return j*($*Math.sinh(K)+q*Math.cosh(K))}}const M={calculatedDuration:v&&h||null,velocity:L=>ki(P(L)),next:L=>{if(!v&&_<1){const $=Math.exp(-_*x*L),q=Math.sin(R*L),X=Math.cos(R*L),j=o-$*(O*q+b*X),K=ki($*(I*q+A*X));return l.done=Math.abs(K)<=r&&Math.abs(o-j)<=s,l.value=l.done?o:j,l}const z=C(L);if(v)l.done=L>=h;else{const $=ki(P(L));l.done=Math.abs($)<=r&&Math.abs(o-z)<=s}return l.value=l.done?o:z,l},toString:()=>{const L=Math.min(Wk(M),Qv),z=IL($=>M.next(L*$).value,L,30);return L+"ms "+z},toTransition:()=>{}};return M}Jv.applyToOptions=t=>{const e=ite(t,100,Jv);return t.ease=e.ease,t.duration=ki(e.duration),t.type="keyframes",t};const fte=5;function OL(t,e,n){const r=Math.max(e-fte,0);return dL(n-t(r),e-r)}function _x({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:f}){const h=t[0],m={done:!1,value:h},v=A=>l!==void 0&&A<l||c!==void 0&&A>c,y=A=>l===void 0?c:c===void 0||Math.abs(l-A)<Math.abs(c-A)?l:c;let _=n*e;const b=h+_,x=o===void 0?b:o(b);x!==b&&(_=x-h);const k=A=>-_*Math.exp(-A/r),C=A=>x+k(A),P=A=>{const M=k(A),L=C(A);m.done=Math.abs(M)<=d,m.value=m.done?x:L};let R,O;const I=A=>{v(m.value)&&(R=A,O=Jv({keyframes:[m.value,y(m.value)],velocity:OL(C,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return I(0),{calculatedDuration:null,next:A=>{let M=!1;return!O&&R===void 0&&(M=!0,P(A),I(A)),R!==void 0&&A>=R?O.next(A-R):(!M&&P(A),m)}}}function hte(t,e,n){const r=[],s=n||cc.mix||AL,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Ji:e;l=Mm(c,l)}r.push(l)}return r}function pte(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(U1(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=hte(e,r,s),c=l.length,d=f=>{if(o&&f<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(f<t[h+1]);h++);const m=Qp(t[h],t[h+1],f);return l[h](m)};return n?f=>d(ca(t[0],t[i-1],f)):d}function mte(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Qp(0,e,r);t.push(En(n,1,s))}}function gte(t){const e=[0];return mte(e,t.length-1),e}function vte(t,e){return t.map(n=>n*e)}function yte(t,e){return t.map(()=>e||wL).splice(0,t.length-1)}function Pp({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=Cee(r)?r.map(fR):fR(r),i={done:!1,value:e[0]},o=vte(n&&n.length===e.length?n:gte(e),t),l=pte(o,e,{ease:Array.isArray(s)?s:yte(e,s)});return{calculatedDuration:t,next:c=>(i.value=l(c),i.done=c>=t,i)}}const _te=t=>t!==null;function B1(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(_te),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const wte={decay:_x,inertia:_x,tween:Pp,keyframes:Pp,spring:Jv};function ML(t){typeof t.type=="string"&&(t.type=wte[t.type])}class Kk{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const bte=t=>t/100;class e1 extends Kk{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Ns.now()&&this.tick(Ns.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;ML(e);const{type:n=Pp,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const c=n||Pp;c!==Pp&&typeof l[0]!="number"&&(this.mixKeyframes=Mm(bte,AL(l[0],l[1])),l=[0,100]);const d=c({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Wk(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:h,repeatType:m,repeatDelay:v,type:y,onUpdate:_,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?x<0:x>s;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,P=r;if(h){const A=Math.min(this.currentTime,s)/l;let M=Math.floor(A),L=A%1;!L&&A>=1&&(L=1),L===1&&M--,M=Math.min(M,h+1),!!(M%2)&&(m==="reverse"?(L=1-L,v&&(L-=v/l)):m==="mirror"&&(P=o)),C=ca(0,1,L)*l}let R;k?(this.delayState.value=f[0],R=this.delayState):R=P.next(C),i&&!k&&(R.value=i(R.value));let{done:O}=R;!k&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return I&&y!==_x&&(R.value=B1(f,this.options,b,this.speed)),_&&_(R.value),I&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return qi(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qi(e)}get time(){return qi(this.currentTime)}set time(e){e=ki(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return OL(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(Ns.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=qi(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=ste,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ns.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function xte(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lu=t=>t*180/Math.PI,wx=t=>{const e=lu(Math.atan2(t[1],t[0]));return bx(e)},Ste={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:wx,rotateZ:wx,skewX:t=>lu(Math.atan(t[1])),skewY:t=>lu(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},bx=t=>(t=t%360,t<0&&(t+=360),t),_R=wx,wR=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),bR=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),kte={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wR,scaleY:bR,scale:t=>(wR(t)+bR(t))/2,rotateX:t=>bx(lu(Math.atan2(t[6],t[5]))),rotateY:t=>bx(lu(Math.atan2(-t[2],t[0]))),rotateZ:_R,rotate:_R,skewX:t=>lu(Math.atan(t[4])),skewY:t=>lu(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function xx(t){return t.includes("scale")?1:0}function Sx(t,e){if(!t||t==="none")return xx(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=kte,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ste,s=l}if(!s)return xx(e);const i=r[e],o=s[1].split(",").map(Cte);return typeof i=="function"?i(o):o[i]}const Ete=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Sx(n,e)};function Cte(t){return parseFloat(t.trim())}const Yf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xf=new Set([...Yf,"pathRotation"]),xR=t=>t===Gf||t===qe,Pte=new Set(["x","y","z"]),Tte=Yf.filter(t=>!Pte.has(t));function Rte(t){const e=[];return Tte.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Kl={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Sx(e,"x"),y:(t,{transform:e})=>Sx(e,"y")};Kl.translateX=Kl.x;Kl.translateY=Kl.y;const Su=new Set;let kx=!1,Ex=!1,Cx=!1;function NL(){if(Ex){const t=Array.from(Su).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Rte(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ex=!1,kx=!1,Su.forEach(t=>t.complete(Cx)),Su.clear()}function LL(){Su.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ex=!0)})}function Ate(){Cx=!0,LL(),NL(),Cx=!1}class qk{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Su.add(this),kx||(kx=!0,Cn.read(LL),Cn.resolveKeyframes(NL))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}xte(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Su.delete(this)}cancel(){this.state==="scheduled"&&(Su.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ite=t=>t.startsWith("--");function DL(t,e,n){Ite(e)?t.style.setProperty(e,n):t.style[e]=n}const Ote={};function $L(t,e){const n=uL(t);return()=>Ote[e]??n()}const Mte=$L(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),FL=$L(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),lp=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,SR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lp([0,.65,.55,1]),circOut:lp([.55,0,1,.45]),backIn:lp([.31,.01,.66,-.59]),backOut:lp([.33,1.53,.69,.99])};function jL(t,e){if(t)return typeof t=="function"?FL()?IL(t,e):"ease-out":bL(t)?lp(t):Array.isArray(t)?t.map(n=>jL(n,e)||SR.easeOut):SR[t]}function Nte(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:c}={},d=void 0){const f={[e]:n};c&&(f.offset=c);const h=jL(l,s);Array.isArray(h)&&(f.easing=h);const m={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(f,m)}function zL(t){return typeof t=="function"&&"applyToOptions"in t}function Lte({type:t,...e}){return zL(t)&&FL()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class VL extends Kk{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,U1(typeof e.type!="string");const d=Lte(e);this.animation=Nte(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=B1(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),DL(n,r,f),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return qi(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qi(e)}get time(){return qi(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ki(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Mte()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ji):s(this)}}const HL={anticipate:vL,backInOut:gL,circInOut:_L};function Dte(t){return t in HL}function $te(t){typeof t.ease=="string"&&Dte(t.ease)&&(t.ease=HL[t.ease])}const sw=10;class Fte extends VL{constructor(e){$te(e),ML(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new e1({...o,autoplay:!1}),c=Math.max(sw,Ns.now()-this.startTime),d=ca(0,sw,c-sw),f=l.sample(c).value,{name:h}=this.options;i&&h&&DL(i,h,f),n.setWithVelocity(l.sample(Math.max(0,c-d)).value,f,d),l.stop()}}const kR=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(xo.test(t)||t==="0")&&!t.startsWith("url("));function jte(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function zte(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=kR(s,e),l=kR(i,e);return!o||!l?!1:jte(t)||(n==="spring"||zL(n))&&r}function Px(t){t.duration=0,t.type="keyframes"}const UL=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Vte=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Hte(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Vte.test(t[e]))return!0;return!1}const Ute=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bte=uL(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Zte(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,c=(h=e==null?void 0:e.owner)==null?void 0:h.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return Bte()&&n&&(UL.has(n)||Ute.has(n)&&Hte(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const Wte=40;class Kte extends Kk{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:c,motionValue:d,element:f,...h}){var y;super(),this.stop=()=>{var _,b;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Ns.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:c,motionValue:d,element:f,...h},v=(f==null?void 0:f.KeyframeResolver)||qk;this.keyframeResolver=new v(l,(_,b,x)=>this.onKeyframesResolved(_,b,m,!x),c,d,f),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,n,r,s){var x,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Ns.now();let h=!0;zte(e,i,o,l)||(h=!1,(cc.instantAnimations||!c)&&(f==null||f(B1(e,r,n))),e[0]=e[e.length-1],Px(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Wte?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},y=h&&!d&&Zte(v),_=(k=(x=v.motionValue)==null?void 0:x.owner)==null?void 0:k.current;let b;if(y)try{b=new Fte({...v,element:_})}catch{b=new e1(v)}else b=new e1(v);b.finished.then(()=>{this.notifyFinished()}).catch(Ji),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ate()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function BL(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const ER=30,qte=t=>!isNaN(parseFloat(t));class Gte{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Ns.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ns.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=qte(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new jk);const r=this.events[e].add(n);return e==="change"?()=>{r(),Cn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ns.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ER)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ER);return dL(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Df(t,e){return new Gte(t,e)}function Gk(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Yk(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Gk(n,t):n}const Yte={type:"spring",stiffness:500,damping:25,restSpeed:10},Xte=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Qte={type:"keyframes",duration:.8},Jte={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ene=(t,{keyframes:e})=>e.length>2?Qte:Xf.has(t)?t.startsWith("scale")?Xte(e[1]):Yte:Jte,tne=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function nne(t){for(const e in t)if(!tne.has(e))return!0;return!1}const Xk=(t,e,n,r={},s,i)=>o=>{const l=Yk(r,t)||{},c=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-ki(c);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:m=>{e.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};nne(l)||Object.assign(f,ene(t,f)),f.duration&&(f.duration=ki(f.duration)),f.repeatDelay&&(f.repeatDelay=ki(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Px(f),f.delay===0&&(h=!0)),(cc.instantAnimations||cc.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,Px(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const m=B1(f.keyframes,l);if(m!==void 0){Cn.update(()=>{f.onUpdate(m),f.onComplete()});return}}return l.isSync?new e1(f):new Kte(f)},rne=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sne(t){const e=rne.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function ZL(t,e,n=1){const[r,s]=sne(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return aL(o)?parseFloat(o):o}return Hk(s)?ZL(s,e,n+1):s}function CR(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Qk(t,e,n,r){if(typeof e=="function"){const[s,i]=CR(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=CR(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function ku(t,e,n){const r=t.getProps();return Qk(r,e,n!==void 0?n:r.custom,t)}const WL=new Set(["width","height","top","left","right","bottom",...Yf]),Tx=t=>Array.isArray(t);function ine(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Df(n))}function one(t){return Tx(t)?t[t.length-1]||0:t}function ane(t,e){const n=ku(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=one(i[o]);ine(t,o,l)}}const ts=t=>!!(t&&t.getVelocity);function lne(t){return!!(ts(t)&&t.add)}function Rx(t,e){const n=t.getValue("willChange");if(lne(n))return n.add(e);if(!n&&cc.WillChange){const r=new cc.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Jk(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const cne="framerAppearId",KL="data-"+Jk(cne);function qL(t){return t.props[KL]}function une({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function GL(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const c=t.getDefaultTransition();i=i?Gk(i,c):c;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],m=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,h);for(const y in l){const _=t.getValue(y,t.latestValues[y]??null),b=l[y];if(b===void 0||m&&une(m,y))continue;const x={delay:n,...Yk(i||{},y)};f&&(x.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(b)&&b===k&&!x.velocity){Cn.update(()=>_.set(b));continue}let C=!1;if(window.MotionHandoffAnimation){const O=qL(t);if(O){const I=window.MotionHandoffAnimation(O,y,Cn);I!==null&&(x.startTime=I,C=!0)}}Rx(t,y);const P=d??t.shouldReduceMotion;_.start(Xk(y,_,b,P&&WL.has(y)?{type:!1}:x,t,C));const R=_.animation;R&&h.push(R)}if(o){const y=()=>Cn.update(()=>{o&&ane(t,o)});h.length?Promise.all(h).then(y):y()}return h}function Ax(t,e,n={}){var c;const r=ku(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(GL(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:m}=s;return dne(t,e,d,f,h,m,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function dne(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),l.push(Ax(c,e,{...o,delay:n+(typeof r=="function"?0:r)+BL(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function fne(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Ax(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Ax(t,e,n);else{const s=typeof e=="function"?ku(t,e,n.custom):e;r=Promise.all(GL(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const hne={test:t=>t==="auto",parse:t=>t},YL=t=>e=>e.test(t),XL=[Gf,qe,ra,Na,jee,Fee,hne],PR=t=>XL.find(YL(t));function pne(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||cL(t):!0}const mne=new Set(["brightness","contrast","saturate","opacity"]);function gne(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Uk)||[];if(!r)return t;const s=n.replace(r,"");let i=mne.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const vne=/\b([a-z-]*)\(.*?\)/gu,Ix={...xo,getAnimatableNone:t=>{const e=t.match(vne);return e?e.map(gne).join(" "):t}},Ox={...xo,getAnimatableNone:t=>{const e=xo.parse(t);return xo.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},TR={...Gf,transform:Math.round},yne={rotate:Na,pathRotation:Na,rotateX:Na,rotateY:Na,rotateZ:Na,scale:fg,scaleX:fg,scaleY:fg,scaleZ:fg,skew:Na,skewX:Na,skewY:Na,distance:qe,translateX:qe,translateY:qe,translateZ:qe,x:qe,y:qe,z:qe,perspective:qe,transformPerspective:qe,opacity:Jp,originX:pR,originY:pR,originZ:qe},t1={borderWidth:qe,borderTopWidth:qe,borderRightWidth:qe,borderBottomWidth:qe,borderLeftWidth:qe,borderRadius:qe,borderTopLeftRadius:qe,borderTopRightRadius:qe,borderBottomRightRadius:qe,borderBottomLeftRadius:qe,width:qe,maxWidth:qe,height:qe,maxHeight:qe,top:qe,right:qe,bottom:qe,left:qe,inset:qe,insetBlock:qe,insetBlockStart:qe,insetBlockEnd:qe,insetInline:qe,insetInlineStart:qe,insetInlineEnd:qe,padding:qe,paddingTop:qe,paddingRight:qe,paddingBottom:qe,paddingLeft:qe,paddingBlock:qe,paddingBlockStart:qe,paddingBlockEnd:qe,paddingInline:qe,paddingInlineStart:qe,paddingInlineEnd:qe,margin:qe,marginTop:qe,marginRight:qe,marginBottom:qe,marginLeft:qe,marginBlock:qe,marginBlockStart:qe,marginBlockEnd:qe,marginInline:qe,marginInlineStart:qe,marginInlineEnd:qe,fontSize:qe,backgroundPositionX:qe,backgroundPositionY:qe,...yne,zIndex:TR,fillOpacity:Jp,strokeOpacity:Jp,numOctaves:TR},_ne={...t1,color:_r,backgroundColor:_r,outlineColor:_r,fill:_r,stroke:_r,borderColor:_r,borderTopColor:_r,borderRightColor:_r,borderBottomColor:_r,borderLeftColor:_r,filter:Ix,WebkitFilter:Ix,mask:Ox,WebkitMask:Ox},QL=t=>_ne[t],wne=new Set([Ix,Ox]);function JL(t,e){let n=QL(t);return wne.has(n)||(n=xo),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const bne=new Set(["auto","none","0"]);function xne(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!bne.has(i)&&Lf(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=JL(n,s)}class Sne extends qk{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let h=e[f];if(typeof h=="string"&&(h=h.trim(),Hk(h))){const m=ZL(h,n.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!WL.has(r)||e.length!==2)return;const[s,i]=e,o=PR(s),l=PR(i),c=hR(s),d=hR(i);if(c!==d&&Kl[r]){this.needsMeasurement=!0;return}if(o!==l)if(xR(o)&&xR(l))for(let f=0;f<e.length;f++){const h=e[f];typeof h=="string"&&(e[f]=parseFloat(h))}else Kl[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||pne(e[s]))&&r.push(s);r.length&&xne(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Kl[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Kl[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const eE=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function eD(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const Mx=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Kg(t){return lL(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:tE}=xL(queueMicrotask,!1),mo={x:!1,y:!1};function tD(){return mo.x||mo.y}function kne(t){return t==="x"||t==="y"?mo[t]?null:(mo[t]=!0,()=>{mo[t]=!1}):mo.x||mo.y?null:(mo.x=mo.y=!0,()=>{mo.x=mo.y=!1})}function nD(t,e){const n=eD(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Ene(t){return!(t.pointerType==="touch"||tD())}function Cne(t,e,n={}){const[r,s,i]=nD(t,n);return r.forEach(o=>{let l=!1,c=!1,d;const f=()=>{o.removeEventListener("pointerleave",y)},h=b=>{d&&(d(b),d=void 0),f()},m=b=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,h(b))},v=()=>{l=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},y=b=>{if(b.pointerType!=="touch"){if(l){c=!0;return}h(b)}},_=b=>{if(!Ene(b))return;c=!1;const x=e(o,b);typeof x=="function"&&(d=x,o.addEventListener("pointerleave",y,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const rD=(t,e)=>e?t===e?!0:rD(t,e.parentElement):!1,nE=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Pne=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Tne(t){return Pne.has(t.tagName)||t.isContentEditable===!0}const Rne=new Set(["INPUT","SELECT","TEXTAREA"]);function Ane(t){return Rne.has(t.tagName)||t.isContentEditable===!0}const qg=new WeakSet;function RR(t){return e=>{e.key==="Enter"&&t(e)}}function iw(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ine=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=RR(()=>{if(qg.has(n))return;iw(n,"down");const s=RR(()=>{iw(n,"up")}),i=()=>iw(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function AR(t){return nE(t)&&!tD()}const IR=new WeakSet;function One(t,e,n={}){const[r,s,i]=nD(t,n),o=l=>{const c=l.currentTarget;if(!AR(l)||IR.has(l))return;qg.add(c),n.stopPropagation&&IR.add(l);const d=e(c,l),f={...s,capture:!0},h=(y,_)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",v,f),qg.has(c)&&qg.delete(c),AR(y)&&typeof d=="function"&&d(y,{success:_})},m=y=>{h(y,c===window||c===document||n.useGlobalTarget||rD(c,y.target))},v=y=>{h(y,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),Kg(l)&&(l.addEventListener("focus",d=>Ine(d,s)),!Tne(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function rE(t){return lL(t)&&"ownerSVGElement"in t}const Gg=new WeakMap;let Il;const sD=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:rE(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Mne=sD("inline","width","offsetWidth"),Nne=sD("block","height","offsetHeight");function Lne({target:t,borderBoxSize:e}){var n;(n=Gg.get(t))==null||n.forEach(r=>{r(t,{get width(){return Mne(t,e)},get height(){return Nne(t,e)}})})}function Dne(t){t.forEach(Lne)}function $ne(){typeof ResizeObserver>"u"||(Il=new ResizeObserver(Dne))}function Fne(t,e){Il||$ne();const n=eD(t);return n.forEach(r=>{let s=Gg.get(r);s||(s=new Set,Gg.set(r,s)),s.add(e),Il==null||Il.observe(r)}),()=>{n.forEach(r=>{const s=Gg.get(r);s==null||s.delete(e),s!=null&&s.size||Il==null||Il.unobserve(r)})}}const Yg=new Set;let Ud;function jne(){Ud=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yg.forEach(e=>e(t))},window.addEventListener("resize",Ud)}function zne(t){return Yg.add(t),Ud||jne(),()=>{Yg.delete(t),!Yg.size&&typeof Ud=="function"&&(window.removeEventListener("resize",Ud),Ud=void 0)}}function OR(t,e){return typeof t=="function"?zne(t):Fne(t,e)}function Vne(t){return rE(t)&&t.tagName==="svg"}const Hne=[...XL,_r,xo],Une=t=>Hne.find(YL(t)),MR=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bd=()=>({x:MR(),y:MR()}),NR=()=>({min:0,max:0}),Ar=()=>({x:NR(),y:NR()}),Bne=new WeakMap;function Z1(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function em(t){return typeof t=="string"||Array.isArray(t)}const sE=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],iE=["initial",...sE];function W1(t){return Z1(t.animate)||iE.some(e=>em(t[e]))}function iD(t){return!!(W1(t)||t.variants)}function Zne(t,e,n){for(const r in e){const s=e[r],i=n[r];if(ts(s))t.addValue(r,s);else if(ts(i))t.addValue(r,Df(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,Df(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const n1={current:null},oE={current:!1},Wne=typeof window<"u";function oD(){if(oE.current=!0,!!Wne)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>n1.current=t.matches;t.addEventListener("change",e),e()}else n1.current=!1}const LR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let r1={};function aD(t){r1=t}function Kne(){return r1}class qne{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=qk,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=Ns.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Cn.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=W1(n),this.isVariantNode=iD(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in m){const y=m[v];d[v]!==void 0&&ts(y)&&y.set(d[v])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,Bne.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(oE.current||oD(),this.shouldReduceMotion=n1.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),uc(this.notifyUpdate),uc(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&UL.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:d,duration:f}=n.accelerate,h=new VL({element:this.current,name:e,keyframes:l,times:c,ease:d,duration:ki(f)}),m=o(h);this.valueSubscriptions.set(e,()=>{m(),h.cancel()});return}const r=Xf.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Cn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in r1){const n=r1[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ar()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<LR.length;r++){const s=LR[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Zne(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Df(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(aL(r)||cL(r))?r=parseFloat(r):!Une(r)&&xo.test(n)&&(r=JL(e,n)),this.setBaseTarget(e,ts(r)?r.get():r)),ts(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Qk(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ts(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new jk),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){tE.render(this.render)}}class lD extends qne{constructor(){super(...arguments),this.KeyframeResolver=Sne}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ts(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class wc{constructor(e){this.isMounted=!1,this.node=e}update(){}}function cD({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Gne({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Yne(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ow(t){return t===void 0||t===1}function Nx({scale:t,scaleX:e,scaleY:n}){return!ow(t)||!ow(e)||!ow(n)}function su(t){return Nx(t)||uD(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function uD(t){return DR(t.x)||DR(t.y)}function DR(t){return t&&t!=="0%"}function s1(t,e,n){const r=t-n,s=e*r;return n+s}function $R(t,e,n,r,s){return s!==void 0&&(t=s1(t,s,r)),s1(t,n,r)+e}function Lx(t,e=0,n=1,r,s){t.min=$R(t.min,e,n,r,s),t.max=$R(t.max,e,n,r,s)}function dD(t,{x:e,y:n}){Lx(t.x,e.translate,e.scale,e.originPoint),Lx(t.y,n.translate,n.scale,n.originPoint)}const FR=.999999999999,jR=1.0000000000001;function Xne(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let c=0;c<s;c++){i=n[c],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&&(Go(t.x,-i.scroll.offset.x),Go(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,dD(t,o)),r&&su(i.latestValues)&&Xg(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<jR&&e.x>FR&&(e.x=1),e.y<jR&&e.y>FR&&(e.y=1)}function Go(t,e){t.min+=e,t.max+=e}function zR(t,e,n,r,s=.5){const i=En(t.min,t.max,s);Lx(t,e,n,i,r)}function VR(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Xg(t,e,n){const r=n??t;zR(t.x,VR(e.x,r.x),e.scaleX,e.scale,e.originX),zR(t.y,VR(e.y,r.y),e.scaleY,e.scale,e.originY)}function fD(t,e){return cD(Yne(t.getBoundingClientRect(),e))}function Qne(t,e,n){const r=fD(t,n),{scroll:s}=e;return s&&(Go(r.x,s.offset.x),Go(r.y,s.offset.y)),r}const Jne={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ere=Yf.length;function tre(t,e,n){let r="",s=!0;for(let o=0;o<ere;o++){const l=Yf[o],c=t[l];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(l.startsWith("scale")?1:0);else{const f=parseFloat(c);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=Mx(c,t1[l]);if(!d){s=!1;const h=Jne[l]||l;r+=`${h}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Mx(i,t1.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function aE(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const c in e){const d=e[c];if(Xf.has(c)){o=!0;continue}else if(kL(c)){s[c]=d;continue}else{const f=Mx(d,t1[c]);c.startsWith("origin")?(l=!0,i[c]=f):r[c]=f}}if(e.transform||(o||n?r.transform=tre(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${c} ${d} ${f}`}}function hD(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function HR(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Zh={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(qe.test(t))t=parseFloat(t);else return t;const n=HR(t,e.target.x),r=HR(t,e.target.y);return`${n}% ${r}%`}},nre={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=xo.parse(t);if(s.length>5)return r;const i=xo.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,c=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=c;const d=En(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},Dx={borderRadius:{...Zh,applyTo:[...eE]},borderTopLeftRadius:Zh,borderTopRightRadius:Zh,borderBottomLeftRadius:Zh,borderBottomRightRadius:Zh,boxShadow:nre};function pD(t,{layout:e,layoutId:n}){return Xf.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Dx[t]||t==="opacity")}function lE(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(ts(r[l])||s&&ts(s[l])||pD(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function rre(t){return window.getComputedStyle(t)}class sre extends lD{constructor(){super(...arguments),this.type="html",this.renderInstance=hD}mount(e){U1(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Xf.has(n))return(r=this.projection)!=null&&r.isProjecting?xx(n):Ete(e,n);{const s=rre(e),i=(kL(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return fD(e,n)}build(e,n,r){aE(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return lE(e,n,r)}}const ire={offset:"stroke-dashoffset",array:"stroke-dasharray"},ore={offset:"strokeDashoffset",array:"strokeDasharray"};function are(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?ire:ore;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const lre=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function mD(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},c,d,f){if(aE(t,l,d),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:m}=t;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete h.transformBox);for(const v of lre)h[v]!==void 0&&(m[v]=h[v],delete h[v]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&are(h,s,i,o,!1)}const gD=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"]),vD=t=>typeof t=="string"&&t.toLowerCase()==="svg";function cre(t,e,n,r){hD(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(gD.has(s)?s:Jk(s),e.attrs[s])}function yD(t,e,n){const r=lE(t,e,n);for(const s in t)if(ts(t[s])||ts(e[s])){const i=Yf.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class ure extends lD{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ar}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Xf.has(n)){const r=QL(n);return r&&r.default||0}return n=gD.has(n)?n:Jk(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return yD(e,n,r)}build(e,n,r){mD(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){cre(e,n,r,s)}mount(e){this.isSVGTag=vD(e.tagName),super.mount(e)}}const dre=iE.length;function _D(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?_D(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<dre;n++){const r=iE[n],s=t.props[r];(em(s)||s===!1)&&(e[r]=s)}return e}function wD(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const fre=[...sE].reverse(),hre=sE.length;function pre(t){return e=>Promise.all(e.map(({animation:n,options:r})=>fne(t,n,r)))}function mre(t){let e=pre(t),n=UR(),r=!0,s=!1;const i=d=>(f,h)=>{var v;const m=ku(t,h,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(m){const{transition:y,transitionEnd:_,...b}=m;f={...f,...b,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,h=_D(t.parent)||{},m=[],v=new Set;let y={},_=1/0;for(let x=0;x<hre;x++){const k=fre[x],C=n[k],P=f[k]!==void 0?f[k]:h[k],R=em(P),O=k===d?C.isActive:null;O===!1&&(_=x);let I=P===h[k]&&P!==f[k]&&R;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),C.protectedKeys={...y},!C.isActive&&O===null||!P&&!C.prevProp||Z1(P)||typeof P=="boolean")continue;if(k==="exit"&&C.isActive&&O!==!0){C.prevResolvedValues&&(y={...y,...C.prevResolvedValues});continue}const A=gre(C.prevProp,P);let M=A||k===d&&C.isActive&&!I&&R||x>_&&R,L=!1;const z=Array.isArray(P)?P:[P];let $=z.reduce(i(k),{});O===!1&&($={});const{prevResolvedValues:q={}}=C,X={...q,...$},j=H=>{M=!0,v.has(H)&&(L=!0,v.delete(H)),C.needsAnimating[H]=!0;const Q=t.getValue(H);Q&&(Q.liveStyle=!1)};for(const H in X){const Q=$[H],B=q[H];if(y.hasOwnProperty(H))continue;let D=!1;Tx(Q)&&Tx(B)?D=!wD(Q,B)||A:D=Q!==B,D?Q!=null?j(H):v.add(H):Q!==void 0&&v.has(H)?j(H):C.protectedKeys[H]=!0}C.prevProp=P,C.prevResolvedValues=$,C.isActive&&(y={...y,...$}),(r||s)&&t.blockInitialAnimation&&(M=!1);const K=I&&A;M&&(!K||L)&&m.push(...z.map(H=>{const Q={type:k};if(typeof H=="string"&&(r||s)&&!K&&t.manuallyAnimateOnMount&&t.parent){const{parent:B}=t,D=ku(B,H);if(B.enteringChildren&&D){const{delayChildren:G}=D.transition||{};Q.delay=BL(B.enteringChildren,t,G)}}return{animation:H,options:Q}}))}if(v.size){const x={};if(typeof f.initial!="boolean"){const k=ku(t,Array.isArray(f.initial)?f.initial[0]:f.initial);k&&k.transition&&(x.transition=k.transition)}v.forEach(k=>{const C=t.getBaseTarget(k),P=t.getValue(k);P&&(P.liveStyle=!0),x[k]=C??null}),m.push({animation:x})}let b=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?e(m):Promise.resolve()}function c(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(v=>{var y;return(y=v.animationState)==null?void 0:y.setActive(d,f)}),n[d].isActive=f;const h=l(d);for(const v in n)n[v].protectedKeys={};return h}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=UR(),s=!0}}}function gre(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!wD(e,t):!1}function Kc(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function UR(){return{animate:Kc(!0),whileInView:Kc(),whileHover:Kc(),whileTap:Kc(),whileDrag:Kc(),whileFocus:Kc(),exit:Kc()}}function $x(t,e){t.min=e.min,t.max=e.max}function ho(t,e){$x(t.x,e.x),$x(t.y,e.y)}function BR(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const bD=1e-4,vre=1-bD,yre=1+bD,xD=.01,_re=0-xD,wre=0+xD;function Ls(t){return t.max-t.min}function bre(t,e,n){return Math.abs(t-e)<=n}function ZR(t,e,n,r=.5){t.origin=r,t.originPoint=En(e.min,e.max,t.origin),t.scale=Ls(n)/Ls(e),t.translate=En(n.min,n.max,t.origin)-t.originPoint,(t.scale>=vre&&t.scale<=yre||isNaN(t.scale))&&(t.scale=1),(t.translate>=_re&&t.translate<=wre||isNaN(t.translate))&&(t.translate=0)}function Tp(t,e,n,r){ZR(t.x,e.x,n.x,r?r.originX:void 0),ZR(t.y,e.y,n.y,r?r.originY:void 0)}function WR(t,e,n,r=0){const s=r?En(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Ls(e)}function xre(t,e,n,r){WR(t.x,e.x,n.x,r==null?void 0:r.x),WR(t.y,e.y,n.y,r==null?void 0:r.y)}function KR(t,e,n,r=0){const s=r?En(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Ls(e)}function i1(t,e,n,r){KR(t.x,e.x,n.x,r==null?void 0:r.x),KR(t.y,e.y,n.y,r==null?void 0:r.y)}function qR(t,e,n,r,s){return t-=e,t=s1(t,1/n,r),s!==void 0&&(t=s1(t,1/s,r)),t}function Sre(t,e=0,n=1,r=.5,s,i=t,o=t){if(ra.test(e)&&(e=parseFloat(e),e=En(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=En(i.min,i.max,r);t===i&&(l-=e),t.min=qR(t.min,e,n,l,s),t.max=qR(t.max,e,n,l,s)}function GR(t,e,[n,r,s],i,o){Sre(t,e[n],e[r],e[s],e.scale,i,o)}const kre=["x","scaleX","originX"],Ere=["y","scaleY","originY"];function YR(t,e,n,r){GR(t.x,e,kre,n?n.x:void 0,r?r.x:void 0),GR(t.y,e,Ere,n?n.y:void 0,r?r.y:void 0)}function XR(t){return t.translate===0&&t.scale===1}function SD(t){return XR(t.x)&&XR(t.y)}function QR(t,e){return t.min===e.min&&t.max===e.max}function Cre(t,e){return QR(t.x,e.x)&&QR(t.y,e.y)}function JR(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function kD(t,e){return JR(t.x,e.x)&&JR(t.y,e.y)}function eA(t){return Ls(t.x)/Ls(t.y)}function tA(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Uo(t){return[t("x"),t("y")]}function Pre(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:h,rotateX:m,rotateY:v,skewX:y,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),y&&(r+=`skewX(${y}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Tre=eE.length,nA=t=>typeof t=="string"?parseFloat(t):t,rA=t=>typeof t=="number"||qe.test(t);function Rre(t,e,n,r,s,i){s?(t.opacity=En(0,n.opacity??1,Are(r)),t.opacityExit=En(e.opacity??1,0,Ire(r))):i&&(t.opacity=En(e.opacity??1,n.opacity??1,r));for(let o=0;o<Tre;o++){const l=eE[o];let c=sA(e,l),d=sA(n,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||rA(c)===rA(d)?(t[l]=Math.max(En(nA(c),nA(d),r),0),(ra.test(d)||ra.test(c))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=En(e.rotate||0,n.rotate||0,r))}function sA(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Are=ED(0,.5,yL),Ire=ED(.5,.95,Ji);function ED(t,e,n){return r=>r<t?0:r>e?1:n(Qp(t,e,r))}function Ore(t,e,n){const r=ts(t)?t:Df(t);return r.start(Xk("",r,e,n)),r.animation}function tm(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const Mre=(t,e)=>t.depth-e.depth;class Nre{constructor(){this.children=[],this.isDirty=!1}add(e){Fk(this.children,e),this.isDirty=!0}remove(e){Yv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Mre),this.isDirty=!1,this.children.forEach(e)}}function Lre(t,e){const n=Ns.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(uc(r),t(i-e))};return Cn.setup(r,!0),()=>uc(r)}function Qg(t){return ts(t)?t.get():t}class Dre{constructor(){this.members=[]}add(e){Fk(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Yv(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Yv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Jg={hasAnimatedSinceResize:!0,hasEverUpdated:!1},aw=["","X","Y","Z"],$re=1e3;let Fre=0;function lw(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function CD(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=qL(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Cn,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&CD(r)}function PD({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=Fre++,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(Vre),this.nodes.forEach(Kre),this.nodes.forEach(qre),this.nodes.forEach(Hre)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Nre)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new jk),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=rE(o)&&!Vne(o),this.instance=o;const{layoutId:l,layout:c,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&&(c||l)&&(this.isLayoutDirty=!0),t){let f,h=0;const m=()=>this.root.updateBlockedByResize=!1;Cn.read(()=>{h=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==h&&(h=v,this.root.updateBlockedByResize=!0,f&&f(),f=Lre(m,250),Jg.hasAnimatedSinceResize&&(Jg.hasAnimatedSinceResize=!1,this.nodes.forEach(aA)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||Jre,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=d.getProps(),x=!this.targetLayout||!kD(this.targetLayout,v),k=!h&&m;if(this.options.layoutRoot||this.resumeFrom||k||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Yk(y,"layout"),onPlay:_,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,k,C.path)}else h||aA(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(),uc(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(Gre),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&&CD(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const h=this.path[f];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)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 c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Bre),this.nodes.forEach(iA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(oA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Zre),this.nodes.forEach(Wre),this.nodes.forEach(jre),this.nodes.forEach(zre)):this.nodes.forEach(oA),this.clearAllSnapshots();const l=Ns.now();Qr.delta=ca(0,1e3/60,l-Qr.timestamp),Qr.timestamp=l,Qr.isProcessing=!0,J2.update.process(Qr),J2.preRender.process(Qr),J2.render.process(Qr),Qr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tE.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ure),this.sharedNodes.forEach(Yre)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Cn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Cn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ls(this.snapshot.measuredBox.x)&&!Ls(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ar()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!SD(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||su(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),ese(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Ar();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(tse))){const{scroll:f}=this.root;f&&(Go(l.x,f.offset.x),Go(l.y,f.offset.y))}return l}removeElementScroll(o){var c;const l=Ar();if(ho(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:h,options:m}=f;f!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&ho(l,o),Go(l.x,h.offset.x),Go(l.y,h.offset.y))}return l}applyTransform(o,l=!1,c){var f,h;const d=c||Ar();ho(d,o);for(let m=0;m<this.path.length;m++){const v=this.path[m];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Go(d.x,-v.scroll.offset.x),Go(d.y,-v.scroll.offset.y)),su(v.latestValues)&&Xg(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return su(this.latestValues)&&Xg(d,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),d}removeTransform(o){var c;const l=Ar();ho(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!su(f.latestValues))continue;let h;f.instance&&(Nx(f.latestValues)&&f.updateSnapshot(),h=Ar(),ho(h,f.measurePageBox())),YR(l,f.latestValues,(c=f.snapshot)==null?void 0:c.layoutBox,h)}return su(this.latestValues)&&YR(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Qr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!this.layout||!(f||h))return;this.resolvedRelativeTargetAt=Qr.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=Ar(),this.targetWithTransforms=Ar()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xre(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ho(this.target,this.layout.layoutBox),dD(this.target,this.targetDelta)):ho(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||Nx(this.parent.latestValues)||uD(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ar(),this.relativeTargetOrigin=Ar(),i1(this.relativeTargetOrigin,l,c,this.options.layoutAnchor||void 0),ho(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Qr.timestamp&&(c=!1),c)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;ho(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;Xne(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ar());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(BR(this.prevProjectionDelta.x,this.projectionDelta.x),BR(this.prevProjectionDelta.y,this.projectionDelta.y)),Tp(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!tA(this.projectionDelta.x,this.prevProjectionDelta.x)||!tA(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Bd(),this.projectionDelta=Bd(),this.projectionDeltaWithTransform=Bd()}setAnimationOrigin(o,l=!1,c){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},m=Bd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Ar(),y=d?d.source:void 0,_=this.layout?this.layout.source:void 0,b=y!==_,x=this.getStack(),k=!x||x.members.length<=1,C=!!(b&&!k&&this.options.crossfade===!0&&!this.path.some(Qre));this.animationProgress=0;let P;const R=c==null?void 0:c.interpolateProjection(o);this.mixTargetDelta=O=>{const I=O/1e3,A=R==null?void 0:R(I);A?(m.x.translate=A.x,m.x.scale=En(o.x.scale,1,I),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=A.y,m.y.scale=En(o.y.scale,1,I),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(lA(m.x,o.x,I),lA(m.y,o.y,I)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(i1(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Xre(this.relativeTarget,this.relativeTargetOrigin,v,I),P&&Cre(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=Ar()),ho(P,this.relativeTarget)),b&&(this.animationValues=h,Rre(h,f,this.latestValues,I,C,k)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(uc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Cn.update(()=>{Jg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Df(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ore(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($re),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:f}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&TD(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Ar();const h=Ls(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const m=Ls(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}ho(l,c),Xg(l,f),Tp(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Dre),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const d={};c.z&&lw("z",o,d,this.animationValues);for(let f=0;f<aw.length;f++)lw(`rotate${aw[f]}`,o,d,this.animationValues),lw(`skew${aw[f]}`,o,d,this.animationValues);o.render();for(const f in d)o.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Qg(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(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=Qg(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!su(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=Pre(this.projectionDeltaWithTransform,this.treeScale,f);c&&(h=c(f,h)),o.transform=h;const{x:m,y:v}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in Dx){if(f[y]===void 0)continue;const{correct:_,applyTo:b,isCSSVariable:x}=Dx[y],k=h==="none"?f[y]:_(f[y],d);if(b){const C=b.length;for(let P=0;P<C;P++)o[b[P]]=k}else x?this.options.visualElement.renderState.vars[y]=k:o[y]=k}this.options.layoutId&&(o.pointerEvents=d===this?Qg(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(iA),this.root.sharedNodes.clear()}}}function jre(t){t.updateLayout()}function zre(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Uo(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Ls(m);m.min=r[h].min,m.max=m.min+v});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";$x(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else TD(i,e.layoutBox,r)&&Uo(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Ls(r[h]);m.max=m.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+v)});const l=Bd();Tp(l,r,e.layoutBox);const c=Bd();o?Tp(c,t.applyTransform(s,!0),e.measuredBox):Tp(c,r,e.layoutBox);const d=!SD(l);let f=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:v}=h;if(m&&v){const y=t.options.layoutAnchor||void 0,_=Ar();i1(_,e.layoutBox,m.layoutBox,y);const b=Ar();i1(b,r,v.layoutBox,y),kD(_,b)||(f=!0),h.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Vre(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Hre(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ure(t){t.clearSnapshot()}function iA(t){t.clearMeasurements()}function Bre(t){t.isLayoutDirty=!0,t.updateLayout()}function oA(t){t.isLayoutDirty=!1}function Zre(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Wre(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function aA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Kre(t){t.resolveTargetDelta()}function qre(t){t.calcProjection()}function Gre(t){t.resetSkewAndRotation()}function Yre(t){t.removeLeadSnapshot()}function lA(t,e,n){t.translate=En(e.translate,0,n),t.scale=En(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function cA(t,e,n,r){t.min=En(e.min,n.min,r),t.max=En(e.max,n.max,r)}function Xre(t,e,n,r){cA(t.x,e.x,n.x,r),cA(t.y,e.y,n.y,r)}function Qre(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Jre={duration:.45,ease:[.4,0,.1,1]},uA=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),dA=uA("applewebkit/")&&!uA("chrome/")?Math.round:Ji;function fA(t){t.min=dA(t.min),t.max=dA(t.max)}function ese(t){fA(t.x),fA(t.y)}function TD(t,e,n){return t==="position"||t==="preserve-aspect"&&!bre(eA(e),eA(n),.2)}function tse(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const nse=PD({attachResizeListener:(t,e)=>tm(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),cw={current:void 0},RD=PD({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!cw.current){const t=new nse({});t.mount(window),t.setOptions({layoutScroll:!0}),cw.current=t}return cw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),nm=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function hA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function rse(...t){return e=>{let n=!1;const r=t.map(s=>{const i=hA(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():hA(t[s],null)}}}}function sse(...t){return g.useCallback(rse(...t),t)}class ise extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Kg(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Kg(r)&&r.offsetWidth||0,i=Kg(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function ose({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=g.useId(),l=g.useRef(null),c=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(nm),f=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,h=sse(l,f);return g.useInsertionEffect(()=>{const{width:v,height:y,top:_,left:b,right:x,bottom:k,direction:C}=c.current;if(e||i===!1||!l.current||!v||!y)return;const P=C==="rtl",R=n==="left"?P?`right: ${x}`:`left: ${b}`:P?`left: ${b}`:`right: ${x}`,O=r==="bottom"?`bottom: ${k}`:`top: ${_}`;l.current.dataset.motionPopId=o;const I=document.createElement("style");d&&(I.nonce=d);const A=s??document.head;return A.appendChild(I),I.sheet&&I.sheet.insertRule(`
78
- [data-motion-pop-id="${o}"] {
79
- position: absolute !important;
80
- width: ${v}px !important;
81
- height: ${y}px !important;
82
- ${R}px !important;
83
- ${O}px !important;
84
- }
85
- `),()=>{var M;(M=l.current)==null||M.removeAttribute("data-motion-pop-id"),A.contains(I)&&A.removeChild(I)}},[e]),S.jsx(ise,{isPresent:e,childRef:l,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:h})})}const ase=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:c,root:d})=>{const f=V1(lse),h=g.useId(),m=g.useRef(n),v=g.useRef(r);$k(()=>{m.current=n,v.current=r});let y=!0,_=g.useMemo(()=>(y=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:b=>{f.set(b,!0);for(const x of f.values())if(!x)return;r&&r()},register:b=>(f.set(b,!1),()=>{var x;f.delete(b),!m.current&&!f.size&&((x=v.current)==null||x.call(v))})}),[n,f,r]);return i&&y&&(_={..._}),g.useMemo(()=>{f.forEach((b,x)=>f.set(x,!1))},[n]),g.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(ose,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:c,root:d,children:t}),S.jsx(H1.Provider,{value:_,children:t})};function lse(){return new Map}function AD(t=!0){const e=g.useContext(H1);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const o=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const hg=t=>t.key||"";function pA(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const Ei=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:d})=>{const[f,h]=AD(o),m=g.useMemo(()=>pA(t),[t]),v=o&&!f?[]:m.map(hg),y=g.useRef(!0),_=g.useRef(m),b=V1(()=>new Map),x=g.useRef(new Set),[k,C]=g.useState(m),[P,R]=g.useState(m);$k(()=>{y.current=!1,_.current=m;for(let A=0;A<P.length;A++){const M=hg(P[A]);v.includes(M)?(b.delete(M),x.current.delete(M)):b.get(M)!==!0&&b.set(M,!1)}},[P,v.length,v.join("-")]);const O=[];if(m!==k){let A=[...m];for(let M=0;M<P.length;M++){const L=P[M],z=hg(L);v.includes(z)||(A.splice(M,0,L),O.push(L))}return i==="wait"&&O.length&&(A=O),R(pA(A)),C(m),null}const{forceRender:I}=g.useContext(Dk);return S.jsx(S.Fragment,{children:P.map(A=>{const M=hg(A),L=o&&!f?!1:m===P||v.includes(M),z=()=>{if(x.current.has(M))return;if(b.has(M))x.current.add(M),b.set(M,!0);else return;let $=!0;b.forEach(q=>{q||($=!1)}),$&&(I==null||I(),R(_.current),o&&(h==null||h()),r&&r())};return S.jsx(ase,{isPresent:L,initial:!y.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:L?void 0:z,anchorX:l,anchorY:c,children:A},M)})})},ID=g.createContext({strict:!1}),mA={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 gA=!1;function cse(){if(gA)return;const t={};for(const e in mA)t[e]={isEnabled:n=>mA[e].some(r=>!!n[r])};aD(t),gA=!0}function OD(){return cse(),Kne()}function use(t){const e=OD();for(const n in t)e[n]={...e[n],...t[n]};aD(e)}const dse=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 o1(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||dse.has(t)}let MD=t=>!o1(t);function ND(t){typeof t=="function"&&(MD=e=>e.startsWith("on")?!o1(e):t(e))}try{ND(require("@emotion/is-prop-valid").default)}catch{}function fse(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||ts(t[s])||(MD(s)||n===!0&&o1(s)||!e&&!o1(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function hse({children:t,isValidProp:e,...n}){e&&ND(e);const r=g.useContext(nm);n={...r,...n},n.transition=Gk(n.transition,r.transition),n.isStatic=V1(()=>n.isStatic);const s=g.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return S.jsx(nm.Provider,{value:s,children:t})}const K1=g.createContext({});function pse(t,e){if(W1(t)){const{initial:n,animate:r}=t;return{initial:n===!1||em(n)?n:void 0,animate:em(r)?r:void 0}}return t.inherit!==!1?e:{}}function mse(t){const{initial:e,animate:n}=pse(t,g.useContext(K1));return g.useMemo(()=>({initial:e,animate:n}),[vA(e),vA(n)])}function vA(t){return Array.isArray(t)?t.join(" "):t}const cE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LD(t,e,n){for(const r in e)!ts(e[r])&&!pD(r,n)&&(t[r]=e[r])}function gse({transformTemplate:t},e){return g.useMemo(()=>{const n=cE();return aE(n,e,t),Object.assign({},n.vars,n.style)},[e])}function vse(t,e){const n=t.style||{},r={};return LD(r,n,t),Object.assign(r,gse(t,e)),r}function yse(t,e){const n={},r=vse(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const DD=()=>({...cE(),attrs:{}});function _se(t,e,n,r){const s=g.useMemo(()=>{const i=DD();return mD(i,e,vD(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};LD(i,t.style,t),s.style={...i,...s.style}}return s}const wse=["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 uE(t){return typeof t!="string"||t.includes("-")?!1:!!(wse.indexOf(t)>-1||/[A-Z]/u.test(t))}function bse(t,e,n,{latestValues:r},s,i=!1,o){const c=(o??uE(t)?_se:yse)(e,r,s,t),d=fse(e,typeof t=="string",i),f=t!==g.Fragment?{...d,...c,ref:n}:{},{children:h}=e,m=g.useMemo(()=>ts(h)?h.get():h,[h]);return g.createElement(t,{...f,children:m})}function xse({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:Sse(n,r,s,t),renderState:e()}}function Sse(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Qg(i[m]);let{initial:o,animate:l}=t;const c=W1(t),d=iD(t);e&&d&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const h=f?l:o;if(h&&typeof h!="boolean"&&!Z1(h)){const m=Array.isArray(h)?h:[h];for(let v=0;v<m.length;v++){const y=Qk(t,m[v]);if(y){const{transitionEnd:_,transition:b,...x}=y;for(const k in x){let C=x[k];if(Array.isArray(C)){const P=f?C.length-1:0;C=C[P]}C!==null&&(s[k]=C)}for(const k in _)s[k]=_[k]}}}return s}const $D=t=>(e,n)=>{const r=g.useContext(K1),s=g.useContext(H1),i=()=>xse(t,e,r,s);return n?i():V1(i)},kse=$D({scrapeMotionValuesFromProps:lE,createRenderState:cE}),Ese=$D({scrapeMotionValuesFromProps:yD,createRenderState:DD}),Cse=Symbol.for("motionComponentSymbol");function Pse(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const c=o(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const FD=g.createContext({});function Nd(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Tse(t,e,n,r,s,i){var C,P;const{visualElement:o}=g.useContext(K1),l=g.useContext(ID),c=g.useContext(H1),d=g.useContext(nm),f=d.reducedMotion,h=d.skipAnimations,m=g.useRef(null),v=g.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f,skipAnimations:h,isSVG:i}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const y=m.current,_=g.useContext(FD);y&&!y.projection&&s&&(y.type==="html"||y.type==="svg")&&Rse(m.current,n,s,_);const b=g.useRef(!1);g.useInsertionEffect(()=>{y&&b.current&&y.update(n,c)});const x=n[KL],k=g.useRef(!!x&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,x))&&((P=window.MotionHasOptimisedAnimation)==null?void 0:P.call(window,x)));return $k(()=>{v.current=!0,y&&(b.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),k.current&&y.animationState&&y.animationState.animateChanges())}),g.useEffect(()=>{y&&(!k.current&&y.animationState&&y.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,x)}),k.current=!1),y.enteringChildren=void 0)}),y}function Rse(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d,layoutAnchor:f,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:jD(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&Nd(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:c,layoutRoot:d,layoutAnchor:f})}function jD(t){if(t)return t.options.allowProjection!==!1?t.projection:jD(t.parent)}function uw(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&use(r);const i=n?n==="svg":uE(t),o=i?Ese:kse;function l(d,f){let h;const m={...g.useContext(nm),...d,layoutId:Ase(d)},{isStatic:v}=m,y=mse(d),_=o(d,v);if(!v&&typeof window<"u"){Ise();const b=Ose(m);h=b.MeasureLayout,y.visualElement=Tse(t,_,m,s,b.ProjectionNode,i)}return S.jsxs(K1.Provider,{value:y,children:[h&&y.visualElement?S.jsx(h,{visualElement:y.visualElement,...m}):null,bse(t,d,Pse(_,y.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=g.forwardRef(l);return c[Cse]=t,c}function Ase({layoutId:t}){const e=g.useContext(Dk).id;return e&&t!==void 0?e+"-"+t:t}function Ise(t,e){g.useContext(ID).strict}function Ose(t){const e=OD(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Mse(t,e){if(typeof Proxy>"u")return uw;const n=new Map,r=(i,o)=>uw(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,uw(o,void 0,t,e)),n.get(o))})}const Nse=(t,e)=>e.isSVG??uE(t)?new ure(e):new sre(e,{allowProjection:t!==g.Fragment});class Lse extends wc{constructor(e){super(e),e.animationState||(e.animationState=mre(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Z1(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Dse=0;class $se extends wc{constructor(){super(...arguments),this.id=Dse++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=ku(this.node,o,l);if(c){const{transition:d,transitionEnd:f,...h}=c;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Fse={animation:{Feature:Lse},exit:{Feature:$se}};function Dm(t){return{point:{x:t.pageX,y:t.pageY}}}const jse=t=>e=>nE(e)&&t(e,Dm(e));function Rp(t,e,n,r){return tm(t,e,jse(n),r)}const zD=({current:t})=>t?t.ownerDocument.defaultView:null,yA=(t,e)=>Math.abs(t-e);function zse(t,e){const n=yA(t.x,e.x),r=yA(t.y,e.y);return Math.sqrt(n**2+r**2)}const _A=new Set(["auto","scroll"]);class VD{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=pg(this.lastRawMoveEventInfo,this.transformPagePoint));const y=dw(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=zse(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:x}=y,{timestamp:k}=Qr;this.history.push({...x,timestamp:k});const{onStart:C,onMove:P}=this.handlers;_||(C&&C(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,y)},this.handlePointerMove=(y,_)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=pg(_,this.transformPagePoint),Cn.update(this.updatePoint,!0)},this.handlePointerUp=(y,_)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=dw(y.type==="pointercancel"?this.lastMoveEventInfo:pg(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(y,C),x&&x(y,C)},!nE(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=Dm(e),d=pg(c,this.transformPagePoint),{point:f}=d,{timestamp:h}=Qr;this.history=[{...f,timestamp:h}];const{onSessionStart:m}=n;m&&m(e,dw(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Mm(Rp(this.contextWindow,"pointermove",this.handlePointerMove,v),Rp(this.contextWindow,"pointerup",this.handlePointerUp,v),Rp(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(_A.has(r.overflowX)||_A.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),Cn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),uc(this.updatePoint)}}function pg(t,e){return e?{point:e(t.point)}:t}function wA(t,e){return{x:t.x-e.x,y:t.y-e.y}}function dw({point:t},e){return{point:t,delta:wA(t,HD(e)),offset:wA(t,Vse(e)),velocity:Hse(e,.1)}}function Vse(t){return t[0]}function HD(t){return t[t.length-1]}function Hse(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=HD(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>ki(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>ki(e)*2&&(r=t[1]);const i=qi(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 Use(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?En(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?En(n,t,r.max):Math.min(t,n)),t}function bA(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Bse(t,{top:e,left:n,bottom:r,right:s}){return{x:bA(t.x,n,s),y:bA(t.y,e,r)}}function xA(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Zse(t,e){return{x:xA(t.x,e.x),y:xA(t.y,e.y)}}function Wse(t,e){let n=.5;const r=Ls(t),s=Ls(e);return s>r?n=Qp(e.min,e.max-r,t.min):r>s&&(n=Qp(t.min,t.max-s,e.min)),ca(0,1,n)}function Kse(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Fx=.35;function qse(t=Fx){return t===!1?t=0:t===!0&&(t=Fx),{x:SA(t,"left","right"),y:SA(t,"top","bottom")}}function SA(t,e,n){return{min:kA(t,e),max:kA(t,n)}}function kA(t,e){return typeof t=="number"?t:t[e]||0}const Gse=new WeakMap;class Yse{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ar(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(Dm(h).point),this.stopAnimation()},o=(h,m)=>{const{drag:v,dragPropagation:y,onDragStart:_}=this.getProps();if(v&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=kne(v),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Uo(x=>{let k=this.getAxisMotionValue(x).get()||0;if(ra.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[x];P&&(k=Ls(P)*(parseFloat(k)/100))}}this.originPoint[x]=k}),_&&Cn.update(()=>_(h,m),!1,!0),Rx(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:y,onDirectionLock:_,onDrag:b}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:x}=m;if(y&&this.currentDirection===null){this.currentDirection=Qse(x),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",m.point,x),this.updateAxis("y",m.point,x),this.visualElement.render(),b&&Cn.update(()=>b(h,m),!1,!0)},c=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new VD(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:zD(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Cn.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!mg(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Use(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&Nd(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Bse(r.layoutBox,e):this.constraints=!1,this.elastic=qse(n),s!==this.constraints&&!Nd(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Uo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Kse(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Nd(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=Qne(r,s.root,this.visualElement.getTransformPagePoint());let o=Zse(s.layout.layoutBox,i);if(n){const l=n(Gne(o));this.hasMutatedConstraints=!!l,l&&(o=cD(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=Uo(f=>{if(!mg(f,n,this.currentDirection))return;let h=c&&c[f]||{};(o===!0||o===f)&&(h={min:0,max:0});const m=s?200:1e6,v=s?40:1e7,y={type:"inertia",velocity:r?e[f]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(f,y)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Rx(this.visualElement,e),r.start(Xk(e,r,0,n,this.visualElement,!1))}stopAnimation(){Uo(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Uo(n=>{const{drag:r}=this.getProps();if(!mg(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-En(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Nd(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Uo(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Wse({min:c,max:c},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(),Uo(o=>{if(!mg(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(En(c,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Gse.set(this.visualElement,this);const e=this.visualElement.current,n=Rp(e,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps(),m=d.target,v=m!==e&&Ane(m);f&&h&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Nd(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Xse(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Cn.read(s);const l=tm(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Uo(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Fx,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function EA(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Xse(t,e,n){const r=OR(t,EA(n)),s=OR(e,EA(n));return()=>{r(),s()}}function mg(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Qse(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Jse extends wc{constructor(e){super(e),this.removeGroupControls=Ji,this.removeListeners=Ji,this.controls=new Yse(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ji}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const fw=t=>(e,n)=>{t&&Cn.update(()=>t(e,n),!1,!0)};class eie extends wc{constructor(){super(...arguments),this.removePointerDownListener=Ji}onPointerDown(e){this.session=new VD(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zD(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:fw(e),onStart:fw(n),onMove:fw(r),onEnd:(i,o)=>{delete this.session,s&&Cn.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Rp(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let hw=!1;class tie extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),hw&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),hw=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Cn.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),tE.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;hw=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function UD(t){const[e,n]=AD(),r=g.useContext(Dk);return S.jsx(tie,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(FD),isPresent:e,safeToRemove:n})}const nie={pan:{Feature:eie},drag:{Feature:Jse,ProjectionNode:RD,MeasureLayout:UD}};function CA(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Cn.postRender(()=>i(e,Dm(e)))}class rie extends wc{mount(){const{current:e}=this.node;e&&(this.unmount=Cne(e,(n,r)=>(CA(this.node,r,"Start"),s=>CA(this.node,s,"End"))))}unmount(){}}class sie extends wc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Mm(tm(this.node.current,"focus",()=>this.onFocus()),tm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function PA(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Cn.postRender(()=>i(e,Dm(e)))}class iie extends wc{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=One(e,(s,i)=>(PA(this.node,i,"Start"),(o,{success:l})=>PA(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const jx=new WeakMap,pw=new WeakMap,oie=t=>{const e=jx.get(t.target);e&&e(t)},aie=t=>{t.forEach(oie)};function lie({root:t,...e}){const n=t||document;pw.has(n)||pw.set(n,{});const r=pw.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(aie,{root:t,...e})),r[s]}function cie(t,e,n){const r=lie(e);return jx.set(t,n),r.observe(t),()=>{jx.delete(t),r.unobserve(t)}}const uie={some:0,all:1};class die extends wc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:uie[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),v=f?h:m;v&&v(d)};this.stopObserver=cie(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(fie(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function fie({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const hie={inView:{Feature:die},tap:{Feature:iie},focus:{Feature:sie},hover:{Feature:rie}},pie={layout:{ProjectionNode:RD,MeasureLayout:UD}},mie={...Fse,...hie,...nie,...pie},gie=Mse(mie,Nse);function vie(){!oE.current&&oD();const[t]=g.useState(n1.current);return t}const Nr=gie;var yie=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var _ie=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},gg,TA="__POSTHOG_REACT_SHARED_STATE__",RA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},rm;try{rm=RA[TA]=RA[TA]||new WeakMap}catch{rm=new WeakMap}rm.has(g.createContext)||rm.set(g.createContext,{});var Eu=rm.get(g.createContext),zx;function wie(t){(!Eu.defaultPostHogInstance||Eu.defaultPostHogInstance===zx)&&(Eu.defaultPostHogInstance=t),zx=t}function Vx(){return zx}Eu.context||(Eu.context=g.createContext({get client(){return Vx()||Eu.defaultPostHogInstance},bootstrap:void 0}));var dE=Eu.context;function BD(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!BD(t[l],e[l],n))return!1}return!0}function bie(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=g.useRef(null),c=g.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),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=Vx();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=Vx(),f=l.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!BD(o,f.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),Ce.createElement(dE.Provider,{value:{client:c,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var mw=function(t){return typeof t=="function"},xie=function(t){return t===void 0},Ii=function(){var t=g.useContext(dE).client;return t},ev=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},Sie=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},kie=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!ev(r.cause)){xie(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},Eie=function(t,e){if(!e)return t;var n=new Error(ev(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return Sie(n,"React ErrorBoundary ".concat(ev(t)?t.name:"Error")),n.stack=e,ev(t)?(kie(t,n),t):n},AA={componentStack:null,exceptionEvent:null,error:null},Cie={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},Pie=(gg=(function(t){yie(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(AA)},r.state=AA,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;mw(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,c=o.captureException(Eie(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:c})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return mw(r)?r():r;var o=mw(s)?Ce.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return Ce.isValidElement(o)?o:(console.warn(Cie.INVALID_FALLBACK),Ce.createElement(Ce.Fragment,null))},e})(Ce.Component),_ie(gg,"PostHogErrorBoundary"),(function(){gg.contextType=dE})(),gg);wie(Xe);const Tie="rivet-preview-bridge",Rie=["ArrowUp","ArrowDown"],Aie=new Set(["INPUT","TEXTAREA","SELECT"]),ZD=t=>!t||!("tagName"in t)||typeof t.tagName!="string"?!1:Aie.has(t.tagName.toUpperCase())||"isContentEditable"in t&&t.isContentEditable===!0,Iie=t=>typeof t!="object"||t===null||!("channel"in t)||t.channel!==Tie||!("direction"in t)||t.direction!=="event"||!("type"in t)||t.type!=="keydown"||!("key"in t)?null:Rie.find(e=>e===t.key)??null,Oie=t=>{try{return new URL(t.src,window.location.href).origin}catch{return null}},Mie=t=>t.source===null?null:Array.from(document.querySelectorAll("iframe")).find(e=>e.contentWindow===t.source&&Oie(e)===t.origin)??null,Nie=t=>{const e=n=>{ZD(n.target)||t(n)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},Lie=()=>{const t=e=>{const n=Iie(e.data),r=n?Mie(e):null;!n||!r||r.dispatchEvent(new KeyboardEvent("keydown",{key:n,bubbles:!0,cancelable:!0}))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)};var vg={},gw={exports:{}},Bs={},vw={exports:{}},yw={};/**
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 IA;function Die(){return IA||(IA=1,(function(t){function e(H,Q){var B=H.length;H.push(Q);e:for(;0<B;){var D=B-1>>>1,G=H[D];if(0<s(G,Q))H[D]=Q,H[B]=G,B=D;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var Q=H[0],B=H.pop();if(B!==Q){H[0]=B;e:for(var D=0,G=H.length,fe=G>>>1;D<fe;){var ie=2*(D+1)-1,ue=H[ie],he=ie+1,we=H[he];if(0>s(ue,B))he<G&&0>s(we,ue)?(H[D]=we,H[he]=B,D=he):(H[D]=ue,H[ie]=B,D=ie);else if(he<G&&0>s(we,B))H[D]=we,H[he]=B,D=he;else break e}}return Q}function s(H,Q){var B=H.sortIndex-Q.sortIndex;return B!==0?B:H.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],f=1,h=null,m=3,v=!1,y=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(H){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=H)r(d),Q.sortIndex=Q.expirationTime,e(c,Q);else break;Q=n(d)}}function P(H){if(_=!1,C(H),!y)if(n(c)!==null)y=!0,K(R);else{var Q=n(d);Q!==null&&ee(P,Q.startTime-H)}}function R(H,Q){y=!1,_&&(_=!1,x(A),A=-1),v=!0;var B=m;try{for(C(Q),h=n(c);h!==null&&(!(h.expirationTime>Q)||H&&!z());){var D=h.callback;if(typeof D=="function"){h.callback=null,m=h.priorityLevel;var G=D(h.expirationTime<=Q);Q=t.unstable_now(),typeof G=="function"?h.callback=G:h===n(c)&&r(c),C(Q)}else r(c);h=n(c)}if(h!==null)var fe=!0;else{var ie=n(d);ie!==null&&ee(P,ie.startTime-Q),fe=!1}return fe}finally{h=null,m=B,v=!1}}var O=!1,I=null,A=-1,M=5,L=-1;function z(){return!(t.unstable_now()-L<M)}function $(){if(I!==null){var H=t.unstable_now();L=H;var Q=!0;try{Q=I(!0,H)}finally{Q?q():(O=!1,I=null)}}else O=!1}var q;if(typeof k=="function")q=function(){k($)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,j=X.port2;X.port1.onmessage=$,q=function(){j.postMessage(null)}}else q=function(){b($,0)};function K(H){I=H,O||(O=!0,q())}function ee(H,Q){A=b(function(){H(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_continueExecution=function(){y||v||(y=!0,K(R))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(H){switch(m){case 1:case 2:case 3:var Q=3;break;default:Q=m}var B=m;m=Q;try{return H()}finally{m=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,Q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var B=m;m=H;try{return Q()}finally{m=B}},t.unstable_scheduleCallback=function(H,Q,B){var D=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?D+B:D):B=D,H){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=B+G,H={id:f++,callback:Q,priorityLevel:H,startTime:B,expirationTime:G,sortIndex:-1},B>D?(H.sortIndex=B,e(d,H),n(c)===null&&H===n(d)&&(_?(x(A),A=-1):_=!0,ee(P,B-D))):(H.sortIndex=G,e(c,H),y||v||(y=!0,K(R))),H},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(H){var Q=m;return function(){var B=m;m=Q;try{return H.apply(this,arguments)}finally{m=B}}}})(yw)),yw}var OA;function $ie(){return OA||(OA=1,vw.exports=Die()),vw.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 MA;function Fie(){if(MA)return Bs;MA=1;var t=HS(),e=$ie();function n(a){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)u+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; visit "+u+" 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,u){o(a,u),o(a+"Capture",u)}function o(a,u){for(s[a]=u,a=0;a<u.length;a++)r.add(u[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function m(a){return c.call(h,a)?!0:c.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function v(a,u,p,w){if(p!==null&&p.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function y(a,u,p,w){if(u===null||typeof u>"u"||v(a,u,p,w))return!0;if(w)return!1;if(p!==null)switch(p.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function _(a,u,p,w,E,T,N){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=E,this.mustUseProperty=p,this.propertyName=a,this.type=u,this.sanitizeURL=T,this.removeEmptyString=N}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){b[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var u=a[0];b[u]=new _(u,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){b[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){b[a]=new _(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){b[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){b[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){b[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){b[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){b[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function k(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var u=a.replace(x,k);b[u]=new _(u,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var u=a.replace(x,k);b[u]=new _(u,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var u=a.replace(x,k);b[u]=new _(u,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){b[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){b[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,u,p,w){var E=b.hasOwnProperty(u)?b[u]:null;(E!==null?E.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(y(u,p,E,w)&&(p=null),w||E===null?m(u)&&(p===null?a.removeAttribute(u):a.setAttribute(u,""+p)):E.mustUseProperty?a[E.propertyName]=p===null?E.type===3?!1:"":p:(u=E.attributeName,w=E.attributeNamespace,p===null?a.removeAttribute(u):(E=E.type,p=E===3||E===4&&p===!0?"":""+p,w?a.setAttributeNS(w,u,p):a.setAttribute(u,p))))}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),O=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),z=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),H=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=H&&a[H]||a["@@iterator"],typeof a=="function"?a:null)}var B=Object.assign,D;function G(a){if(D===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);D=u&&u[1]||""}return`
102
- `+D+a}var fe=!1;function ie(a,u){if(!a||fe)return"";fe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(oe){var w=oe}Reflect.construct(a,[],u)}else{try{u.call()}catch(oe){w=oe}a.call(u.prototype)}else{try{throw Error()}catch(oe){w=oe}a()}}catch(oe){if(oe&&w&&typeof oe.stack=="string"){for(var E=oe.stack.split(`
103
- `),T=w.stack.split(`
104
- `),N=E.length-1,Z=T.length-1;1<=N&&0<=Z&&E[N]!==T[Z];)Z--;for(;1<=N&&0<=Z;N--,Z--)if(E[N]!==T[Z]){if(N!==1||Z!==1)do if(N--,Z--,0>Z||E[N]!==T[Z]){var Y=`
105
- `+E[N].replace(" at new "," at ");return a.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",a.displayName)),Y}while(1<=N&&0<=Z);break}}}finally{fe=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?G(a):""}function ue(a){switch(a.tag){case 5:return G(a.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return a=ie(a.type,!1),a;case 11:return a=ie(a.type.render,!1),a;case 1:return a=ie(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 I:return"Fragment";case O:return"Portal";case M:return"Profiler";case A:return"StrictMode";case q:return"Suspense";case X:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case z:return(a.displayName||"Context")+".Consumer";case L:return(a._context.displayName||"Context")+".Provider";case $:var u=a.render;return a=a.displayName,a||(a=u.displayName||u.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case j:return u=a.displayName||null,u!==null?u:he(a.type)||"Memo";case K:u=a._payload,a=a._init;try{return he(a(u))}catch{}}return null}function we(a){var u=a.type;switch(a.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=u.render,a=a.displayName||a.name||"",u.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(u);case 8:return u===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 u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function le(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function se(a){var u=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function be(a){var u=se(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,u),w=""+a[u];if(!a.hasOwnProperty(u)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var E=p.get,T=p.set;return Object.defineProperty(a,u,{configurable:!0,get:function(){return E.call(this)},set:function(N){w=""+N,T.call(this,N)}}),Object.defineProperty(a,u,{enumerable:p.enumerable}),{getValue:function(){return w},setValue:function(N){w=""+N},stopTracking:function(){a._valueTracker=null,delete a[u]}}}}function Se(a){a._valueTracker||(a._valueTracker=be(a))}function $e(a){if(!a)return!1;var u=a._valueTracker;if(!u)return!0;var p=u.getValue(),w="";return a&&(w=se(a)?a.checked?"true":"false":a.value),a=w,a!==p?(u.setValue(a),!0):!1}function kt(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 tn(a,u){var p=u.checked;return B({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function nn(a,u){var p=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;p=le(u.value!=null?u.value:p),a._wrapperState={initialChecked:w,initialValue:p,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function xt(a,u){u=u.checked,u!=null&&C(a,"checked",u,!1)}function Dt(a,u){xt(a,u);var p=le(u.value),w=u.type;if(p!=null)w==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(w==="submit"||w==="reset"){a.removeAttribute("value");return}u.hasOwnProperty("value")?Kt(a,u.type,p):u.hasOwnProperty("defaultValue")&&Kt(a,u.type,le(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(a.defaultChecked=!!u.defaultChecked)}function un(a,u,p){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var w=u.type;if(!(w!=="submit"&&w!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+a._wrapperState.initialValue,p||u===a.value||(a.value=u),a.defaultValue=u}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function Kt(a,u,p){(u!=="number"||kt(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var Le=Array.isArray;function Qe(a,u,p,w){if(a=a.options,u){u={};for(var E=0;E<p.length;E++)u["$"+p[E]]=!0;for(p=0;p<a.length;p++)E=u.hasOwnProperty("$"+a[p].value),a[p].selected!==E&&(a[p].selected=E),E&&w&&(a[p].defaultSelected=!0)}else{for(p=""+le(p),u=null,E=0;E<a.length;E++){if(a[E].value===p){a[E].selected=!0,w&&(a[E].defaultSelected=!0);return}u!==null||a[E].disabled||(u=a[E])}u!==null&&(u.selected=!0)}}function Ae(a,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},u,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Ct(a,u){var p=u.value;if(p==null){if(p=u.children,u=u.defaultValue,p!=null){if(u!=null)throw Error(n(92));if(Le(p)){if(1<p.length)throw Error(n(93));p=p[0]}u=p}u==null&&(u=""),p=u}a._wrapperState={initialValue:le(p)}}function ke(a,u){var p=le(u.value),w=le(u.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),u.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),w!=null&&(a.defaultValue=""+w)}function $t(a){var u=a.textContent;u===a._wrapperState.initialValue&&u!==""&&u!==null&&(a.value=u)}function ft(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 pt(a,u){return a==null||a==="http://www.w3.org/1999/xhtml"?ft(u):a==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var tr,Mi=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,p,w,E){MSApp.execUnsafeLocalFunction(function(){return a(u,p,w,E)})}:a})(function(a,u){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=u;else{for(tr=tr||document.createElement("div"),tr.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=tr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;u.firstChild;)a.appendChild(u.firstChild)}});function Pn(a,u){if(u){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=u;return}}a.textContent=u}var lr={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},no=["Webkit","ms","Moz","O"];Object.keys(lr).forEach(function(a){no.forEach(function(u){u=u+a.charAt(0).toUpperCase()+a.substring(1),lr[u]=lr[a]})});function xs(a,u,p){return u==null||typeof u=="boolean"||u===""?"":p||typeof u!="number"||u===0||lr.hasOwnProperty(a)&&lr[a]?(""+u).trim():u+"px"}function ss(a,u){a=a.style;for(var p in u)if(u.hasOwnProperty(p)){var w=p.indexOf("--")===0,E=xs(p,u[p],w);p==="float"&&(p="cssFloat"),w?a.setProperty(p,E):a[p]=E}}var nr=B({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 vn(a,u){if(u){if(nr[a]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function is(a,u){if(a.indexOf("-")===-1)return typeof u.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 pr=null;function Eo(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Kr=null,rr=null,Lr=null;function li(a){if(a=gh(a)){if(typeof Kr!="function")throw Error(n(280));var u=a.stateNode;u&&(u=i0(u),Kr(a.stateNode,a.type,u))}}function cr(a){rr?Lr?Lr.push(a):Lr=[a]:rr=a}function Ss(){if(rr){var a=rr,u=Lr;if(Lr=rr=null,li(a),u)for(a=0;a<u.length;a++)li(u[a])}}function st(a,u){return a(u)}function cn(){}var rn=!1;function yn(a,u,p){if(rn)return a(u,p);rn=!0;try{return st(a,u,p)}finally{rn=!1,(rr!==null||Lr!==null)&&(cn(),Ss())}}function Tn(a,u){var p=a.stateNode;if(p===null)return null;var w=i0(p);if(w===null)return null;p=w[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(a=a.type,w=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!w;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,u,typeof p));return p}var qt=!1;if(l)try{var $n={};Object.defineProperty($n,"passive",{get:function(){qt=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{qt=!1}function os(a,u,p,w,E,T,N,Z,Y){var oe=Array.prototype.slice.call(arguments,3);try{u.apply(p,oe)}catch(_e){this.onError(_e)}}var sr=!1,kr=null,Ut=!1,Ni=null,rh={onError:function(a){sr=!0,kr=a}};function il(a,u,p,w,E,T,N,Z,Y){sr=!1,kr=null,os.apply(rh,arguments)}function Co(a,u,p,w,E,T,N,Z,Y){if(il.apply(this,arguments),sr){if(sr){var oe=kr;sr=!1,kr=null}else throw Error(n(198));Ut||(Ut=!0,Ni=oe)}}function Dr(a){var u=a,p=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do u=a,(u.flags&4098)!==0&&(p=u.return),a=u.return;while(a)}return u.tag===3?p:null}function Li(a){if(a.tag===13){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function Ds(a){if(Dr(a)!==a)throw Error(n(188))}function ro(a){var u=a.alternate;if(!u){if(u=Dr(a),u===null)throw Error(n(188));return u!==a?null:a}for(var p=a,w=u;;){var E=p.return;if(E===null)break;var T=E.alternate;if(T===null){if(w=E.return,w!==null){p=w;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===p)return Ds(E),a;if(T===w)return Ds(E),u;T=T.sibling}throw Error(n(188))}if(p.return!==w.return)p=E,w=T;else{for(var N=!1,Z=E.child;Z;){if(Z===p){N=!0,p=E,w=T;break}if(Z===w){N=!0,w=E,p=T;break}Z=Z.sibling}if(!N){for(Z=T.child;Z;){if(Z===p){N=!0,p=T,w=E;break}if(Z===w){N=!0,w=T,p=E;break}Z=Z.sibling}if(!N)throw Error(n(189))}}if(p.alternate!==w)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:u}function $s(a){return a=ro(a),a!==null?ol(a):null}function ol(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var u=ol(a);if(u!==null)return u;a=a.sibling}return null}var ci=e.unstable_scheduleCallback,Cc=e.unstable_cancelCallback,Uu=e.unstable_shouldYield,al=e.unstable_requestPaint,dn=e.unstable_now,Po=e.unstable_getCurrentPriorityLevel,ui=e.unstable_ImmediatePriority,To=e.unstable_UserBlockingPriority,qr=e.unstable_NormalPriority,Pc=e.unstable_LowPriority,Tc=e.unstable_IdlePriority,ma=null,as=null;function Bu(a){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(ma,a,void 0,(a.current.flags&128)===128)}catch{}}var ks=Math.clz32?Math.clz32:Ro,sh=Math.log,Zu=Math.LN2;function Ro(a){return a>>>=0,a===0?32:31-(sh(a)/Zu|0)|0}var Ao=64,F=4194304;function pe(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 ge(a,u){var p=a.pendingLanes;if(p===0)return 0;var w=0,E=a.suspendedLanes,T=a.pingedLanes,N=p&268435455;if(N!==0){var Z=N&~E;Z!==0?w=pe(Z):(T&=N,T!==0&&(w=pe(T)))}else N=p&~E,N!==0?w=pe(N):T!==0&&(w=pe(T));if(w===0)return 0;if(u!==0&&u!==w&&(u&E)===0&&(E=w&-w,T=u&-u,E>=T||E===16&&(T&4194240)!==0))return u;if((w&4)!==0&&(w|=p&16),u=a.entangledLanes,u!==0)for(a=a.entanglements,u&=w;0<u;)p=31-ks(u),E=1<<p,w|=a[p],u&=~E;return w}function Ee(a,u){switch(a){case 1:case 2:case 4:return u+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 u+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 Ze(a,u){for(var p=a.suspendedLanes,w=a.pingedLanes,E=a.expirationTimes,T=a.pendingLanes;0<T;){var N=31-ks(T),Z=1<<N,Y=E[N];Y===-1?((Z&p)===0||(Z&w)!==0)&&(E[N]=Ee(Z,u)):Y<=u&&(a.expiredLanes|=Z),T&=~Z}}function yt(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function mt(){var a=Ao;return Ao<<=1,(Ao&4194240)===0&&(Ao=64),a}function jt(a){for(var u=[],p=0;31>p;p++)u.push(a);return u}function Qt(a,u,p){a.pendingLanes|=u,u!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,u=31-ks(u),a[u]=p}function _t(a,u){var p=a.pendingLanes&~u;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=u,a.mutableReadLanes&=u,a.entangledLanes&=u,u=a.entanglements;var w=a.eventTimes;for(a=a.expirationTimes;0<p;){var E=31-ks(p),T=1<<E;u[E]=0,w[E]=-1,a[E]=-1,p&=~T}}function Fn(a,u){var p=a.entangledLanes|=u;for(a=a.entanglements;p;){var w=31-ks(p),E=1<<w;E&u|a[w]&u&&(a[w]|=u),p&=~E}}var it=0;function $r(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var ll,Io,Er,ga,Wu,Ku=!1,Rc=[],U=null,ae=null,Oe=null,Pe=new Map,Ie=new Map,De=[],Pt="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 ut(a,u){switch(a){case"focusin":case"focusout":U=null;break;case"dragenter":case"dragleave":ae=null;break;case"mouseover":case"mouseout":Oe=null;break;case"pointerover":case"pointerout":Pe.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ie.delete(u.pointerId)}}function gt(a,u,p,w,E,T){return a===null||a.nativeEvent!==T?(a={blockedOn:u,domEventName:p,eventSystemFlags:w,nativeEvent:T,targetContainers:[E]},u!==null&&(u=gh(u),u!==null&&Io(u)),a):(a.eventSystemFlags|=w,u=a.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),a)}function Cr(a,u,p,w,E){switch(u){case"focusin":return U=gt(U,a,u,p,w,E),!0;case"dragenter":return ae=gt(ae,a,u,p,w,E),!0;case"mouseover":return Oe=gt(Oe,a,u,p,w,E),!0;case"pointerover":var T=E.pointerId;return Pe.set(T,gt(Pe.get(T)||null,a,u,p,w,E)),!0;case"gotpointercapture":return T=E.pointerId,Ie.set(T,gt(Ie.get(T)||null,a,u,p,w,E)),!0}return!1}function ls(a){var u=Ac(a.target);if(u!==null){var p=Dr(u);if(p!==null){if(u=p.tag,u===13){if(u=Li(p),u!==null){a.blockedOn=u,Wu(a.priority,function(){Er(p)});return}}else if(u===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Es(a){if(a.blockedOn!==null)return!1;for(var u=a.targetContainers;0<u.length;){var p=Sy(a.domEventName,a.eventSystemFlags,u[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var w=new p.constructor(p.type,p);pr=w,p.target.dispatchEvent(w),pr=null}else return u=gh(p),u!==null&&Io(u),a.blockedOn=p,!1;u.shift()}return!0}function Fs(a,u,p){Es(a)&&p.delete(u)}function sn(){Ku=!1,U!==null&&Es(U)&&(U=null),ae!==null&&Es(ae)&&(ae=null),Oe!==null&&Es(Oe)&&(Oe=null),Pe.forEach(Fs),Ie.forEach(Fs)}function Tt(a,u){a.blockedOn===u&&(a.blockedOn=null,Ku||(Ku=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sn)))}function Oo(a){function u(E){return Tt(E,a)}if(0<Rc.length){Tt(Rc[0],a);for(var p=1;p<Rc.length;p++){var w=Rc[p];w.blockedOn===a&&(w.blockedOn=null)}}for(U!==null&&Tt(U,a),ae!==null&&Tt(ae,a),Oe!==null&&Tt(Oe,a),Pe.forEach(u),Ie.forEach(u),p=0;p<De.length;p++)w=De[p],w.blockedOn===a&&(w.blockedOn=null);for(;0<De.length&&(p=De[0],p.blockedOn===null);)ls(p),p.blockedOn===null&&De.shift()}var Di=P.ReactCurrentBatchConfig,Wm=!0;function Hz(a,u,p,w){var E=it,T=Di.transition;Di.transition=null;try{it=1,xy(a,u,p,w)}finally{it=E,Di.transition=T}}function Uz(a,u,p,w){var E=it,T=Di.transition;Di.transition=null;try{it=4,xy(a,u,p,w)}finally{it=E,Di.transition=T}}function xy(a,u,p,w){if(Wm){var E=Sy(a,u,p,w);if(E===null)zy(a,u,w,Km,p),ut(a,w);else if(Cr(E,a,u,p,w))w.stopPropagation();else if(ut(a,w),u&4&&-1<Pt.indexOf(a)){for(;E!==null;){var T=gh(E);if(T!==null&&ll(T),T=Sy(a,u,p,w),T===null&&zy(a,u,w,Km,p),T===E)break;E=T}E!==null&&w.stopPropagation()}else zy(a,u,w,null,p)}}var Km=null;function Sy(a,u,p,w){if(Km=null,a=Eo(w),a=Ac(a),a!==null)if(u=Dr(a),u===null)a=null;else if(p=u.tag,p===13){if(a=Li(u),a!==null)return a;a=null}else if(p===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;a=null}else u!==a&&(a=null);return Km=a,null}function O6(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(Po()){case ui:return 1;case To:return 4;case qr:case Pc:return 16;case Tc:return 536870912;default:return 16}default:return 16}}var cl=null,ky=null,qm=null;function M6(){if(qm)return qm;var a,u=ky,p=u.length,w,E="value"in cl?cl.value:cl.textContent,T=E.length;for(a=0;a<p&&u[a]===E[a];a++);var N=p-a;for(w=1;w<=N&&u[p-w]===E[T-w];w++);return qm=E.slice(a,1<w?1-w:void 0)}function Gm(a){var u=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&u===13&&(a=13)):a=u,a===10&&(a=13),32<=a||a===13?a:0}function Ym(){return!0}function N6(){return!1}function di(a){function u(p,w,E,T,N){this._reactName=p,this._targetInst=E,this.type=w,this.nativeEvent=T,this.target=N,this.currentTarget=null;for(var Z in a)a.hasOwnProperty(Z)&&(p=a[Z],this[Z]=p?p(T):T[Z]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Ym:N6,this.isPropagationStopped=N6,this}return B(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Ym)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Ym)},persist:function(){},isPersistent:Ym}),u}var qu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ey=di(qu),ih=B({},qu,{view:0,detail:0}),Bz=di(ih),Cy,Py,oh,Xm=B({},ih,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ry,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!==oh&&(oh&&a.type==="mousemove"?(Cy=a.screenX-oh.screenX,Py=a.screenY-oh.screenY):Py=Cy=0,oh=a),Cy)},movementY:function(a){return"movementY"in a?a.movementY:Py}}),L6=di(Xm),Zz=B({},Xm,{dataTransfer:0}),Wz=di(Zz),Kz=B({},ih,{relatedTarget:0}),Ty=di(Kz),qz=B({},qu,{animationName:0,elapsedTime:0,pseudoElement:0}),Gz=di(qz),Yz=B({},qu,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Xz=di(Yz),Qz=B({},qu,{data:0}),D6=di(Qz),Jz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eV={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"},tV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nV(a){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(a):(a=tV[a])?!!u[a]:!1}function Ry(){return nV}var rV=B({},ih,{key:function(a){if(a.key){var u=Jz[a.key]||a.key;if(u!=="Unidentified")return u}return a.type==="keypress"?(a=Gm(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?eV[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ry,charCode:function(a){return a.type==="keypress"?Gm(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Gm(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),sV=di(rV),iV=B({},Xm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$6=di(iV),oV=B({},ih,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ry}),aV=di(oV),lV=B({},qu,{propertyName:0,elapsedTime:0,pseudoElement:0}),cV=di(lV),uV=B({},Xm,{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}),dV=di(uV),fV=[9,13,27,32],Ay=l&&"CompositionEvent"in window,ah=null;l&&"documentMode"in document&&(ah=document.documentMode);var hV=l&&"TextEvent"in window&&!ah,F6=l&&(!Ay||ah&&8<ah&&11>=ah),j6=" ",z6=!1;function V6(a,u){switch(a){case"keyup":return fV.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function H6(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Gu=!1;function pV(a,u){switch(a){case"compositionend":return H6(u);case"keypress":return u.which!==32?null:(z6=!0,j6);case"textInput":return a=u.data,a===j6&&z6?null:a;default:return null}}function mV(a,u){if(Gu)return a==="compositionend"||!Ay&&V6(a,u)?(a=M6(),qm=ky=cl=null,Gu=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return F6&&u.locale!=="ko"?null:u.data;default:return null}}var gV={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 U6(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u==="input"?!!gV[a.type]:u==="textarea"}function B6(a,u,p,w){cr(w),u=n0(u,"onChange"),0<u.length&&(p=new Ey("onChange","change",null,p,w),a.push({event:p,listeners:u}))}var lh=null,ch=null;function vV(a){lC(a,0)}function Qm(a){var u=ed(a);if($e(u))return a}function yV(a,u){if(a==="change")return u}var Z6=!1;if(l){var Iy;if(l){var Oy="oninput"in document;if(!Oy){var W6=document.createElement("div");W6.setAttribute("oninput","return;"),Oy=typeof W6.oninput=="function"}Iy=Oy}else Iy=!1;Z6=Iy&&(!document.documentMode||9<document.documentMode)}function K6(){lh&&(lh.detachEvent("onpropertychange",q6),ch=lh=null)}function q6(a){if(a.propertyName==="value"&&Qm(ch)){var u=[];B6(u,ch,a,Eo(a)),yn(vV,u)}}function _V(a,u,p){a==="focusin"?(K6(),lh=u,ch=p,lh.attachEvent("onpropertychange",q6)):a==="focusout"&&K6()}function wV(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Qm(ch)}function bV(a,u){if(a==="click")return Qm(u)}function xV(a,u){if(a==="input"||a==="change")return Qm(u)}function SV(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var so=typeof Object.is=="function"?Object.is:SV;function uh(a,u){if(so(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var p=Object.keys(a),w=Object.keys(u);if(p.length!==w.length)return!1;for(w=0;w<p.length;w++){var E=p[w];if(!c.call(u,E)||!so(a[E],u[E]))return!1}return!0}function G6(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Y6(a,u){var p=G6(a);a=0;for(var w;p;){if(p.nodeType===3){if(w=a+p.textContent.length,a<=u&&w>=u)return{node:p,offset:u-a};a=w}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=G6(p)}}function X6(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?X6(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function Q6(){for(var a=window,u=kt();u instanceof a.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)a=u.contentWindow;else break;u=kt(a.document)}return u}function My(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}function kV(a){var u=Q6(),p=a.focusedElem,w=a.selectionRange;if(u!==p&&p&&p.ownerDocument&&X6(p.ownerDocument.documentElement,p)){if(w!==null&&My(p)){if(u=w.start,a=w.end,a===void 0&&(a=u),"selectionStart"in p)p.selectionStart=u,p.selectionEnd=Math.min(a,p.value.length);else if(a=(u=p.ownerDocument||document)&&u.defaultView||window,a.getSelection){a=a.getSelection();var E=p.textContent.length,T=Math.min(w.start,E);w=w.end===void 0?T:Math.min(w.end,E),!a.extend&&T>w&&(E=w,w=T,T=E),E=Y6(p,T);var N=Y6(p,w);E&&N&&(a.rangeCount!==1||a.anchorNode!==E.node||a.anchorOffset!==E.offset||a.focusNode!==N.node||a.focusOffset!==N.offset)&&(u=u.createRange(),u.setStart(E.node,E.offset),a.removeAllRanges(),T>w?(a.addRange(u),a.extend(N.node,N.offset)):(u.setEnd(N.node,N.offset),a.addRange(u)))}}for(u=[],a=p;a=a.parentNode;)a.nodeType===1&&u.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<u.length;p++)a=u[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var EV=l&&"documentMode"in document&&11>=document.documentMode,Yu=null,Ny=null,dh=null,Ly=!1;function J6(a,u,p){var w=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Ly||Yu==null||Yu!==kt(w)||(w=Yu,"selectionStart"in w&&My(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),dh&&uh(dh,w)||(dh=w,w=n0(Ny,"onSelect"),0<w.length&&(u=new Ey("onSelect","select",null,u,p),a.push({event:u,listeners:w}),u.target=Yu)))}function Jm(a,u){var p={};return p[a.toLowerCase()]=u.toLowerCase(),p["Webkit"+a]="webkit"+u,p["Moz"+a]="moz"+u,p}var Xu={animationend:Jm("Animation","AnimationEnd"),animationiteration:Jm("Animation","AnimationIteration"),animationstart:Jm("Animation","AnimationStart"),transitionend:Jm("Transition","TransitionEnd")},Dy={},eC={};l&&(eC=document.createElement("div").style,"AnimationEvent"in window||(delete Xu.animationend.animation,delete Xu.animationiteration.animation,delete Xu.animationstart.animation),"TransitionEvent"in window||delete Xu.transitionend.transition);function e0(a){if(Dy[a])return Dy[a];if(!Xu[a])return a;var u=Xu[a],p;for(p in u)if(u.hasOwnProperty(p)&&p in eC)return Dy[a]=u[p];return a}var tC=e0("animationend"),nC=e0("animationiteration"),rC=e0("animationstart"),sC=e0("transitionend"),iC=new Map,oC="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 ul(a,u){iC.set(a,u),i(u,[a])}for(var $y=0;$y<oC.length;$y++){var Fy=oC[$y],CV=Fy.toLowerCase(),PV=Fy[0].toUpperCase()+Fy.slice(1);ul(CV,"on"+PV)}ul(tC,"onAnimationEnd"),ul(nC,"onAnimationIteration"),ul(rC,"onAnimationStart"),ul("dblclick","onDoubleClick"),ul("focusin","onFocus"),ul("focusout","onBlur"),ul(sC,"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 fh="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(" "),TV=new Set("cancel close invalid load scroll toggle".split(" ").concat(fh));function aC(a,u,p){var w=a.type||"unknown-event";a.currentTarget=p,Co(w,u,void 0,a),a.currentTarget=null}function lC(a,u){u=(u&4)!==0;for(var p=0;p<a.length;p++){var w=a[p],E=w.event;w=w.listeners;e:{var T=void 0;if(u)for(var N=w.length-1;0<=N;N--){var Z=w[N],Y=Z.instance,oe=Z.currentTarget;if(Z=Z.listener,Y!==T&&E.isPropagationStopped())break e;aC(E,Z,oe),T=Y}else for(N=0;N<w.length;N++){if(Z=w[N],Y=Z.instance,oe=Z.currentTarget,Z=Z.listener,Y!==T&&E.isPropagationStopped())break e;aC(E,Z,oe),T=Y}}}if(Ut)throw a=Ni,Ut=!1,Ni=null,a}function On(a,u){var p=u[Wy];p===void 0&&(p=u[Wy]=new Set);var w=a+"__bubble";p.has(w)||(cC(u,a,2,!1),p.add(w))}function jy(a,u,p){var w=0;u&&(w|=4),cC(p,a,w,u)}var t0="_reactListening"+Math.random().toString(36).slice(2);function hh(a){if(!a[t0]){a[t0]=!0,r.forEach(function(p){p!=="selectionchange"&&(TV.has(p)||jy(p,!1,a),jy(p,!0,a))});var u=a.nodeType===9?a:a.ownerDocument;u===null||u[t0]||(u[t0]=!0,jy("selectionchange",!1,u))}}function cC(a,u,p,w){switch(O6(u)){case 1:var E=Hz;break;case 4:E=Uz;break;default:E=xy}p=E.bind(null,u,p,a),E=void 0,!qt||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),w?E!==void 0?a.addEventListener(u,p,{capture:!0,passive:E}):a.addEventListener(u,p,!0):E!==void 0?a.addEventListener(u,p,{passive:E}):a.addEventListener(u,p,!1)}function zy(a,u,p,w,E){var T=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var N=w.tag;if(N===3||N===4){var Z=w.stateNode.containerInfo;if(Z===E||Z.nodeType===8&&Z.parentNode===E)break;if(N===4)for(N=w.return;N!==null;){var Y=N.tag;if((Y===3||Y===4)&&(Y=N.stateNode.containerInfo,Y===E||Y.nodeType===8&&Y.parentNode===E))return;N=N.return}for(;Z!==null;){if(N=Ac(Z),N===null)return;if(Y=N.tag,Y===5||Y===6){w=T=N;continue e}Z=Z.parentNode}}w=w.return}yn(function(){var oe=T,_e=Eo(p),xe=[];e:{var ye=iC.get(a);if(ye!==void 0){var Fe=Ey,Ke=a;switch(a){case"keypress":if(Gm(p)===0)break e;case"keydown":case"keyup":Fe=sV;break;case"focusin":Ke="focus",Fe=Ty;break;case"focusout":Ke="blur",Fe=Ty;break;case"beforeblur":case"afterblur":Fe=Ty;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=L6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=Wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=aV;break;case tC:case nC:case rC:Fe=Gz;break;case sC:Fe=cV;break;case"scroll":Fe=Bz;break;case"wheel":Fe=dV;break;case"copy":case"cut":case"paste":Fe=Xz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=$6}var Ge=(u&4)!==0,ur=!Ge&&a==="scroll",te=Ge?ye!==null?ye+"Capture":null:ye;Ge=[];for(var J=oe,ne;J!==null;){ne=J;var Te=ne.stateNode;if(ne.tag===5&&Te!==null&&(ne=Te,te!==null&&(Te=Tn(J,te),Te!=null&&Ge.push(ph(J,Te,ne)))),ur)break;J=J.return}0<Ge.length&&(ye=new Fe(ye,Ke,null,p,_e),xe.push({event:ye,listeners:Ge}))}}if((u&7)===0){e:{if(ye=a==="mouseover"||a==="pointerover",Fe=a==="mouseout"||a==="pointerout",ye&&p!==pr&&(Ke=p.relatedTarget||p.fromElement)&&(Ac(Ke)||Ke[va]))break e;if((Fe||ye)&&(ye=_e.window===_e?_e:(ye=_e.ownerDocument)?ye.defaultView||ye.parentWindow:window,Fe?(Ke=p.relatedTarget||p.toElement,Fe=oe,Ke=Ke?Ac(Ke):null,Ke!==null&&(ur=Dr(Ke),Ke!==ur||Ke.tag!==5&&Ke.tag!==6)&&(Ke=null)):(Fe=null,Ke=oe),Fe!==Ke)){if(Ge=L6,Te="onMouseLeave",te="onMouseEnter",J="mouse",(a==="pointerout"||a==="pointerover")&&(Ge=$6,Te="onPointerLeave",te="onPointerEnter",J="pointer"),ur=Fe==null?ye:ed(Fe),ne=Ke==null?ye:ed(Ke),ye=new Ge(Te,J+"leave",Fe,p,_e),ye.target=ur,ye.relatedTarget=ne,Te=null,Ac(_e)===oe&&(Ge=new Ge(te,J+"enter",Ke,p,_e),Ge.target=ne,Ge.relatedTarget=ur,Te=Ge),ur=Te,Fe&&Ke)t:{for(Ge=Fe,te=Ke,J=0,ne=Ge;ne;ne=Qu(ne))J++;for(ne=0,Te=te;Te;Te=Qu(Te))ne++;for(;0<J-ne;)Ge=Qu(Ge),J--;for(;0<ne-J;)te=Qu(te),ne--;for(;J--;){if(Ge===te||te!==null&&Ge===te.alternate)break t;Ge=Qu(Ge),te=Qu(te)}Ge=null}else Ge=null;Fe!==null&&uC(xe,ye,Fe,Ge,!1),Ke!==null&&ur!==null&&uC(xe,ur,Ke,Ge,!0)}}e:{if(ye=oe?ed(oe):window,Fe=ye.nodeName&&ye.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&ye.type==="file")var Je=yV;else if(U6(ye))if(Z6)Je=xV;else{Je=wV;var at=_V}else(Fe=ye.nodeName)&&Fe.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(Je=bV);if(Je&&(Je=Je(a,oe))){B6(xe,Je,p,_e);break e}at&&at(a,ye,oe),a==="focusout"&&(at=ye._wrapperState)&&at.controlled&&ye.type==="number"&&Kt(ye,"number",ye.value)}switch(at=oe?ed(oe):window,a){case"focusin":(U6(at)||at.contentEditable==="true")&&(Yu=at,Ny=oe,dh=null);break;case"focusout":dh=Ny=Yu=null;break;case"mousedown":Ly=!0;break;case"contextmenu":case"mouseup":case"dragend":Ly=!1,J6(xe,p,_e);break;case"selectionchange":if(EV)break;case"keydown":case"keyup":J6(xe,p,_e)}var lt;if(Ay)e:{switch(a){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Gu?V6(a,p)&&(ht="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(ht="onCompositionStart");ht&&(F6&&p.locale!=="ko"&&(Gu||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Gu&&(lt=M6()):(cl=_e,ky="value"in cl?cl.value:cl.textContent,Gu=!0)),at=n0(oe,ht),0<at.length&&(ht=new D6(ht,a,null,p,_e),xe.push({event:ht,listeners:at}),lt?ht.data=lt:(lt=H6(p),lt!==null&&(ht.data=lt)))),(lt=hV?pV(a,p):mV(a,p))&&(oe=n0(oe,"onBeforeInput"),0<oe.length&&(_e=new D6("onBeforeInput","beforeinput",null,p,_e),xe.push({event:_e,listeners:oe}),_e.data=lt))}lC(xe,u)})}function ph(a,u,p){return{instance:a,listener:u,currentTarget:p}}function n0(a,u){for(var p=u+"Capture",w=[];a!==null;){var E=a,T=E.stateNode;E.tag===5&&T!==null&&(E=T,T=Tn(a,p),T!=null&&w.unshift(ph(a,T,E)),T=Tn(a,u),T!=null&&w.push(ph(a,T,E))),a=a.return}return w}function Qu(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function uC(a,u,p,w,E){for(var T=u._reactName,N=[];p!==null&&p!==w;){var Z=p,Y=Z.alternate,oe=Z.stateNode;if(Y!==null&&Y===w)break;Z.tag===5&&oe!==null&&(Z=oe,E?(Y=Tn(p,T),Y!=null&&N.unshift(ph(p,Y,Z))):E||(Y=Tn(p,T),Y!=null&&N.push(ph(p,Y,Z)))),p=p.return}N.length!==0&&a.push({event:u,listeners:N})}var RV=/\r\n?/g,AV=/\u0000|\uFFFD/g;function dC(a){return(typeof a=="string"?a:""+a).replace(RV,`
106
- `).replace(AV,"")}function r0(a,u,p){if(u=dC(u),dC(a)!==u&&p)throw Error(n(425))}function s0(){}var Vy=null,Hy=null;function Uy(a,u){return a==="textarea"||a==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var By=typeof setTimeout=="function"?setTimeout:void 0,IV=typeof clearTimeout=="function"?clearTimeout:void 0,fC=typeof Promise=="function"?Promise:void 0,OV=typeof queueMicrotask=="function"?queueMicrotask:typeof fC<"u"?function(a){return fC.resolve(null).then(a).catch(MV)}:By;function MV(a){setTimeout(function(){throw a})}function Zy(a,u){var p=u,w=0;do{var E=p.nextSibling;if(a.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"){if(w===0){a.removeChild(E),Oo(u);return}w--}else p!=="$"&&p!=="$?"&&p!=="$!"||w++;p=E}while(p);Oo(u)}function dl(a){for(;a!=null;a=a.nextSibling){var u=a.nodeType;if(u===1||u===3)break;if(u===8){if(u=a.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return a}function hC(a){a=a.previousSibling;for(var u=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(u===0)return a;u--}else p==="/$"&&u++}a=a.previousSibling}return null}var Ju=Math.random().toString(36).slice(2),Mo="__reactFiber$"+Ju,mh="__reactProps$"+Ju,va="__reactContainer$"+Ju,Wy="__reactEvents$"+Ju,NV="__reactListeners$"+Ju,LV="__reactHandles$"+Ju;function Ac(a){var u=a[Mo];if(u)return u;for(var p=a.parentNode;p;){if(u=p[va]||p[Mo]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(a=hC(a);a!==null;){if(p=a[Mo])return p;a=hC(a)}return u}a=p,p=a.parentNode}return null}function gh(a){return a=a[Mo]||a[va],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function ed(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function i0(a){return a[mh]||null}var Ky=[],td=-1;function fl(a){return{current:a}}function Mn(a){0>td||(a.current=Ky[td],Ky[td]=null,td--)}function Rn(a,u){td++,Ky[td]=a.current,a.current=u}var hl={},cs=fl(hl),js=fl(!1),Ic=hl;function nd(a,u){var p=a.type.contextTypes;if(!p)return hl;var w=a.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var E={},T;for(T in p)E[T]=u[T];return w&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=u,a.__reactInternalMemoizedMaskedChildContext=E),E}function zs(a){return a=a.childContextTypes,a!=null}function o0(){Mn(js),Mn(cs)}function pC(a,u,p){if(cs.current!==hl)throw Error(n(168));Rn(cs,u),Rn(js,p)}function mC(a,u,p){var w=a.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return p;w=w.getChildContext();for(var E in w)if(!(E in u))throw Error(n(108,we(a)||"Unknown",E));return B({},p,w)}function a0(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||hl,Ic=cs.current,Rn(cs,a),Rn(js,js.current),!0}function gC(a,u,p){var w=a.stateNode;if(!w)throw Error(n(169));p?(a=mC(a,u,Ic),w.__reactInternalMemoizedMergedChildContext=a,Mn(js),Mn(cs),Rn(cs,a)):Mn(js),Rn(js,p)}var ya=null,l0=!1,qy=!1;function vC(a){ya===null?ya=[a]:ya.push(a)}function DV(a){l0=!0,vC(a)}function pl(){if(!qy&&ya!==null){qy=!0;var a=0,u=it;try{var p=ya;for(it=1;a<p.length;a++){var w=p[a];do w=w(!0);while(w!==null)}ya=null,l0=!1}catch(E){throw ya!==null&&(ya=ya.slice(a+1)),ci(ui,pl),E}finally{it=u,qy=!1}}return null}var rd=[],sd=0,c0=null,u0=0,$i=[],Fi=0,Oc=null,_a=1,wa="";function Mc(a,u){rd[sd++]=u0,rd[sd++]=c0,c0=a,u0=u}function yC(a,u,p){$i[Fi++]=_a,$i[Fi++]=wa,$i[Fi++]=Oc,Oc=a;var w=_a;a=wa;var E=32-ks(w)-1;w&=~(1<<E),p+=1;var T=32-ks(u)+E;if(30<T){var N=E-E%5;T=(w&(1<<N)-1).toString(32),w>>=N,E-=N,_a=1<<32-ks(u)+E|p<<E|w,wa=T+a}else _a=1<<T|p<<E|w,wa=a}function Gy(a){a.return!==null&&(Mc(a,1),yC(a,1,0))}function Yy(a){for(;a===c0;)c0=rd[--sd],rd[sd]=null,u0=rd[--sd],rd[sd]=null;for(;a===Oc;)Oc=$i[--Fi],$i[Fi]=null,wa=$i[--Fi],$i[Fi]=null,_a=$i[--Fi],$i[Fi]=null}var fi=null,hi=null,jn=!1,io=null;function _C(a,u){var p=Hi(5,null,null,0);p.elementType="DELETED",p.stateNode=u,p.return=a,u=a.deletions,u===null?(a.deletions=[p],a.flags|=16):u.push(p)}function wC(a,u){switch(a.tag){case 5:var p=a.type;return u=u.nodeType!==1||p.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(a.stateNode=u,fi=a,hi=dl(u.firstChild),!0):!1;case 6:return u=a.pendingProps===""||u.nodeType!==3?null:u,u!==null?(a.stateNode=u,fi=a,hi=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(p=Oc!==null?{id:_a,overflow:wa}:null,a.memoizedState={dehydrated:u,treeContext:p,retryLane:1073741824},p=Hi(18,null,null,0),p.stateNode=u,p.return=a,a.child=p,fi=a,hi=null,!0):!1;default:return!1}}function Xy(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Qy(a){if(jn){var u=hi;if(u){var p=u;if(!wC(a,u)){if(Xy(a))throw Error(n(418));u=dl(p.nextSibling);var w=fi;u&&wC(a,u)?_C(w,p):(a.flags=a.flags&-4097|2,jn=!1,fi=a)}}else{if(Xy(a))throw Error(n(418));a.flags=a.flags&-4097|2,jn=!1,fi=a}}}function bC(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;fi=a}function d0(a){if(a!==fi)return!1;if(!jn)return bC(a),jn=!0,!1;var u;if((u=a.tag!==3)&&!(u=a.tag!==5)&&(u=a.type,u=u!=="head"&&u!=="body"&&!Uy(a.type,a.memoizedProps)),u&&(u=hi)){if(Xy(a))throw xC(),Error(n(418));for(;u;)_C(a,u),u=dl(u.nextSibling)}if(bC(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,u=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(u===0){hi=dl(a.nextSibling);break e}u--}else p!=="$"&&p!=="$!"&&p!=="$?"||u++}a=a.nextSibling}hi=null}}else hi=fi?dl(a.stateNode.nextSibling):null;return!0}function xC(){for(var a=hi;a;)a=dl(a.nextSibling)}function id(){hi=fi=null,jn=!1}function Jy(a){io===null?io=[a]:io.push(a)}var $V=P.ReactCurrentBatchConfig;function vh(a,u,p){if(a=p.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var w=p.stateNode}if(!w)throw Error(n(147,a));var E=w,T=""+a;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===T?u.ref:(u=function(N){var Z=E.refs;N===null?delete Z[T]:Z[T]=N},u._stringRef=T,u)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function f0(a,u){throw a=Object.prototype.toString.call(u),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a))}function SC(a){var u=a._init;return u(a._payload)}function kC(a){function u(te,J){if(a){var ne=te.deletions;ne===null?(te.deletions=[J],te.flags|=16):ne.push(J)}}function p(te,J){if(!a)return null;for(;J!==null;)u(te,J),J=J.sibling;return null}function w(te,J){for(te=new Map;J!==null;)J.key!==null?te.set(J.key,J):te.set(J.index,J),J=J.sibling;return te}function E(te,J){return te=xl(te,J),te.index=0,te.sibling=null,te}function T(te,J,ne){return te.index=ne,a?(ne=te.alternate,ne!==null?(ne=ne.index,ne<J?(te.flags|=2,J):ne):(te.flags|=2,J)):(te.flags|=1048576,J)}function N(te){return a&&te.alternate===null&&(te.flags|=2),te}function Z(te,J,ne,Te){return J===null||J.tag!==6?(J=B_(ne,te.mode,Te),J.return=te,J):(J=E(J,ne),J.return=te,J)}function Y(te,J,ne,Te){var Je=ne.type;return Je===I?_e(te,J,ne.props.children,Te,ne.key):J!==null&&(J.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===K&&SC(Je)===J.type)?(Te=E(J,ne.props),Te.ref=vh(te,J,ne),Te.return=te,Te):(Te=D0(ne.type,ne.key,ne.props,null,te.mode,Te),Te.ref=vh(te,J,ne),Te.return=te,Te)}function oe(te,J,ne,Te){return J===null||J.tag!==4||J.stateNode.containerInfo!==ne.containerInfo||J.stateNode.implementation!==ne.implementation?(J=Z_(ne,te.mode,Te),J.return=te,J):(J=E(J,ne.children||[]),J.return=te,J)}function _e(te,J,ne,Te,Je){return J===null||J.tag!==7?(J=Vc(ne,te.mode,Te,Je),J.return=te,J):(J=E(J,ne),J.return=te,J)}function xe(te,J,ne){if(typeof J=="string"&&J!==""||typeof J=="number")return J=B_(""+J,te.mode,ne),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case R:return ne=D0(J.type,J.key,J.props,null,te.mode,ne),ne.ref=vh(te,null,J),ne.return=te,ne;case O:return J=Z_(J,te.mode,ne),J.return=te,J;case K:var Te=J._init;return xe(te,Te(J._payload),ne)}if(Le(J)||Q(J))return J=Vc(J,te.mode,ne,null),J.return=te,J;f0(te,J)}return null}function ye(te,J,ne,Te){var Je=J!==null?J.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return Je!==null?null:Z(te,J,""+ne,Te);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case R:return ne.key===Je?Y(te,J,ne,Te):null;case O:return ne.key===Je?oe(te,J,ne,Te):null;case K:return Je=ne._init,ye(te,J,Je(ne._payload),Te)}if(Le(ne)||Q(ne))return Je!==null?null:_e(te,J,ne,Te,null);f0(te,ne)}return null}function Fe(te,J,ne,Te,Je){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return te=te.get(ne)||null,Z(J,te,""+Te,Je);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case R:return te=te.get(Te.key===null?ne:Te.key)||null,Y(J,te,Te,Je);case O:return te=te.get(Te.key===null?ne:Te.key)||null,oe(J,te,Te,Je);case K:var at=Te._init;return Fe(te,J,ne,at(Te._payload),Je)}if(Le(Te)||Q(Te))return te=te.get(ne)||null,_e(J,te,Te,Je,null);f0(J,Te)}return null}function Ke(te,J,ne,Te){for(var Je=null,at=null,lt=J,ht=J=0,zr=null;lt!==null&&ht<ne.length;ht++){lt.index>ht?(zr=lt,lt=null):zr=lt.sibling;var Jt=ye(te,lt,ne[ht],Te);if(Jt===null){lt===null&&(lt=zr);break}a&&lt&&Jt.alternate===null&&u(te,lt),J=T(Jt,J,ht),at===null?Je=Jt:at.sibling=Jt,at=Jt,lt=zr}if(ht===ne.length)return p(te,lt),jn&&Mc(te,ht),Je;if(lt===null){for(;ht<ne.length;ht++)lt=xe(te,ne[ht],Te),lt!==null&&(J=T(lt,J,ht),at===null?Je=lt:at.sibling=lt,at=lt);return jn&&Mc(te,ht),Je}for(lt=w(te,lt);ht<ne.length;ht++)zr=Fe(lt,te,ht,ne[ht],Te),zr!==null&&(a&&zr.alternate!==null&&lt.delete(zr.key===null?ht:zr.key),J=T(zr,J,ht),at===null?Je=zr:at.sibling=zr,at=zr);return a&&lt.forEach(function(Sl){return u(te,Sl)}),jn&&Mc(te,ht),Je}function Ge(te,J,ne,Te){var Je=Q(ne);if(typeof Je!="function")throw Error(n(150));if(ne=Je.call(ne),ne==null)throw Error(n(151));for(var at=Je=null,lt=J,ht=J=0,zr=null,Jt=ne.next();lt!==null&&!Jt.done;ht++,Jt=ne.next()){lt.index>ht?(zr=lt,lt=null):zr=lt.sibling;var Sl=ye(te,lt,Jt.value,Te);if(Sl===null){lt===null&&(lt=zr);break}a&&lt&&Sl.alternate===null&&u(te,lt),J=T(Sl,J,ht),at===null?Je=Sl:at.sibling=Sl,at=Sl,lt=zr}if(Jt.done)return p(te,lt),jn&&Mc(te,ht),Je;if(lt===null){for(;!Jt.done;ht++,Jt=ne.next())Jt=xe(te,Jt.value,Te),Jt!==null&&(J=T(Jt,J,ht),at===null?Je=Jt:at.sibling=Jt,at=Jt);return jn&&Mc(te,ht),Je}for(lt=w(te,lt);!Jt.done;ht++,Jt=ne.next())Jt=Fe(lt,te,ht,Jt.value,Te),Jt!==null&&(a&&Jt.alternate!==null&&lt.delete(Jt.key===null?ht:Jt.key),J=T(Jt,J,ht),at===null?Je=Jt:at.sibling=Jt,at=Jt);return a&&lt.forEach(function(gH){return u(te,gH)}),jn&&Mc(te,ht),Je}function ur(te,J,ne,Te){if(typeof ne=="object"&&ne!==null&&ne.type===I&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case R:e:{for(var Je=ne.key,at=J;at!==null;){if(at.key===Je){if(Je=ne.type,Je===I){if(at.tag===7){p(te,at.sibling),J=E(at,ne.props.children),J.return=te,te=J;break e}}else if(at.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===K&&SC(Je)===at.type){p(te,at.sibling),J=E(at,ne.props),J.ref=vh(te,at,ne),J.return=te,te=J;break e}p(te,at);break}else u(te,at);at=at.sibling}ne.type===I?(J=Vc(ne.props.children,te.mode,Te,ne.key),J.return=te,te=J):(Te=D0(ne.type,ne.key,ne.props,null,te.mode,Te),Te.ref=vh(te,J,ne),Te.return=te,te=Te)}return N(te);case O:e:{for(at=ne.key;J!==null;){if(J.key===at)if(J.tag===4&&J.stateNode.containerInfo===ne.containerInfo&&J.stateNode.implementation===ne.implementation){p(te,J.sibling),J=E(J,ne.children||[]),J.return=te,te=J;break e}else{p(te,J);break}else u(te,J);J=J.sibling}J=Z_(ne,te.mode,Te),J.return=te,te=J}return N(te);case K:return at=ne._init,ur(te,J,at(ne._payload),Te)}if(Le(ne))return Ke(te,J,ne,Te);if(Q(ne))return Ge(te,J,ne,Te);f0(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,J!==null&&J.tag===6?(p(te,J.sibling),J=E(J,ne),J.return=te,te=J):(p(te,J),J=B_(ne,te.mode,Te),J.return=te,te=J),N(te)):p(te,J)}return ur}var od=kC(!0),EC=kC(!1),h0=fl(null),p0=null,ad=null,e_=null;function t_(){e_=ad=p0=null}function n_(a){var u=h0.current;Mn(h0),a._currentValue=u}function r_(a,u,p){for(;a!==null;){var w=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,w!==null&&(w.childLanes|=u)):w!==null&&(w.childLanes&u)!==u&&(w.childLanes|=u),a===p)break;a=a.return}}function ld(a,u){p0=a,e_=ad=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&u)!==0&&(Vs=!0),a.firstContext=null)}function ji(a){var u=a._currentValue;if(e_!==a)if(a={context:a,memoizedValue:u,next:null},ad===null){if(p0===null)throw Error(n(308));ad=a,p0.dependencies={lanes:0,firstContext:a}}else ad=ad.next=a;return u}var Nc=null;function s_(a){Nc===null?Nc=[a]:Nc.push(a)}function CC(a,u,p,w){var E=u.interleaved;return E===null?(p.next=p,s_(u)):(p.next=E.next,E.next=p),u.interleaved=p,ba(a,w)}function ba(a,u){a.lanes|=u;var p=a.alternate;for(p!==null&&(p.lanes|=u),p=a,a=a.return;a!==null;)a.childLanes|=u,p=a.alternate,p!==null&&(p.childLanes|=u),p=a,a=a.return;return p.tag===3?p.stateNode:null}var ml=!1;function i_(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function PC(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function xa(a,u){return{eventTime:a,lane:u,tag:0,payload:null,callback:null,next:null}}function gl(a,u,p){var w=a.updateQueue;if(w===null)return null;if(w=w.shared,(Gt&2)!==0){var E=w.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),w.pending=u,ba(a,p)}return E=w.interleaved,E===null?(u.next=u,s_(w)):(u.next=E.next,E.next=u),w.interleaved=u,ba(a,p)}function m0(a,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194240)!==0)){var w=u.lanes;w&=a.pendingLanes,p|=w,u.lanes=p,Fn(a,p)}}function TC(a,u){var p=a.updateQueue,w=a.alternate;if(w!==null&&(w=w.updateQueue,p===w)){var E=null,T=null;if(p=p.firstBaseUpdate,p!==null){do{var N={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};T===null?E=T=N:T=T.next=N,p=p.next}while(p!==null);T===null?E=T=u:T=T.next=u}else E=T=u;p={baseState:w.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:w.shared,effects:w.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=u}function g0(a,u,p,w){var E=a.updateQueue;ml=!1;var T=E.firstBaseUpdate,N=E.lastBaseUpdate,Z=E.shared.pending;if(Z!==null){E.shared.pending=null;var Y=Z,oe=Y.next;Y.next=null,N===null?T=oe:N.next=oe,N=Y;var _e=a.alternate;_e!==null&&(_e=_e.updateQueue,Z=_e.lastBaseUpdate,Z!==N&&(Z===null?_e.firstBaseUpdate=oe:Z.next=oe,_e.lastBaseUpdate=Y))}if(T!==null){var xe=E.baseState;N=0,_e=oe=Y=null,Z=T;do{var ye=Z.lane,Fe=Z.eventTime;if((w&ye)===ye){_e!==null&&(_e=_e.next={eventTime:Fe,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var Ke=a,Ge=Z;switch(ye=u,Fe=p,Ge.tag){case 1:if(Ke=Ge.payload,typeof Ke=="function"){xe=Ke.call(Fe,xe,ye);break e}xe=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=Ge.payload,ye=typeof Ke=="function"?Ke.call(Fe,xe,ye):Ke,ye==null)break e;xe=B({},xe,ye);break e;case 2:ml=!0}}Z.callback!==null&&Z.lane!==0&&(a.flags|=64,ye=E.effects,ye===null?E.effects=[Z]:ye.push(Z))}else Fe={eventTime:Fe,lane:ye,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},_e===null?(oe=_e=Fe,Y=xe):_e=_e.next=Fe,N|=ye;if(Z=Z.next,Z===null){if(Z=E.shared.pending,Z===null)break;ye=Z,Z=ye.next,ye.next=null,E.lastBaseUpdate=ye,E.shared.pending=null}}while(!0);if(_e===null&&(Y=xe),E.baseState=Y,E.firstBaseUpdate=oe,E.lastBaseUpdate=_e,u=E.shared.interleaved,u!==null){E=u;do N|=E.lane,E=E.next;while(E!==u)}else T===null&&(E.shared.lanes=0);$c|=N,a.lanes=N,a.memoizedState=xe}}function RC(a,u,p){if(a=u.effects,u.effects=null,a!==null)for(u=0;u<a.length;u++){var w=a[u],E=w.callback;if(E!==null){if(w.callback=null,w=p,typeof E!="function")throw Error(n(191,E));E.call(w)}}}var yh={},No=fl(yh),_h=fl(yh),wh=fl(yh);function Lc(a){if(a===yh)throw Error(n(174));return a}function o_(a,u){switch(Rn(wh,u),Rn(_h,a),Rn(No,yh),a=u.nodeType,a){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:pt(null,"");break;default:a=a===8?u.parentNode:u,u=a.namespaceURI||null,a=a.tagName,u=pt(u,a)}Mn(No),Rn(No,u)}function cd(){Mn(No),Mn(_h),Mn(wh)}function AC(a){Lc(wh.current);var u=Lc(No.current),p=pt(u,a.type);u!==p&&(Rn(_h,a),Rn(No,p))}function a_(a){_h.current===a&&(Mn(No),Mn(_h))}var Bn=fl(0);function v0(a){for(var u=a;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var l_=[];function c_(){for(var a=0;a<l_.length;a++)l_[a]._workInProgressVersionPrimary=null;l_.length=0}var y0=P.ReactCurrentDispatcher,u_=P.ReactCurrentBatchConfig,Dc=0,Zn=null,Pr=null,Fr=null,_0=!1,bh=!1,xh=0,FV=0;function us(){throw Error(n(321))}function d_(a,u){if(u===null)return!1;for(var p=0;p<u.length&&p<a.length;p++)if(!so(a[p],u[p]))return!1;return!0}function f_(a,u,p,w,E,T){if(Dc=T,Zn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,y0.current=a===null||a.memoizedState===null?HV:UV,a=p(w,E),bh){T=0;do{if(bh=!1,xh=0,25<=T)throw Error(n(301));T+=1,Fr=Pr=null,u.updateQueue=null,y0.current=BV,a=p(w,E)}while(bh)}if(y0.current=x0,u=Pr!==null&&Pr.next!==null,Dc=0,Fr=Pr=Zn=null,_0=!1,u)throw Error(n(300));return a}function h_(){var a=xh!==0;return xh=0,a}function Lo(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fr===null?Zn.memoizedState=Fr=a:Fr=Fr.next=a,Fr}function zi(){if(Pr===null){var a=Zn.alternate;a=a!==null?a.memoizedState:null}else a=Pr.next;var u=Fr===null?Zn.memoizedState:Fr.next;if(u!==null)Fr=u,Pr=a;else{if(a===null)throw Error(n(310));Pr=a,a={memoizedState:Pr.memoizedState,baseState:Pr.baseState,baseQueue:Pr.baseQueue,queue:Pr.queue,next:null},Fr===null?Zn.memoizedState=Fr=a:Fr=Fr.next=a}return Fr}function Sh(a,u){return typeof u=="function"?u(a):u}function p_(a){var u=zi(),p=u.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var w=Pr,E=w.baseQueue,T=p.pending;if(T!==null){if(E!==null){var N=E.next;E.next=T.next,T.next=N}w.baseQueue=E=T,p.pending=null}if(E!==null){T=E.next,w=w.baseState;var Z=N=null,Y=null,oe=T;do{var _e=oe.lane;if((Dc&_e)===_e)Y!==null&&(Y=Y.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),w=oe.hasEagerState?oe.eagerState:a(w,oe.action);else{var xe={lane:_e,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};Y===null?(Z=Y=xe,N=w):Y=Y.next=xe,Zn.lanes|=_e,$c|=_e}oe=oe.next}while(oe!==null&&oe!==T);Y===null?N=w:Y.next=Z,so(w,u.memoizedState)||(Vs=!0),u.memoizedState=w,u.baseState=N,u.baseQueue=Y,p.lastRenderedState=w}if(a=p.interleaved,a!==null){E=a;do T=E.lane,Zn.lanes|=T,$c|=T,E=E.next;while(E!==a)}else E===null&&(p.lanes=0);return[u.memoizedState,p.dispatch]}function m_(a){var u=zi(),p=u.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var w=p.dispatch,E=p.pending,T=u.memoizedState;if(E!==null){p.pending=null;var N=E=E.next;do T=a(T,N.action),N=N.next;while(N!==E);so(T,u.memoizedState)||(Vs=!0),u.memoizedState=T,u.baseQueue===null&&(u.baseState=T),p.lastRenderedState=T}return[T,w]}function IC(){}function OC(a,u){var p=Zn,w=zi(),E=u(),T=!so(w.memoizedState,E);if(T&&(w.memoizedState=E,Vs=!0),w=w.queue,g_(LC.bind(null,p,w,a),[a]),w.getSnapshot!==u||T||Fr!==null&&Fr.memoizedState.tag&1){if(p.flags|=2048,kh(9,NC.bind(null,p,w,E,u),void 0,null),jr===null)throw Error(n(349));(Dc&30)!==0||MC(p,u,E)}return E}function MC(a,u,p){a.flags|=16384,a={getSnapshot:u,value:p},u=Zn.updateQueue,u===null?(u={lastEffect:null,stores:null},Zn.updateQueue=u,u.stores=[a]):(p=u.stores,p===null?u.stores=[a]:p.push(a))}function NC(a,u,p,w){u.value=p,u.getSnapshot=w,DC(u)&&$C(a)}function LC(a,u,p){return p(function(){DC(u)&&$C(a)})}function DC(a){var u=a.getSnapshot;a=a.value;try{var p=u();return!so(a,p)}catch{return!0}}function $C(a){var u=ba(a,1);u!==null&&co(u,a,1,-1)}function FC(a){var u=Lo();return typeof a=="function"&&(a=a()),u.memoizedState=u.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:a},u.queue=a,a=a.dispatch=VV.bind(null,Zn,a),[u.memoizedState,a]}function kh(a,u,p,w){return a={tag:a,create:u,destroy:p,deps:w,next:null},u=Zn.updateQueue,u===null?(u={lastEffect:null,stores:null},Zn.updateQueue=u,u.lastEffect=a.next=a):(p=u.lastEffect,p===null?u.lastEffect=a.next=a:(w=p.next,p.next=a,a.next=w,u.lastEffect=a)),a}function jC(){return zi().memoizedState}function w0(a,u,p,w){var E=Lo();Zn.flags|=a,E.memoizedState=kh(1|u,p,void 0,w===void 0?null:w)}function b0(a,u,p,w){var E=zi();w=w===void 0?null:w;var T=void 0;if(Pr!==null){var N=Pr.memoizedState;if(T=N.destroy,w!==null&&d_(w,N.deps)){E.memoizedState=kh(u,p,T,w);return}}Zn.flags|=a,E.memoizedState=kh(1|u,p,T,w)}function zC(a,u){return w0(8390656,8,a,u)}function g_(a,u){return b0(2048,8,a,u)}function VC(a,u){return b0(4,2,a,u)}function HC(a,u){return b0(4,4,a,u)}function UC(a,u){if(typeof u=="function")return a=a(),u(a),function(){u(null)};if(u!=null)return a=a(),u.current=a,function(){u.current=null}}function BC(a,u,p){return p=p!=null?p.concat([a]):null,b0(4,4,UC.bind(null,u,a),p)}function v_(){}function ZC(a,u){var p=zi();u=u===void 0?null:u;var w=p.memoizedState;return w!==null&&u!==null&&d_(u,w[1])?w[0]:(p.memoizedState=[a,u],a)}function WC(a,u){var p=zi();u=u===void 0?null:u;var w=p.memoizedState;return w!==null&&u!==null&&d_(u,w[1])?w[0]:(a=a(),p.memoizedState=[a,u],a)}function KC(a,u,p){return(Dc&21)===0?(a.baseState&&(a.baseState=!1,Vs=!0),a.memoizedState=p):(so(p,u)||(p=mt(),Zn.lanes|=p,$c|=p,a.baseState=!0),u)}function jV(a,u){var p=it;it=p!==0&&4>p?p:4,a(!0);var w=u_.transition;u_.transition={};try{a(!1),u()}finally{it=p,u_.transition=w}}function qC(){return zi().memoizedState}function zV(a,u,p){var w=wl(a);if(p={lane:w,action:p,hasEagerState:!1,eagerState:null,next:null},GC(a))YC(u,p);else if(p=CC(a,u,p,w),p!==null){var E=Ps();co(p,a,w,E),XC(p,u,w)}}function VV(a,u,p){var w=wl(a),E={lane:w,action:p,hasEagerState:!1,eagerState:null,next:null};if(GC(a))YC(u,E);else{var T=a.alternate;if(a.lanes===0&&(T===null||T.lanes===0)&&(T=u.lastRenderedReducer,T!==null))try{var N=u.lastRenderedState,Z=T(N,p);if(E.hasEagerState=!0,E.eagerState=Z,so(Z,N)){var Y=u.interleaved;Y===null?(E.next=E,s_(u)):(E.next=Y.next,Y.next=E),u.interleaved=E;return}}catch{}finally{}p=CC(a,u,E,w),p!==null&&(E=Ps(),co(p,a,w,E),XC(p,u,w))}}function GC(a){var u=a.alternate;return a===Zn||u!==null&&u===Zn}function YC(a,u){bh=_0=!0;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}function XC(a,u,p){if((p&4194240)!==0){var w=u.lanes;w&=a.pendingLanes,p|=w,u.lanes=p,Fn(a,p)}}var x0={readContext:ji,useCallback:us,useContext:us,useEffect:us,useImperativeHandle:us,useInsertionEffect:us,useLayoutEffect:us,useMemo:us,useReducer:us,useRef:us,useState:us,useDebugValue:us,useDeferredValue:us,useTransition:us,useMutableSource:us,useSyncExternalStore:us,useId:us,unstable_isNewReconciler:!1},HV={readContext:ji,useCallback:function(a,u){return Lo().memoizedState=[a,u===void 0?null:u],a},useContext:ji,useEffect:zC,useImperativeHandle:function(a,u,p){return p=p!=null?p.concat([a]):null,w0(4194308,4,UC.bind(null,u,a),p)},useLayoutEffect:function(a,u){return w0(4194308,4,a,u)},useInsertionEffect:function(a,u){return w0(4,2,a,u)},useMemo:function(a,u){var p=Lo();return u=u===void 0?null:u,a=a(),p.memoizedState=[a,u],a},useReducer:function(a,u,p){var w=Lo();return u=p!==void 0?p(u):u,w.memoizedState=w.baseState=u,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:u},w.queue=a,a=a.dispatch=zV.bind(null,Zn,a),[w.memoizedState,a]},useRef:function(a){var u=Lo();return a={current:a},u.memoizedState=a},useState:FC,useDebugValue:v_,useDeferredValue:function(a){return Lo().memoizedState=a},useTransition:function(){var a=FC(!1),u=a[0];return a=jV.bind(null,a[1]),Lo().memoizedState=a,[u,a]},useMutableSource:function(){},useSyncExternalStore:function(a,u,p){var w=Zn,E=Lo();if(jn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=u(),jr===null)throw Error(n(349));(Dc&30)!==0||MC(w,u,p)}E.memoizedState=p;var T={value:p,getSnapshot:u};return E.queue=T,zC(LC.bind(null,w,T,a),[a]),w.flags|=2048,kh(9,NC.bind(null,w,T,p,u),void 0,null),p},useId:function(){var a=Lo(),u=jr.identifierPrefix;if(jn){var p=wa,w=_a;p=(w&~(1<<32-ks(w)-1)).toString(32)+p,u=":"+u+"R"+p,p=xh++,0<p&&(u+="H"+p.toString(32)),u+=":"}else p=FV++,u=":"+u+"r"+p.toString(32)+":";return a.memoizedState=u},unstable_isNewReconciler:!1},UV={readContext:ji,useCallback:ZC,useContext:ji,useEffect:g_,useImperativeHandle:BC,useInsertionEffect:VC,useLayoutEffect:HC,useMemo:WC,useReducer:p_,useRef:jC,useState:function(){return p_(Sh)},useDebugValue:v_,useDeferredValue:function(a){var u=zi();return KC(u,Pr.memoizedState,a)},useTransition:function(){var a=p_(Sh)[0],u=zi().memoizedState;return[a,u]},useMutableSource:IC,useSyncExternalStore:OC,useId:qC,unstable_isNewReconciler:!1},BV={readContext:ji,useCallback:ZC,useContext:ji,useEffect:g_,useImperativeHandle:BC,useInsertionEffect:VC,useLayoutEffect:HC,useMemo:WC,useReducer:m_,useRef:jC,useState:function(){return m_(Sh)},useDebugValue:v_,useDeferredValue:function(a){var u=zi();return Pr===null?u.memoizedState=a:KC(u,Pr.memoizedState,a)},useTransition:function(){var a=m_(Sh)[0],u=zi().memoizedState;return[a,u]},useMutableSource:IC,useSyncExternalStore:OC,useId:qC,unstable_isNewReconciler:!1};function oo(a,u){if(a&&a.defaultProps){u=B({},u),a=a.defaultProps;for(var p in a)u[p]===void 0&&(u[p]=a[p]);return u}return u}function y_(a,u,p,w){u=a.memoizedState,p=p(w,u),p=p==null?u:B({},u,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var S0={isMounted:function(a){return(a=a._reactInternals)?Dr(a)===a:!1},enqueueSetState:function(a,u,p){a=a._reactInternals;var w=Ps(),E=wl(a),T=xa(w,E);T.payload=u,p!=null&&(T.callback=p),u=gl(a,T,E),u!==null&&(co(u,a,E,w),m0(u,a,E))},enqueueReplaceState:function(a,u,p){a=a._reactInternals;var w=Ps(),E=wl(a),T=xa(w,E);T.tag=1,T.payload=u,p!=null&&(T.callback=p),u=gl(a,T,E),u!==null&&(co(u,a,E,w),m0(u,a,E))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var p=Ps(),w=wl(a),E=xa(p,w);E.tag=2,u!=null&&(E.callback=u),u=gl(a,E,w),u!==null&&(co(u,a,w,p),m0(u,a,w))}};function QC(a,u,p,w,E,T,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(w,T,N):u.prototype&&u.prototype.isPureReactComponent?!uh(p,w)||!uh(E,T):!0}function JC(a,u,p){var w=!1,E=hl,T=u.contextType;return typeof T=="object"&&T!==null?T=ji(T):(E=zs(u)?Ic:cs.current,w=u.contextTypes,T=(w=w!=null)?nd(a,E):hl),u=new u(p,T),a.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=S0,a.stateNode=u,u._reactInternals=a,w&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=T),u}function e8(a,u,p,w){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,w),u.state!==a&&S0.enqueueReplaceState(u,u.state,null)}function __(a,u,p,w){var E=a.stateNode;E.props=p,E.state=a.memoizedState,E.refs={},i_(a);var T=u.contextType;typeof T=="object"&&T!==null?E.context=ji(T):(T=zs(u)?Ic:cs.current,E.context=nd(a,T)),E.state=a.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(y_(a,u,T,p),E.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(u=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),u!==E.state&&S0.enqueueReplaceState(E,E.state,null),g0(a,p,E,w),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function ud(a,u){try{var p="",w=u;do p+=ue(w),w=w.return;while(w);var E=p}catch(T){E=`
107
- Error generating stack: `+T.message+`
108
- `+T.stack}return{value:a,source:u,stack:E,digest:null}}function w_(a,u,p){return{value:a,source:null,stack:p??null,digest:u??null}}function b_(a,u){try{console.error(u.value)}catch(p){setTimeout(function(){throw p})}}var ZV=typeof WeakMap=="function"?WeakMap:Map;function t8(a,u,p){p=xa(-1,p),p.tag=3,p.payload={element:null};var w=u.value;return p.callback=function(){A0||(A0=!0,D_=w),b_(a,u)},p}function n8(a,u,p){p=xa(-1,p),p.tag=3;var w=a.type.getDerivedStateFromError;if(typeof w=="function"){var E=u.value;p.payload=function(){return w(E)},p.callback=function(){b_(a,u)}}var T=a.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(p.callback=function(){b_(a,u),typeof w!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})}),p}function r8(a,u,p){var w=a.pingCache;if(w===null){w=a.pingCache=new ZV;var E=new Set;w.set(u,E)}else E=w.get(u),E===void 0&&(E=new Set,w.set(u,E));E.has(p)||(E.add(p),a=iH.bind(null,a,u,p),u.then(a,a))}function s8(a){do{var u;if((u=a.tag===13)&&(u=a.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return a;a=a.return}while(a!==null);return null}function i8(a,u,p,w,E){return(a.mode&1)===0?(a===u?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(u=xa(-1,1),u.tag=2,gl(p,u,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var WV=P.ReactCurrentOwner,Vs=!1;function Cs(a,u,p,w){u.child=a===null?EC(u,null,p,w):od(u,a.child,p,w)}function o8(a,u,p,w,E){p=p.render;var T=u.ref;return ld(u,E),w=f_(a,u,p,w,T,E),p=h_(),a!==null&&!Vs?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,Sa(a,u,E)):(jn&&p&&Gy(u),u.flags|=1,Cs(a,u,w,E),u.child)}function a8(a,u,p,w,E){if(a===null){var T=p.type;return typeof T=="function"&&!U_(T)&&T.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(u.tag=15,u.type=T,l8(a,u,T,w,E)):(a=D0(p.type,null,w,u,u.mode,E),a.ref=u.ref,a.return=u,u.child=a)}if(T=a.child,(a.lanes&E)===0){var N=T.memoizedProps;if(p=p.compare,p=p!==null?p:uh,p(N,w)&&a.ref===u.ref)return Sa(a,u,E)}return u.flags|=1,a=xl(T,w),a.ref=u.ref,a.return=u,u.child=a}function l8(a,u,p,w,E){if(a!==null){var T=a.memoizedProps;if(uh(T,w)&&a.ref===u.ref)if(Vs=!1,u.pendingProps=w=T,(a.lanes&E)!==0)(a.flags&131072)!==0&&(Vs=!0);else return u.lanes=a.lanes,Sa(a,u,E)}return x_(a,u,p,w,E)}function c8(a,u,p){var w=u.pendingProps,E=w.children,T=a!==null?a.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rn(fd,pi),pi|=p;else{if((p&1073741824)===0)return a=T!==null?T.baseLanes|p:p,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:a,cachePool:null,transitions:null},u.updateQueue=null,Rn(fd,pi),pi|=a,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=T!==null?T.baseLanes:p,Rn(fd,pi),pi|=w}else T!==null?(w=T.baseLanes|p,u.memoizedState=null):w=p,Rn(fd,pi),pi|=w;return Cs(a,u,E,p),u.child}function u8(a,u){var p=u.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(u.flags|=512,u.flags|=2097152)}function x_(a,u,p,w,E){var T=zs(p)?Ic:cs.current;return T=nd(u,T),ld(u,E),p=f_(a,u,p,w,T,E),w=h_(),a!==null&&!Vs?(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~E,Sa(a,u,E)):(jn&&w&&Gy(u),u.flags|=1,Cs(a,u,p,E),u.child)}function d8(a,u,p,w,E){if(zs(p)){var T=!0;a0(u)}else T=!1;if(ld(u,E),u.stateNode===null)E0(a,u),JC(u,p,w),__(u,p,w,E),w=!0;else if(a===null){var N=u.stateNode,Z=u.memoizedProps;N.props=Z;var Y=N.context,oe=p.contextType;typeof oe=="object"&&oe!==null?oe=ji(oe):(oe=zs(p)?Ic:cs.current,oe=nd(u,oe));var _e=p.getDerivedStateFromProps,xe=typeof _e=="function"||typeof N.getSnapshotBeforeUpdate=="function";xe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==w||Y!==oe)&&e8(u,N,w,oe),ml=!1;var ye=u.memoizedState;N.state=ye,g0(u,w,N,E),Y=u.memoizedState,Z!==w||ye!==Y||js.current||ml?(typeof _e=="function"&&(y_(u,p,_e,w),Y=u.memoizedState),(Z=ml||QC(u,p,Z,w,ye,Y,oe))?(xe||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=Y),N.props=w,N.state=Y,N.context=oe,w=Z):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{N=u.stateNode,PC(a,u),Z=u.memoizedProps,oe=u.type===u.elementType?Z:oo(u.type,Z),N.props=oe,xe=u.pendingProps,ye=N.context,Y=p.contextType,typeof Y=="object"&&Y!==null?Y=ji(Y):(Y=zs(p)?Ic:cs.current,Y=nd(u,Y));var Fe=p.getDerivedStateFromProps;(_e=typeof Fe=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==xe||ye!==Y)&&e8(u,N,w,Y),ml=!1,ye=u.memoizedState,N.state=ye,g0(u,w,N,E);var Ke=u.memoizedState;Z!==xe||ye!==Ke||js.current||ml?(typeof Fe=="function"&&(y_(u,p,Fe,w),Ke=u.memoizedState),(oe=ml||QC(u,p,oe,w,ye,Ke,Y)||!1)?(_e||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(w,Ke,Y),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(w,Ke,Y)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=Ke),N.props=w,N.state=Ke,N.context=Y,w=oe):(typeof N.componentDidUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===a.memoizedProps&&ye===a.memoizedState||(u.flags|=1024),w=!1)}return S_(a,u,p,w,T,E)}function S_(a,u,p,w,E,T){u8(a,u);var N=(u.flags&128)!==0;if(!w&&!N)return E&&gC(u,p,!1),Sa(a,u,T);w=u.stateNode,WV.current=u;var Z=N&&typeof p.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,a!==null&&N?(u.child=od(u,a.child,null,T),u.child=od(u,null,Z,T)):Cs(a,u,Z,T),u.memoizedState=w.state,E&&gC(u,p,!0),u.child}function f8(a){var u=a.stateNode;u.pendingContext?pC(a,u.pendingContext,u.pendingContext!==u.context):u.context&&pC(a,u.context,!1),o_(a,u.containerInfo)}function h8(a,u,p,w,E){return id(),Jy(E),u.flags|=256,Cs(a,u,p,w),u.child}var k_={dehydrated:null,treeContext:null,retryLane:0};function E_(a){return{baseLanes:a,cachePool:null,transitions:null}}function p8(a,u,p){var w=u.pendingProps,E=Bn.current,T=!1,N=(u.flags&128)!==0,Z;if((Z=N)||(Z=a!==null&&a.memoizedState===null?!1:(E&2)!==0),Z?(T=!0,u.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),Rn(Bn,E&1),a===null)return Qy(u),a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((u.mode&1)===0?u.lanes=1:a.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(N=w.children,a=w.fallback,T?(w=u.mode,T=u.child,N={mode:"hidden",children:N},(w&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=N):T=$0(N,w,0,null),a=Vc(a,w,p,null),T.return=u,a.return=u,T.sibling=a,u.child=T,u.child.memoizedState=E_(p),u.memoizedState=k_,a):C_(u,N));if(E=a.memoizedState,E!==null&&(Z=E.dehydrated,Z!==null))return KV(a,u,N,w,Z,E,p);if(T){T=w.fallback,N=u.mode,E=a.child,Z=E.sibling;var Y={mode:"hidden",children:w.children};return(N&1)===0&&u.child!==E?(w=u.child,w.childLanes=0,w.pendingProps=Y,u.deletions=null):(w=xl(E,Y),w.subtreeFlags=E.subtreeFlags&14680064),Z!==null?T=xl(Z,T):(T=Vc(T,N,p,null),T.flags|=2),T.return=u,w.return=u,w.sibling=T,u.child=w,w=T,T=u.child,N=a.child.memoizedState,N=N===null?E_(p):{baseLanes:N.baseLanes|p,cachePool:null,transitions:N.transitions},T.memoizedState=N,T.childLanes=a.childLanes&~p,u.memoizedState=k_,w}return T=a.child,a=T.sibling,w=xl(T,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=p),w.return=u,w.sibling=null,a!==null&&(p=u.deletions,p===null?(u.deletions=[a],u.flags|=16):p.push(a)),u.child=w,u.memoizedState=null,w}function C_(a,u){return u=$0({mode:"visible",children:u},a.mode,0,null),u.return=a,a.child=u}function k0(a,u,p,w){return w!==null&&Jy(w),od(u,a.child,null,p),a=C_(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function KV(a,u,p,w,E,T,N){if(p)return u.flags&256?(u.flags&=-257,w=w_(Error(n(422))),k0(a,u,N,w)):u.memoizedState!==null?(u.child=a.child,u.flags|=128,null):(T=w.fallback,E=u.mode,w=$0({mode:"visible",children:w.children},E,0,null),T=Vc(T,E,N,null),T.flags|=2,w.return=u,T.return=u,w.sibling=T,u.child=w,(u.mode&1)!==0&&od(u,a.child,null,N),u.child.memoizedState=E_(N),u.memoizedState=k_,T);if((u.mode&1)===0)return k0(a,u,N,null);if(E.data==="$!"){if(w=E.nextSibling&&E.nextSibling.dataset,w)var Z=w.dgst;return w=Z,T=Error(n(419)),w=w_(T,w,void 0),k0(a,u,N,w)}if(Z=(N&a.childLanes)!==0,Vs||Z){if(w=jr,w!==null){switch(N&-N){case 4:E=2;break;case 16:E=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(w.suspendedLanes|N))!==0?0:E,E!==0&&E!==T.retryLane&&(T.retryLane=E,ba(a,E),co(w,a,E,-1))}return H_(),w=w_(Error(n(421))),k0(a,u,N,w)}return E.data==="$?"?(u.flags|=128,u.child=a.child,u=oH.bind(null,a),E._reactRetry=u,null):(a=T.treeContext,hi=dl(E.nextSibling),fi=u,jn=!0,io=null,a!==null&&($i[Fi++]=_a,$i[Fi++]=wa,$i[Fi++]=Oc,_a=a.id,wa=a.overflow,Oc=u),u=C_(u,w.children),u.flags|=4096,u)}function m8(a,u,p){a.lanes|=u;var w=a.alternate;w!==null&&(w.lanes|=u),r_(a.return,u,p)}function P_(a,u,p,w,E){var T=a.memoizedState;T===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:p,tailMode:E}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=w,T.tail=p,T.tailMode=E)}function g8(a,u,p){var w=u.pendingProps,E=w.revealOrder,T=w.tail;if(Cs(a,u,w.children,p),w=Bn.current,(w&2)!==0)w=w&1|2,u.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&m8(a,p,u);else if(a.tag===19)m8(a,p,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}w&=1}if(Rn(Bn,w),(u.mode&1)===0)u.memoizedState=null;else switch(E){case"forwards":for(p=u.child,E=null;p!==null;)a=p.alternate,a!==null&&v0(a)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),P_(u,!1,E,p,T);break;case"backwards":for(p=null,E=u.child,u.child=null;E!==null;){if(a=E.alternate,a!==null&&v0(a)===null){u.child=E;break}a=E.sibling,E.sibling=p,p=E,E=a}P_(u,!0,p,null,T);break;case"together":P_(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function E0(a,u){(u.mode&1)===0&&a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2)}function Sa(a,u,p){if(a!==null&&(u.dependencies=a.dependencies),$c|=u.lanes,(p&u.childLanes)===0)return null;if(a!==null&&u.child!==a.child)throw Error(n(153));if(u.child!==null){for(a=u.child,p=xl(a,a.pendingProps),u.child=p,p.return=u;a.sibling!==null;)a=a.sibling,p=p.sibling=xl(a,a.pendingProps),p.return=u;p.sibling=null}return u.child}function qV(a,u,p){switch(u.tag){case 3:f8(u),id();break;case 5:AC(u);break;case 1:zs(u.type)&&a0(u);break;case 4:o_(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,E=u.memoizedProps.value;Rn(h0,w._currentValue),w._currentValue=E;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(Rn(Bn,Bn.current&1),u.flags|=128,null):(p&u.child.childLanes)!==0?p8(a,u,p):(Rn(Bn,Bn.current&1),a=Sa(a,u,p),a!==null?a.sibling:null);Rn(Bn,Bn.current&1);break;case 19:if(w=(p&u.childLanes)!==0,(a.flags&128)!==0){if(w)return g8(a,u,p);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Rn(Bn,Bn.current),w)break;return null;case 22:case 23:return u.lanes=0,c8(a,u,p)}return Sa(a,u,p)}var v8,T_,y8,_8;v8=function(a,u){for(var p=u.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},T_=function(){},y8=function(a,u,p,w){var E=a.memoizedProps;if(E!==w){a=u.stateNode,Lc(No.current);var T=null;switch(p){case"input":E=tn(a,E),w=tn(a,w),T=[];break;case"select":E=B({},E,{value:void 0}),w=B({},w,{value:void 0}),T=[];break;case"textarea":E=Ae(a,E),w=Ae(a,w),T=[];break;default:typeof E.onClick!="function"&&typeof w.onClick=="function"&&(a.onclick=s0)}vn(p,w);var N;p=null;for(oe in E)if(!w.hasOwnProperty(oe)&&E.hasOwnProperty(oe)&&E[oe]!=null)if(oe==="style"){var Z=E[oe];for(N in Z)Z.hasOwnProperty(N)&&(p||(p={}),p[N]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(s.hasOwnProperty(oe)?T||(T=[]):(T=T||[]).push(oe,null));for(oe in w){var Y=w[oe];if(Z=E!=null?E[oe]:void 0,w.hasOwnProperty(oe)&&Y!==Z&&(Y!=null||Z!=null))if(oe==="style")if(Z){for(N in Z)!Z.hasOwnProperty(N)||Y&&Y.hasOwnProperty(N)||(p||(p={}),p[N]="");for(N in Y)Y.hasOwnProperty(N)&&Z[N]!==Y[N]&&(p||(p={}),p[N]=Y[N])}else p||(T||(T=[]),T.push(oe,p)),p=Y;else oe==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Z=Z?Z.__html:void 0,Y!=null&&Z!==Y&&(T=T||[]).push(oe,Y)):oe==="children"?typeof Y!="string"&&typeof Y!="number"||(T=T||[]).push(oe,""+Y):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(s.hasOwnProperty(oe)?(Y!=null&&oe==="onScroll"&&On("scroll",a),T||Z===Y||(T=[])):(T=T||[]).push(oe,Y))}p&&(T=T||[]).push("style",p);var oe=T;(u.updateQueue=oe)&&(u.flags|=4)}},_8=function(a,u,p,w){p!==w&&(u.flags|=4)};function Eh(a,u){if(!jn)switch(a.tailMode){case"hidden":u=a.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var w=null;p!==null;)p.alternate!==null&&(w=p),p=p.sibling;w===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:w.sibling=null}}function ds(a){var u=a.alternate!==null&&a.alternate.child===a.child,p=0,w=0;if(u)for(var E=a.child;E!==null;)p|=E.lanes|E.childLanes,w|=E.subtreeFlags&14680064,w|=E.flags&14680064,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)p|=E.lanes|E.childLanes,w|=E.subtreeFlags,w|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=w,a.childLanes=p,u}function GV(a,u,p){var w=u.pendingProps;switch(Yy(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ds(u),null;case 1:return zs(u.type)&&o0(),ds(u),null;case 3:return w=u.stateNode,cd(),Mn(js),Mn(cs),c_(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(a===null||a.child===null)&&(d0(u)?u.flags|=4:a===null||a.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,io!==null&&(j_(io),io=null))),T_(a,u),ds(u),null;case 5:a_(u);var E=Lc(wh.current);if(p=u.type,a!==null&&u.stateNode!=null)y8(a,u,p,w,E),a.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return ds(u),null}if(a=Lc(No.current),d0(u)){w=u.stateNode,p=u.type;var T=u.memoizedProps;switch(w[Mo]=u,w[mh]=T,a=(u.mode&1)!==0,p){case"dialog":On("cancel",w),On("close",w);break;case"iframe":case"object":case"embed":On("load",w);break;case"video":case"audio":for(E=0;E<fh.length;E++)On(fh[E],w);break;case"source":On("error",w);break;case"img":case"image":case"link":On("error",w),On("load",w);break;case"details":On("toggle",w);break;case"input":nn(w,T),On("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!T.multiple},On("invalid",w);break;case"textarea":Ct(w,T),On("invalid",w)}vn(p,T),E=null;for(var N in T)if(T.hasOwnProperty(N)){var Z=T[N];N==="children"?typeof Z=="string"?w.textContent!==Z&&(T.suppressHydrationWarning!==!0&&r0(w.textContent,Z,a),E=["children",Z]):typeof Z=="number"&&w.textContent!==""+Z&&(T.suppressHydrationWarning!==!0&&r0(w.textContent,Z,a),E=["children",""+Z]):s.hasOwnProperty(N)&&Z!=null&&N==="onScroll"&&On("scroll",w)}switch(p){case"input":Se(w),un(w,T,!0);break;case"textarea":Se(w),$t(w);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(w.onclick=s0)}w=E,u.updateQueue=w,w!==null&&(u.flags|=4)}else{N=E.nodeType===9?E:E.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ft(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=N.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof w.is=="string"?a=N.createElement(p,{is:w.is}):(a=N.createElement(p),p==="select"&&(N=a,w.multiple?N.multiple=!0:w.size&&(N.size=w.size))):a=N.createElementNS(a,p),a[Mo]=u,a[mh]=w,v8(a,u,!1,!1),u.stateNode=a;e:{switch(N=is(p,w),p){case"dialog":On("cancel",a),On("close",a),E=w;break;case"iframe":case"object":case"embed":On("load",a),E=w;break;case"video":case"audio":for(E=0;E<fh.length;E++)On(fh[E],a);E=w;break;case"source":On("error",a),E=w;break;case"img":case"image":case"link":On("error",a),On("load",a),E=w;break;case"details":On("toggle",a),E=w;break;case"input":nn(a,w),E=tn(a,w),On("invalid",a);break;case"option":E=w;break;case"select":a._wrapperState={wasMultiple:!!w.multiple},E=B({},w,{value:void 0}),On("invalid",a);break;case"textarea":Ct(a,w),E=Ae(a,w),On("invalid",a);break;default:E=w}vn(p,E),Z=E;for(T in Z)if(Z.hasOwnProperty(T)){var Y=Z[T];T==="style"?ss(a,Y):T==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&Mi(a,Y)):T==="children"?typeof Y=="string"?(p!=="textarea"||Y!=="")&&Pn(a,Y):typeof Y=="number"&&Pn(a,""+Y):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(s.hasOwnProperty(T)?Y!=null&&T==="onScroll"&&On("scroll",a):Y!=null&&C(a,T,Y,N))}switch(p){case"input":Se(a),un(a,w,!1);break;case"textarea":Se(a),$t(a);break;case"option":w.value!=null&&a.setAttribute("value",""+le(w.value));break;case"select":a.multiple=!!w.multiple,T=w.value,T!=null?Qe(a,!!w.multiple,T,!1):w.defaultValue!=null&&Qe(a,!!w.multiple,w.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=s0)}switch(p){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return ds(u),null;case 6:if(a&&u.stateNode!=null)_8(a,u,a.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(p=Lc(wh.current),Lc(No.current),d0(u)){if(w=u.stateNode,p=u.memoizedProps,w[Mo]=u,(T=w.nodeValue!==p)&&(a=fi,a!==null))switch(a.tag){case 3:r0(w.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&r0(w.nodeValue,p,(a.mode&1)!==0)}T&&(u.flags|=4)}else w=(p.nodeType===9?p:p.ownerDocument).createTextNode(w),w[Mo]=u,u.stateNode=w}return ds(u),null;case 13:if(Mn(Bn),w=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(jn&&hi!==null&&(u.mode&1)!==0&&(u.flags&128)===0)xC(),id(),u.flags|=98560,T=!1;else if(T=d0(u),w!==null&&w.dehydrated!==null){if(a===null){if(!T)throw Error(n(318));if(T=u.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[Mo]=u}else id(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ds(u),T=!1}else io!==null&&(j_(io),io=null),T=!0;if(!T)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=p,u):(w=w!==null,w!==(a!==null&&a.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(a===null||(Bn.current&1)!==0?Tr===0&&(Tr=3):H_())),u.updateQueue!==null&&(u.flags|=4),ds(u),null);case 4:return cd(),T_(a,u),a===null&&hh(u.stateNode.containerInfo),ds(u),null;case 10:return n_(u.type._context),ds(u),null;case 17:return zs(u.type)&&o0(),ds(u),null;case 19:if(Mn(Bn),T=u.memoizedState,T===null)return ds(u),null;if(w=(u.flags&128)!==0,N=T.rendering,N===null)if(w)Eh(T,!1);else{if(Tr!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(N=v0(a),N!==null){for(u.flags|=128,Eh(T,!1),w=N.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=p,p=u.child;p!==null;)T=p,a=w,T.flags&=14680066,N=T.alternate,N===null?(T.childLanes=0,T.lanes=a,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=N.childLanes,T.lanes=N.lanes,T.child=N.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=N.memoizedProps,T.memoizedState=N.memoizedState,T.updateQueue=N.updateQueue,T.type=N.type,a=N.dependencies,T.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return Rn(Bn,Bn.current&1|2),u.child}a=a.sibling}T.tail!==null&&dn()>hd&&(u.flags|=128,w=!0,Eh(T,!1),u.lanes=4194304)}else{if(!w)if(a=v0(N),a!==null){if(u.flags|=128,w=!0,p=a.updateQueue,p!==null&&(u.updateQueue=p,u.flags|=4),Eh(T,!0),T.tail===null&&T.tailMode==="hidden"&&!N.alternate&&!jn)return ds(u),null}else 2*dn()-T.renderingStartTime>hd&&p!==1073741824&&(u.flags|=128,w=!0,Eh(T,!1),u.lanes=4194304);T.isBackwards?(N.sibling=u.child,u.child=N):(p=T.last,p!==null?p.sibling=N:u.child=N,T.last=N)}return T.tail!==null?(u=T.tail,T.rendering=u,T.tail=u.sibling,T.renderingStartTime=dn(),u.sibling=null,p=Bn.current,Rn(Bn,w?p&1|2:p&1),u):(ds(u),null);case 22:case 23:return V_(),w=u.memoizedState!==null,a!==null&&a.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(pi&1073741824)!==0&&(ds(u),u.subtreeFlags&6&&(u.flags|=8192)):ds(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function YV(a,u){switch(Yy(u),u.tag){case 1:return zs(u.type)&&o0(),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return cd(),Mn(js),Mn(cs),c_(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 5:return a_(u),null;case 13:if(Mn(Bn),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(n(340));id()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return Mn(Bn),null;case 4:return cd(),null;case 10:return n_(u.type._context),null;case 22:case 23:return V_(),null;case 24:return null;default:return null}}var C0=!1,fs=!1,XV=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function dd(a,u){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(w){ir(a,u,w)}else p.current=null}function R_(a,u,p){try{p()}catch(w){ir(a,u,w)}}var w8=!1;function QV(a,u){if(Vy=Wm,a=Q6(),My(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var w=p.getSelection&&p.getSelection();if(w&&w.rangeCount!==0){p=w.anchorNode;var E=w.anchorOffset,T=w.focusNode;w=w.focusOffset;try{p.nodeType,T.nodeType}catch{p=null;break e}var N=0,Z=-1,Y=-1,oe=0,_e=0,xe=a,ye=null;t:for(;;){for(var Fe;xe!==p||E!==0&&xe.nodeType!==3||(Z=N+E),xe!==T||w!==0&&xe.nodeType!==3||(Y=N+w),xe.nodeType===3&&(N+=xe.nodeValue.length),(Fe=xe.firstChild)!==null;)ye=xe,xe=Fe;for(;;){if(xe===a)break t;if(ye===p&&++oe===E&&(Z=N),ye===T&&++_e===w&&(Y=N),(Fe=xe.nextSibling)!==null)break;xe=ye,ye=xe.parentNode}xe=Fe}p=Z===-1||Y===-1?null:{start:Z,end:Y}}else p=null}p=p||{start:0,end:0}}else p=null;for(Hy={focusedElem:a,selectionRange:p},Wm=!1,Ue=u;Ue!==null;)if(u=Ue,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,Ue=a;else for(;Ue!==null;){u=Ue;try{var Ke=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Ke!==null){var Ge=Ke.memoizedProps,ur=Ke.memoizedState,te=u.stateNode,J=te.getSnapshotBeforeUpdate(u.elementType===u.type?Ge:oo(u.type,Ge),ur);te.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var ne=u.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Te){ir(u,u.return,Te)}if(a=u.sibling,a!==null){a.return=u.return,Ue=a;break}Ue=u.return}return Ke=w8,w8=!1,Ke}function Ch(a,u,p){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var E=w=w.next;do{if((E.tag&a)===a){var T=E.destroy;E.destroy=void 0,T!==void 0&&R_(u,p,T)}E=E.next}while(E!==w)}}function P0(a,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&a)===a){var w=p.create;p.destroy=w()}p=p.next}while(p!==u)}}function A_(a){var u=a.ref;if(u!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof u=="function"?u(a):u.current=a}}function b8(a){var u=a.alternate;u!==null&&(a.alternate=null,b8(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&(delete u[Mo],delete u[mh],delete u[Wy],delete u[NV],delete u[LV])),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 x8(a){return a.tag===5||a.tag===3||a.tag===4}function S8(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||x8(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 I_(a,u,p){var w=a.tag;if(w===5||w===6)a=a.stateNode,u?p.nodeType===8?p.parentNode.insertBefore(a,u):p.insertBefore(a,u):(p.nodeType===8?(u=p.parentNode,u.insertBefore(a,p)):(u=p,u.appendChild(a)),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=s0));else if(w!==4&&(a=a.child,a!==null))for(I_(a,u,p),a=a.sibling;a!==null;)I_(a,u,p),a=a.sibling}function O_(a,u,p){var w=a.tag;if(w===5||w===6)a=a.stateNode,u?p.insertBefore(a,u):p.appendChild(a);else if(w!==4&&(a=a.child,a!==null))for(O_(a,u,p),a=a.sibling;a!==null;)O_(a,u,p),a=a.sibling}var Gr=null,ao=!1;function vl(a,u,p){for(p=p.child;p!==null;)k8(a,u,p),p=p.sibling}function k8(a,u,p){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(ma,p)}catch{}switch(p.tag){case 5:fs||dd(p,u);case 6:var w=Gr,E=ao;Gr=null,vl(a,u,p),Gr=w,ao=E,Gr!==null&&(ao?(a=Gr,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):Gr.removeChild(p.stateNode));break;case 18:Gr!==null&&(ao?(a=Gr,p=p.stateNode,a.nodeType===8?Zy(a.parentNode,p):a.nodeType===1&&Zy(a,p),Oo(a)):Zy(Gr,p.stateNode));break;case 4:w=Gr,E=ao,Gr=p.stateNode.containerInfo,ao=!0,vl(a,u,p),Gr=w,ao=E;break;case 0:case 11:case 14:case 15:if(!fs&&(w=p.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){E=w=w.next;do{var T=E,N=T.destroy;T=T.tag,N!==void 0&&((T&2)!==0||(T&4)!==0)&&R_(p,u,N),E=E.next}while(E!==w)}vl(a,u,p);break;case 1:if(!fs&&(dd(p,u),w=p.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=p.memoizedProps,w.state=p.memoizedState,w.componentWillUnmount()}catch(Z){ir(p,u,Z)}vl(a,u,p);break;case 21:vl(a,u,p);break;case 22:p.mode&1?(fs=(w=fs)||p.memoizedState!==null,vl(a,u,p),fs=w):vl(a,u,p);break;default:vl(a,u,p)}}function E8(a){var u=a.updateQueue;if(u!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new XV),u.forEach(function(w){var E=aH.bind(null,a,w);p.has(w)||(p.add(w),w.then(E,E))})}}function lo(a,u){var p=u.deletions;if(p!==null)for(var w=0;w<p.length;w++){var E=p[w];try{var T=a,N=u,Z=N;e:for(;Z!==null;){switch(Z.tag){case 5:Gr=Z.stateNode,ao=!1;break e;case 3:Gr=Z.stateNode.containerInfo,ao=!0;break e;case 4:Gr=Z.stateNode.containerInfo,ao=!0;break e}Z=Z.return}if(Gr===null)throw Error(n(160));k8(T,N,E),Gr=null,ao=!1;var Y=E.alternate;Y!==null&&(Y.return=null),E.return=null}catch(oe){ir(E,u,oe)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)C8(u,a),u=u.sibling}function C8(a,u){var p=a.alternate,w=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(lo(u,a),Do(a),w&4){try{Ch(3,a,a.return),P0(3,a)}catch(Ge){ir(a,a.return,Ge)}try{Ch(5,a,a.return)}catch(Ge){ir(a,a.return,Ge)}}break;case 1:lo(u,a),Do(a),w&512&&p!==null&&dd(p,p.return);break;case 5:if(lo(u,a),Do(a),w&512&&p!==null&&dd(p,p.return),a.flags&32){var E=a.stateNode;try{Pn(E,"")}catch(Ge){ir(a,a.return,Ge)}}if(w&4&&(E=a.stateNode,E!=null)){var T=a.memoizedProps,N=p!==null?p.memoizedProps:T,Z=a.type,Y=a.updateQueue;if(a.updateQueue=null,Y!==null)try{Z==="input"&&T.type==="radio"&&T.name!=null&&xt(E,T),is(Z,N);var oe=is(Z,T);for(N=0;N<Y.length;N+=2){var _e=Y[N],xe=Y[N+1];_e==="style"?ss(E,xe):_e==="dangerouslySetInnerHTML"?Mi(E,xe):_e==="children"?Pn(E,xe):C(E,_e,xe,oe)}switch(Z){case"input":Dt(E,T);break;case"textarea":ke(E,T);break;case"select":var ye=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!T.multiple;var Fe=T.value;Fe!=null?Qe(E,!!T.multiple,Fe,!1):ye!==!!T.multiple&&(T.defaultValue!=null?Qe(E,!!T.multiple,T.defaultValue,!0):Qe(E,!!T.multiple,T.multiple?[]:"",!1))}E[mh]=T}catch(Ge){ir(a,a.return,Ge)}}break;case 6:if(lo(u,a),Do(a),w&4){if(a.stateNode===null)throw Error(n(162));E=a.stateNode,T=a.memoizedProps;try{E.nodeValue=T}catch(Ge){ir(a,a.return,Ge)}}break;case 3:if(lo(u,a),Do(a),w&4&&p!==null&&p.memoizedState.isDehydrated)try{Oo(u.containerInfo)}catch(Ge){ir(a,a.return,Ge)}break;case 4:lo(u,a),Do(a);break;case 13:lo(u,a),Do(a),E=a.child,E.flags&8192&&(T=E.memoizedState!==null,E.stateNode.isHidden=T,!T||E.alternate!==null&&E.alternate.memoizedState!==null||(L_=dn())),w&4&&E8(a);break;case 22:if(_e=p!==null&&p.memoizedState!==null,a.mode&1?(fs=(oe=fs)||_e,lo(u,a),fs=oe):lo(u,a),Do(a),w&8192){if(oe=a.memoizedState!==null,(a.stateNode.isHidden=oe)&&!_e&&(a.mode&1)!==0)for(Ue=a,_e=a.child;_e!==null;){for(xe=Ue=_e;Ue!==null;){switch(ye=Ue,Fe=ye.child,ye.tag){case 0:case 11:case 14:case 15:Ch(4,ye,ye.return);break;case 1:dd(ye,ye.return);var Ke=ye.stateNode;if(typeof Ke.componentWillUnmount=="function"){w=ye,p=ye.return;try{u=w,Ke.props=u.memoizedProps,Ke.state=u.memoizedState,Ke.componentWillUnmount()}catch(Ge){ir(w,p,Ge)}}break;case 5:dd(ye,ye.return);break;case 22:if(ye.memoizedState!==null){R8(xe);continue}}Fe!==null?(Fe.return=ye,Ue=Fe):R8(xe)}_e=_e.sibling}e:for(_e=null,xe=a;;){if(xe.tag===5){if(_e===null){_e=xe;try{E=xe.stateNode,oe?(T=E.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(Z=xe.stateNode,Y=xe.memoizedProps.style,N=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,Z.style.display=xs("display",N))}catch(Ge){ir(a,a.return,Ge)}}}else if(xe.tag===6){if(_e===null)try{xe.stateNode.nodeValue=oe?"":xe.memoizedProps}catch(Ge){ir(a,a.return,Ge)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===a)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===a)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===a)break e;_e===xe&&(_e=null),xe=xe.return}_e===xe&&(_e=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:lo(u,a),Do(a),w&4&&E8(a);break;case 21:break;default:lo(u,a),Do(a)}}function Do(a){var u=a.flags;if(u&2){try{e:{for(var p=a.return;p!==null;){if(x8(p)){var w=p;break e}p=p.return}throw Error(n(160))}switch(w.tag){case 5:var E=w.stateNode;w.flags&32&&(Pn(E,""),w.flags&=-33);var T=S8(a);O_(a,T,E);break;case 3:case 4:var N=w.stateNode.containerInfo,Z=S8(a);I_(a,Z,N);break;default:throw Error(n(161))}}catch(Y){ir(a,a.return,Y)}a.flags&=-3}u&4096&&(a.flags&=-4097)}function JV(a,u,p){Ue=a,P8(a)}function P8(a,u,p){for(var w=(a.mode&1)!==0;Ue!==null;){var E=Ue,T=E.child;if(E.tag===22&&w){var N=E.memoizedState!==null||C0;if(!N){var Z=E.alternate,Y=Z!==null&&Z.memoizedState!==null||fs;Z=C0;var oe=fs;if(C0=N,(fs=Y)&&!oe)for(Ue=E;Ue!==null;)N=Ue,Y=N.child,N.tag===22&&N.memoizedState!==null?A8(E):Y!==null?(Y.return=N,Ue=Y):A8(E);for(;T!==null;)Ue=T,P8(T),T=T.sibling;Ue=E,C0=Z,fs=oe}T8(a)}else(E.subtreeFlags&8772)!==0&&T!==null?(T.return=E,Ue=T):T8(a)}}function T8(a){for(;Ue!==null;){var u=Ue;if((u.flags&8772)!==0){var p=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:fs||P0(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!fs)if(p===null)w.componentDidMount();else{var E=u.elementType===u.type?p.memoizedProps:oo(u.type,p.memoizedProps);w.componentDidUpdate(E,p.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var T=u.updateQueue;T!==null&&RC(u,T,w);break;case 3:var N=u.updateQueue;if(N!==null){if(p=null,u.child!==null)switch(u.child.tag){case 5:p=u.child.stateNode;break;case 1:p=u.child.stateNode}RC(u,N,p)}break;case 5:var Z=u.stateNode;if(p===null&&u.flags&4){p=Z;var Y=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&p.focus();break;case"img":Y.src&&(p.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var oe=u.alternate;if(oe!==null){var _e=oe.memoizedState;if(_e!==null){var xe=_e.dehydrated;xe!==null&&Oo(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}fs||u.flags&512&&A_(u)}catch(ye){ir(u,u.return,ye)}}if(u===a){Ue=null;break}if(p=u.sibling,p!==null){p.return=u.return,Ue=p;break}Ue=u.return}}function R8(a){for(;Ue!==null;){var u=Ue;if(u===a){Ue=null;break}var p=u.sibling;if(p!==null){p.return=u.return,Ue=p;break}Ue=u.return}}function A8(a){for(;Ue!==null;){var u=Ue;try{switch(u.tag){case 0:case 11:case 15:var p=u.return;try{P0(4,u)}catch(Y){ir(u,p,Y)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var E=u.return;try{w.componentDidMount()}catch(Y){ir(u,E,Y)}}var T=u.return;try{A_(u)}catch(Y){ir(u,T,Y)}break;case 5:var N=u.return;try{A_(u)}catch(Y){ir(u,N,Y)}}}catch(Y){ir(u,u.return,Y)}if(u===a){Ue=null;break}var Z=u.sibling;if(Z!==null){Z.return=u.return,Ue=Z;break}Ue=u.return}}var eH=Math.ceil,T0=P.ReactCurrentDispatcher,M_=P.ReactCurrentOwner,Vi=P.ReactCurrentBatchConfig,Gt=0,jr=null,mr=null,Yr=0,pi=0,fd=fl(0),Tr=0,Ph=null,$c=0,R0=0,N_=0,Th=null,Hs=null,L_=0,hd=1/0,ka=null,A0=!1,D_=null,yl=null,I0=!1,_l=null,O0=0,Rh=0,$_=null,M0=-1,N0=0;function Ps(){return(Gt&6)!==0?dn():M0!==-1?M0:M0=dn()}function wl(a){return(a.mode&1)===0?1:(Gt&2)!==0&&Yr!==0?Yr&-Yr:$V.transition!==null?(N0===0&&(N0=mt()),N0):(a=it,a!==0||(a=window.event,a=a===void 0?16:O6(a.type)),a)}function co(a,u,p,w){if(50<Rh)throw Rh=0,$_=null,Error(n(185));Qt(a,p,w),((Gt&2)===0||a!==jr)&&(a===jr&&((Gt&2)===0&&(R0|=p),Tr===4&&bl(a,Yr)),Us(a,w),p===1&&Gt===0&&(u.mode&1)===0&&(hd=dn()+500,l0&&pl()))}function Us(a,u){var p=a.callbackNode;Ze(a,u);var w=ge(a,a===jr?Yr:0);if(w===0)p!==null&&Cc(p),a.callbackNode=null,a.callbackPriority=0;else if(u=w&-w,a.callbackPriority!==u){if(p!=null&&Cc(p),u===1)a.tag===0?DV(O8.bind(null,a)):vC(O8.bind(null,a)),OV(function(){(Gt&6)===0&&pl()}),p=null;else{switch($r(w)){case 1:p=ui;break;case 4:p=To;break;case 16:p=qr;break;case 536870912:p=Tc;break;default:p=qr}p=z8(p,I8.bind(null,a))}a.callbackPriority=u,a.callbackNode=p}}function I8(a,u){if(M0=-1,N0=0,(Gt&6)!==0)throw Error(n(327));var p=a.callbackNode;if(pd()&&a.callbackNode!==p)return null;var w=ge(a,a===jr?Yr:0);if(w===0)return null;if((w&30)!==0||(w&a.expiredLanes)!==0||u)u=L0(a,w);else{u=w;var E=Gt;Gt|=2;var T=N8();(jr!==a||Yr!==u)&&(ka=null,hd=dn()+500,jc(a,u));do try{rH();break}catch(Z){M8(a,Z)}while(!0);t_(),T0.current=T,Gt=E,mr!==null?u=0:(jr=null,Yr=0,u=Tr)}if(u!==0){if(u===2&&(E=yt(a),E!==0&&(w=E,u=F_(a,E))),u===1)throw p=Ph,jc(a,0),bl(a,w),Us(a,dn()),p;if(u===6)bl(a,w);else{if(E=a.current.alternate,(w&30)===0&&!tH(E)&&(u=L0(a,w),u===2&&(T=yt(a),T!==0&&(w=T,u=F_(a,T))),u===1))throw p=Ph,jc(a,0),bl(a,w),Us(a,dn()),p;switch(a.finishedWork=E,a.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:zc(a,Hs,ka);break;case 3:if(bl(a,w),(w&130023424)===w&&(u=L_+500-dn(),10<u)){if(ge(a,0)!==0)break;if(E=a.suspendedLanes,(E&w)!==w){Ps(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=By(zc.bind(null,a,Hs,ka),u);break}zc(a,Hs,ka);break;case 4:if(bl(a,w),(w&4194240)===w)break;for(u=a.eventTimes,E=-1;0<w;){var N=31-ks(w);T=1<<N,N=u[N],N>E&&(E=N),w&=~T}if(w=E,w=dn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*eH(w/1960))-w,10<w){a.timeoutHandle=By(zc.bind(null,a,Hs,ka),w);break}zc(a,Hs,ka);break;case 5:zc(a,Hs,ka);break;default:throw Error(n(329))}}}return Us(a,dn()),a.callbackNode===p?I8.bind(null,a):null}function F_(a,u){var p=Th;return a.current.memoizedState.isDehydrated&&(jc(a,u).flags|=256),a=L0(a,u),a!==2&&(u=Hs,Hs=p,u!==null&&j_(u)),a}function j_(a){Hs===null?Hs=a:Hs.push.apply(Hs,a)}function tH(a){for(var u=a;;){if(u.flags&16384){var p=u.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var w=0;w<p.length;w++){var E=p[w],T=E.getSnapshot;E=E.value;try{if(!so(T(),E))return!1}catch{return!1}}}if(p=u.child,u.subtreeFlags&16384&&p!==null)p.return=u,u=p;else{if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function bl(a,u){for(u&=~N_,u&=~R0,a.suspendedLanes|=u,a.pingedLanes&=~u,a=a.expirationTimes;0<u;){var p=31-ks(u),w=1<<p;a[p]=-1,u&=~w}}function O8(a){if((Gt&6)!==0)throw Error(n(327));pd();var u=ge(a,0);if((u&1)===0)return Us(a,dn()),null;var p=L0(a,u);if(a.tag!==0&&p===2){var w=yt(a);w!==0&&(u=w,p=F_(a,w))}if(p===1)throw p=Ph,jc(a,0),bl(a,u),Us(a,dn()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=u,zc(a,Hs,ka),Us(a,dn()),null}function z_(a,u){var p=Gt;Gt|=1;try{return a(u)}finally{Gt=p,Gt===0&&(hd=dn()+500,l0&&pl())}}function Fc(a){_l!==null&&_l.tag===0&&(Gt&6)===0&&pd();var u=Gt;Gt|=1;var p=Vi.transition,w=it;try{if(Vi.transition=null,it=1,a)return a()}finally{it=w,Vi.transition=p,Gt=u,(Gt&6)===0&&pl()}}function V_(){pi=fd.current,Mn(fd)}function jc(a,u){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,IV(p)),mr!==null)for(p=mr.return;p!==null;){var w=p;switch(Yy(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&o0();break;case 3:cd(),Mn(js),Mn(cs),c_();break;case 5:a_(w);break;case 4:cd();break;case 13:Mn(Bn);break;case 19:Mn(Bn);break;case 10:n_(w.type._context);break;case 22:case 23:V_()}p=p.return}if(jr=a,mr=a=xl(a.current,null),Yr=pi=u,Tr=0,Ph=null,N_=R0=$c=0,Hs=Th=null,Nc!==null){for(u=0;u<Nc.length;u++)if(p=Nc[u],w=p.interleaved,w!==null){p.interleaved=null;var E=w.next,T=p.pending;if(T!==null){var N=T.next;T.next=E,w.next=N}p.pending=w}Nc=null}return a}function M8(a,u){do{var p=mr;try{if(t_(),y0.current=x0,_0){for(var w=Zn.memoizedState;w!==null;){var E=w.queue;E!==null&&(E.pending=null),w=w.next}_0=!1}if(Dc=0,Fr=Pr=Zn=null,bh=!1,xh=0,M_.current=null,p===null||p.return===null){Tr=1,Ph=u,mr=null;break}e:{var T=a,N=p.return,Z=p,Y=u;if(u=Yr,Z.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var oe=Y,_e=Z,xe=_e.tag;if((_e.mode&1)===0&&(xe===0||xe===11||xe===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=s8(N);if(Fe!==null){Fe.flags&=-257,i8(Fe,N,Z,T,u),Fe.mode&1&&r8(T,oe,u),u=Fe,Y=oe;var Ke=u.updateQueue;if(Ke===null){var Ge=new Set;Ge.add(Y),u.updateQueue=Ge}else Ke.add(Y);break e}else{if((u&1)===0){r8(T,oe,u),H_();break e}Y=Error(n(426))}}else if(jn&&Z.mode&1){var ur=s8(N);if(ur!==null){(ur.flags&65536)===0&&(ur.flags|=256),i8(ur,N,Z,T,u),Jy(ud(Y,Z));break e}}T=Y=ud(Y,Z),Tr!==4&&(Tr=2),Th===null?Th=[T]:Th.push(T),T=N;do{switch(T.tag){case 3:T.flags|=65536,u&=-u,T.lanes|=u;var te=t8(T,Y,u);TC(T,te);break e;case 1:Z=Y;var J=T.type,ne=T.stateNode;if((T.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(yl===null||!yl.has(ne)))){T.flags|=65536,u&=-u,T.lanes|=u;var Te=n8(T,Z,u);TC(T,Te);break e}}T=T.return}while(T!==null)}D8(p)}catch(Je){u=Je,mr===p&&p!==null&&(mr=p=p.return);continue}break}while(!0)}function N8(){var a=T0.current;return T0.current=x0,a===null?x0:a}function H_(){(Tr===0||Tr===3||Tr===2)&&(Tr=4),jr===null||($c&268435455)===0&&(R0&268435455)===0||bl(jr,Yr)}function L0(a,u){var p=Gt;Gt|=2;var w=N8();(jr!==a||Yr!==u)&&(ka=null,jc(a,u));do try{nH();break}catch(E){M8(a,E)}while(!0);if(t_(),Gt=p,T0.current=w,mr!==null)throw Error(n(261));return jr=null,Yr=0,Tr}function nH(){for(;mr!==null;)L8(mr)}function rH(){for(;mr!==null&&!Uu();)L8(mr)}function L8(a){var u=j8(a.alternate,a,pi);a.memoizedProps=a.pendingProps,u===null?D8(a):mr=u,M_.current=null}function D8(a){var u=a;do{var p=u.alternate;if(a=u.return,(u.flags&32768)===0){if(p=GV(p,u,pi),p!==null){mr=p;return}}else{if(p=YV(p,u),p!==null){p.flags&=32767,mr=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Tr=6,mr=null;return}}if(u=u.sibling,u!==null){mr=u;return}mr=u=a}while(u!==null);Tr===0&&(Tr=5)}function zc(a,u,p){var w=it,E=Vi.transition;try{Vi.transition=null,it=1,sH(a,u,p,w)}finally{Vi.transition=E,it=w}return null}function sH(a,u,p,w){do pd();while(_l!==null);if((Gt&6)!==0)throw Error(n(327));p=a.finishedWork;var E=a.finishedLanes;if(p===null)return null;if(a.finishedWork=null,a.finishedLanes=0,p===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var T=p.lanes|p.childLanes;if(_t(a,T),a===jr&&(mr=jr=null,Yr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||I0||(I0=!0,z8(qr,function(){return pd(),null})),T=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||T){T=Vi.transition,Vi.transition=null;var N=it;it=1;var Z=Gt;Gt|=4,M_.current=null,QV(a,p),C8(p,a),kV(Hy),Wm=!!Vy,Hy=Vy=null,a.current=p,JV(p),al(),Gt=Z,it=N,Vi.transition=T}else a.current=p;if(I0&&(I0=!1,_l=a,O0=E),T=a.pendingLanes,T===0&&(yl=null),Bu(p.stateNode),Us(a,dn()),u!==null)for(w=a.onRecoverableError,p=0;p<u.length;p++)E=u[p],w(E.value,{componentStack:E.stack,digest:E.digest});if(A0)throw A0=!1,a=D_,D_=null,a;return(O0&1)!==0&&a.tag!==0&&pd(),T=a.pendingLanes,(T&1)!==0?a===$_?Rh++:(Rh=0,$_=a):Rh=0,pl(),null}function pd(){if(_l!==null){var a=$r(O0),u=Vi.transition,p=it;try{if(Vi.transition=null,it=16>a?16:a,_l===null)var w=!1;else{if(a=_l,_l=null,O0=0,(Gt&6)!==0)throw Error(n(331));var E=Gt;for(Gt|=4,Ue=a.current;Ue!==null;){var T=Ue,N=T.child;if((Ue.flags&16)!==0){var Z=T.deletions;if(Z!==null){for(var Y=0;Y<Z.length;Y++){var oe=Z[Y];for(Ue=oe;Ue!==null;){var _e=Ue;switch(_e.tag){case 0:case 11:case 15:Ch(8,_e,T)}var xe=_e.child;if(xe!==null)xe.return=_e,Ue=xe;else for(;Ue!==null;){_e=Ue;var ye=_e.sibling,Fe=_e.return;if(b8(_e),_e===oe){Ue=null;break}if(ye!==null){ye.return=Fe,Ue=ye;break}Ue=Fe}}}var Ke=T.alternate;if(Ke!==null){var Ge=Ke.child;if(Ge!==null){Ke.child=null;do{var ur=Ge.sibling;Ge.sibling=null,Ge=ur}while(Ge!==null)}}Ue=T}}if((T.subtreeFlags&2064)!==0&&N!==null)N.return=T,Ue=N;else e:for(;Ue!==null;){if(T=Ue,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:Ch(9,T,T.return)}var te=T.sibling;if(te!==null){te.return=T.return,Ue=te;break e}Ue=T.return}}var J=a.current;for(Ue=J;Ue!==null;){N=Ue;var ne=N.child;if((N.subtreeFlags&2064)!==0&&ne!==null)ne.return=N,Ue=ne;else e:for(N=J;Ue!==null;){if(Z=Ue,(Z.flags&2048)!==0)try{switch(Z.tag){case 0:case 11:case 15:P0(9,Z)}}catch(Je){ir(Z,Z.return,Je)}if(Z===N){Ue=null;break e}var Te=Z.sibling;if(Te!==null){Te.return=Z.return,Ue=Te;break e}Ue=Z.return}}if(Gt=E,pl(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(ma,a)}catch{}w=!0}return w}finally{it=p,Vi.transition=u}}return!1}function $8(a,u,p){u=ud(p,u),u=t8(a,u,1),a=gl(a,u,1),u=Ps(),a!==null&&(Qt(a,1,u),Us(a,u))}function ir(a,u,p){if(a.tag===3)$8(a,a,p);else for(;u!==null;){if(u.tag===3){$8(u,a,p);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(yl===null||!yl.has(w))){a=ud(p,a),a=n8(u,a,1),u=gl(u,a,1),a=Ps(),u!==null&&(Qt(u,1,a),Us(u,a));break}}u=u.return}}function iH(a,u,p){var w=a.pingCache;w!==null&&w.delete(u),u=Ps(),a.pingedLanes|=a.suspendedLanes&p,jr===a&&(Yr&p)===p&&(Tr===4||Tr===3&&(Yr&130023424)===Yr&&500>dn()-L_?jc(a,0):N_|=p),Us(a,u)}function F8(a,u){u===0&&((a.mode&1)===0?u=1:(u=F,F<<=1,(F&130023424)===0&&(F=4194304)));var p=Ps();a=ba(a,u),a!==null&&(Qt(a,u,p),Us(a,p))}function oH(a){var u=a.memoizedState,p=0;u!==null&&(p=u.retryLane),F8(a,p)}function aH(a,u){var p=0;switch(a.tag){case 13:var w=a.stateNode,E=a.memoizedState;E!==null&&(p=E.retryLane);break;case 19:w=a.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),F8(a,p)}var j8;j8=function(a,u,p){if(a!==null)if(a.memoizedProps!==u.pendingProps||js.current)Vs=!0;else{if((a.lanes&p)===0&&(u.flags&128)===0)return Vs=!1,qV(a,u,p);Vs=(a.flags&131072)!==0}else Vs=!1,jn&&(u.flags&1048576)!==0&&yC(u,u0,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;E0(a,u),a=u.pendingProps;var E=nd(u,cs.current);ld(u,p),E=f_(null,u,w,a,E,p);var T=h_();return u.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,zs(w)?(T=!0,a0(u)):T=!1,u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,i_(u),E.updater=S0,u.stateNode=E,E._reactInternals=u,__(u,w,a,p),u=S_(null,u,w,!0,T,p)):(u.tag=0,jn&&T&&Gy(u),Cs(null,u,E,p),u=u.child),u;case 16:w=u.elementType;e:{switch(E0(a,u),a=u.pendingProps,E=w._init,w=E(w._payload),u.type=w,E=u.tag=cH(w),a=oo(w,a),E){case 0:u=x_(null,u,w,a,p);break e;case 1:u=d8(null,u,w,a,p);break e;case 11:u=o8(null,u,w,a,p);break e;case 14:u=a8(null,u,w,oo(w.type,a),p);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:oo(w,E),x_(a,u,w,E,p);case 1:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:oo(w,E),d8(a,u,w,E,p);case 3:e:{if(f8(u),a===null)throw Error(n(387));w=u.pendingProps,T=u.memoizedState,E=T.element,PC(a,u),g0(u,w,null,p);var N=u.memoizedState;if(w=N.element,T.isDehydrated)if(T={element:w,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},u.updateQueue.baseState=T,u.memoizedState=T,u.flags&256){E=ud(Error(n(423)),u),u=h8(a,u,w,p,E);break e}else if(w!==E){E=ud(Error(n(424)),u),u=h8(a,u,w,p,E);break e}else for(hi=dl(u.stateNode.containerInfo.firstChild),fi=u,jn=!0,io=null,p=EC(u,null,w,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(id(),w===E){u=Sa(a,u,p);break e}Cs(a,u,w,p)}u=u.child}return u;case 5:return AC(u),a===null&&Qy(u),w=u.type,E=u.pendingProps,T=a!==null?a.memoizedProps:null,N=E.children,Uy(w,E)?N=null:T!==null&&Uy(w,T)&&(u.flags|=32),u8(a,u),Cs(a,u,N,p),u.child;case 6:return a===null&&Qy(u),null;case 13:return p8(a,u,p);case 4:return o_(u,u.stateNode.containerInfo),w=u.pendingProps,a===null?u.child=od(u,null,w,p):Cs(a,u,w,p),u.child;case 11:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:oo(w,E),o8(a,u,w,E,p);case 7:return Cs(a,u,u.pendingProps,p),u.child;case 8:return Cs(a,u,u.pendingProps.children,p),u.child;case 12:return Cs(a,u,u.pendingProps.children,p),u.child;case 10:e:{if(w=u.type._context,E=u.pendingProps,T=u.memoizedProps,N=E.value,Rn(h0,w._currentValue),w._currentValue=N,T!==null)if(so(T.value,N)){if(T.children===E.children&&!js.current){u=Sa(a,u,p);break e}}else for(T=u.child,T!==null&&(T.return=u);T!==null;){var Z=T.dependencies;if(Z!==null){N=T.child;for(var Y=Z.firstContext;Y!==null;){if(Y.context===w){if(T.tag===1){Y=xa(-1,p&-p),Y.tag=2;var oe=T.updateQueue;if(oe!==null){oe=oe.shared;var _e=oe.pending;_e===null?Y.next=Y:(Y.next=_e.next,_e.next=Y),oe.pending=Y}}T.lanes|=p,Y=T.alternate,Y!==null&&(Y.lanes|=p),r_(T.return,p,u),Z.lanes|=p;break}Y=Y.next}}else if(T.tag===10)N=T.type===u.type?null:T.child;else if(T.tag===18){if(N=T.return,N===null)throw Error(n(341));N.lanes|=p,Z=N.alternate,Z!==null&&(Z.lanes|=p),r_(N,p,u),N=T.sibling}else N=T.child;if(N!==null)N.return=T;else for(N=T;N!==null;){if(N===u){N=null;break}if(T=N.sibling,T!==null){T.return=N.return,N=T;break}N=N.return}T=N}Cs(a,u,E.children,p),u=u.child}return u;case 9:return E=u.type,w=u.pendingProps.children,ld(u,p),E=ji(E),w=w(E),u.flags|=1,Cs(a,u,w,p),u.child;case 14:return w=u.type,E=oo(w,u.pendingProps),E=oo(w.type,E),a8(a,u,w,E,p);case 15:return l8(a,u,u.type,u.pendingProps,p);case 17:return w=u.type,E=u.pendingProps,E=u.elementType===w?E:oo(w,E),E0(a,u),u.tag=1,zs(w)?(a=!0,a0(u)):a=!1,ld(u,p),JC(u,w,E),__(u,w,E,p),S_(null,u,w,!0,a,p);case 19:return g8(a,u,p);case 22:return c8(a,u,p)}throw Error(n(156,u.tag))};function z8(a,u){return ci(a,u)}function lH(a,u,p,w){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hi(a,u,p,w){return new lH(a,u,p,w)}function U_(a){return a=a.prototype,!(!a||!a.isReactComponent)}function cH(a){if(typeof a=="function")return U_(a)?1:0;if(a!=null){if(a=a.$$typeof,a===$)return 11;if(a===j)return 14}return 2}function xl(a,u){var p=a.alternate;return p===null?(p=Hi(a.tag,u,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=u,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,u=a.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function D0(a,u,p,w,E,T){var N=2;if(w=a,typeof a=="function")U_(a)&&(N=1);else if(typeof a=="string")N=5;else e:switch(a){case I:return Vc(p.children,E,T,u);case A:N=8,E|=8;break;case M:return a=Hi(12,p,u,E|2),a.elementType=M,a.lanes=T,a;case q:return a=Hi(13,p,u,E),a.elementType=q,a.lanes=T,a;case X:return a=Hi(19,p,u,E),a.elementType=X,a.lanes=T,a;case ee:return $0(p,E,T,u);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case L:N=10;break e;case z:N=9;break e;case $:N=11;break e;case j:N=14;break e;case K:N=16,w=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return u=Hi(N,p,u,E),u.elementType=a,u.type=w,u.lanes=T,u}function Vc(a,u,p,w){return a=Hi(7,a,w,u),a.lanes=p,a}function $0(a,u,p,w){return a=Hi(22,a,w,u),a.elementType=ee,a.lanes=p,a.stateNode={isHidden:!1},a}function B_(a,u,p){return a=Hi(6,a,null,u),a.lanes=p,a}function Z_(a,u,p){return u=Hi(4,a.children!==null?a.children:[],a.key,u),u.lanes=p,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}function uH(a,u,p,w,E){this.tag=u,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=jt(0),this.expirationTimes=jt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.identifierPrefix=w,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function W_(a,u,p,w,E,T,N,Z,Y){return a=new uH(a,u,p,Z,Y),u===1?(u=1,T===!0&&(u|=8)):u=0,T=Hi(3,null,null,u),a.current=T,T.stateNode=a,T.memoizedState={element:w,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},i_(T),a}function dH(a,u,p){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:w==null?null:""+w,children:a,containerInfo:u,implementation:p}}function V8(a){if(!a)return hl;a=a._reactInternals;e:{if(Dr(a)!==a||a.tag!==1)throw Error(n(170));var u=a;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(zs(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(zs(p))return mC(a,p,u)}return u}function H8(a,u,p,w,E,T,N,Z,Y){return a=W_(p,w,!0,a,E,T,N,Z,Y),a.context=V8(null),p=a.current,w=Ps(),E=wl(p),T=xa(w,E),T.callback=u??null,gl(p,T,E),a.current.lanes=E,Qt(a,E,w),Us(a,w),a}function F0(a,u,p,w){var E=u.current,T=Ps(),N=wl(E);return p=V8(p),u.context===null?u.context=p:u.pendingContext=p,u=xa(T,N),u.payload={element:a},w=w===void 0?null:w,w!==null&&(u.callback=w),a=gl(E,u,N),a!==null&&(co(a,E,N,T),m0(a,E,N)),N}function j0(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 U8(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<u?p:u}}function K_(a,u){U8(a,u),(a=a.alternate)&&U8(a,u)}function fH(){return null}var B8=typeof reportError=="function"?reportError:function(a){console.error(a)};function q_(a){this._internalRoot=a}z0.prototype.render=q_.prototype.render=function(a){var u=this._internalRoot;if(u===null)throw Error(n(409));F0(a,u,null,null)},z0.prototype.unmount=q_.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var u=a.containerInfo;Fc(function(){F0(null,a,null,null)}),u[va]=null}};function z0(a){this._internalRoot=a}z0.prototype.unstable_scheduleHydration=function(a){if(a){var u=ga();a={blockedOn:null,target:a,priority:u};for(var p=0;p<De.length&&u!==0&&u<De[p].priority;p++);De.splice(p,0,a),p===0&&ls(a)}};function G_(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function V0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Z8(){}function hH(a,u,p,w,E){if(E){if(typeof w=="function"){var T=w;w=function(){var oe=j0(N);T.call(oe)}}var N=H8(u,w,a,0,null,!1,!1,"",Z8);return a._reactRootContainer=N,a[va]=N.current,hh(a.nodeType===8?a.parentNode:a),Fc(),N}for(;E=a.lastChild;)a.removeChild(E);if(typeof w=="function"){var Z=w;w=function(){var oe=j0(Y);Z.call(oe)}}var Y=W_(a,0,!1,null,null,!1,!1,"",Z8);return a._reactRootContainer=Y,a[va]=Y.current,hh(a.nodeType===8?a.parentNode:a),Fc(function(){F0(u,Y,p,w)}),Y}function H0(a,u,p,w,E){var T=p._reactRootContainer;if(T){var N=T;if(typeof E=="function"){var Z=E;E=function(){var Y=j0(N);Z.call(Y)}}F0(u,N,a,E)}else N=hH(p,u,a,E,w);return j0(N)}ll=function(a){switch(a.tag){case 3:var u=a.stateNode;if(u.current.memoizedState.isDehydrated){var p=pe(u.pendingLanes);p!==0&&(Fn(u,p|1),Us(u,dn()),(Gt&6)===0&&(hd=dn()+500,pl()))}break;case 13:Fc(function(){var w=ba(a,1);if(w!==null){var E=Ps();co(w,a,1,E)}}),K_(a,1)}},Io=function(a){if(a.tag===13){var u=ba(a,134217728);if(u!==null){var p=Ps();co(u,a,134217728,p)}K_(a,134217728)}},Er=function(a){if(a.tag===13){var u=wl(a),p=ba(a,u);if(p!==null){var w=Ps();co(p,a,u,w)}K_(a,u)}},ga=function(){return it},Wu=function(a,u){var p=it;try{return it=a,u()}finally{it=p}},Kr=function(a,u,p){switch(u){case"input":if(Dt(a,p),u=p.name,p.type==="radio"&&u!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<p.length;u++){var w=p[u];if(w!==a&&w.form===a.form){var E=i0(w);if(!E)throw Error(n(90));$e(w),Dt(w,E)}}}break;case"textarea":ke(a,p);break;case"select":u=p.value,u!=null&&Qe(a,!!p.multiple,u,!1)}},st=z_,cn=Fc;var pH={usingClientEntryPoint:!1,Events:[gh,ed,i0,cr,Ss,z_]},Ah={findFiberByHostInstance:Ac,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mH={bundleType:Ah.bundleType,version:Ah.version,rendererPackageName:Ah.rendererPackageName,rendererConfig:Ah.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=$s(a),a===null?null:a.stateNode},findFiberByHostInstance:Ah.findFiberByHostInstance||fH,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 U0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!U0.isDisabled&&U0.supportsFiber)try{ma=U0.inject(mH),as=U0}catch{}}return Bs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pH,Bs.createPortal=function(a,u){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!G_(u))throw Error(n(200));return dH(a,u,null,p)},Bs.createRoot=function(a,u){if(!G_(a))throw Error(n(299));var p=!1,w="",E=B8;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(E=u.onRecoverableError)),u=W_(a,1,!1,null,null,p,!1,w,E),a[va]=u.current,hh(a.nodeType===8?a.parentNode:a),new q_(u)},Bs.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=$s(u),a=a===null?null:a.stateNode,a},Bs.flushSync=function(a){return Fc(a)},Bs.hydrate=function(a,u,p){if(!V0(u))throw Error(n(200));return H0(null,a,u,!0,p)},Bs.hydrateRoot=function(a,u,p){if(!G_(a))throw Error(n(405));var w=p!=null&&p.hydratedSources||null,E=!1,T="",N=B8;if(p!=null&&(p.unstable_strictMode===!0&&(E=!0),p.identifierPrefix!==void 0&&(T=p.identifierPrefix),p.onRecoverableError!==void 0&&(N=p.onRecoverableError)),u=H8(u,null,a,1,p??null,E,!1,T,N),a[va]=u.current,hh(a),w)for(a=0;a<w.length;a++)p=w[a],E=p._getVersion,E=E(p._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[p,E]:u.mutableSourceEagerHydrationData.push(p,E);return new z0(u)},Bs.render=function(a,u,p){if(!V0(u))throw Error(n(200));return H0(null,a,u,!1,p)},Bs.unmountComponentAtNode=function(a){if(!V0(a))throw Error(n(40));return a._reactRootContainer?(Fc(function(){H0(null,null,a,!1,function(){a._reactRootContainer=null,a[va]=null})}),!0):!1},Bs.unstable_batchedUpdates=z_,Bs.unstable_renderSubtreeIntoContainer=function(a,u,p,w){if(!V0(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return H0(a,u,p,!1,w)},Bs.version="18.3.1-next-f1338f8080-20240426",Bs}var NA;function WD(){if(NA)return gw.exports;NA=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),gw.exports=Fie(),gw.exports}var LA;function jie(){if(LA)return vg;LA=1;var t=WD();return vg.createRoot=t.createRoot,vg.hydrateRoot=t.hydrateRoot,vg}var zie=jie();const Vie=A1(zie),Hie=t=>{const e=t==null?void 0:t.userId,n=t==null?void 0:t.email;g.useEffect(()=>{KN({userId:e,email:n})},[e,n])},Ua={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SENTRY_DSN:""};function KD(t){return"init"in t}function Hx(t){return typeof t.write=="function"}function Uie(t){return!!t.onMount}function DA(t){return"v"in t||"e"in t}function a1(t){if("e"in t)throw t.e;if((Ua?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function l1(t){return typeof(t==null?void 0:t.then)=="function"}function Bie(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function qD(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function GD(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function Zie(t){return!!t.INTERNAL_onInit}const Wie=(t,e,n,...r)=>n.read(...r),Kie=(t,e,n,...r)=>n.write(...r),qie=(t,e,n)=>n.INTERNAL_onInit(e),Gie=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},Yie=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),Zie(n)&&l(t,e,n)}return i},Xie=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],c=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=h=>{try{h()}catch(m){d.push(m)}};do{l.f&&f(l.f);const h=new Set;for(const m of s){const v=(n=r.get(m))==null?void 0:n.l;if(v)for(const y of v)h.add(y)}s.clear();for(const m of o)h.add(m);o.clear();for(const m of i)h.add(m);i.clear();for(const m of h)f(m);s.size&&c(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},Qie=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const c=[],d=[],f=new WeakSet,h=new WeakSet,m=[],v=[];for(const y of s)m.push(y),v.push(i(t,e,y));for(;m.length;){const y=m.length-1,_=m[y],b=v[y];if(h.has(_)){m.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===b.n)c.push(_),d.push(b);else if((Ua?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");h.add(_),m.pop(),v.pop();continue}f.add(_);for(const x of GD(_,b,n))f.has(x)||(m.push(x),v.push(i(t,e,x)))}for(let y=c.length-1;y>=0;--y){const _=c[y],b=d[y];let x=!1;for(const k of b.d.keys())if(k!==_&&s.has(k)){x=!0;break}x&&(r.set(_,b.n),o(t,e,_),l(t,e,_)),r.delete(_)}},Ux=new WeakSet,Jie=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],c=t[6],d=t[7],f=t[11],h=t[12],m=t[13],v=t[14],y=t[16],_=t[17],b=t[20],x=t[26],k=t[28],C=f(t,e,n),P=k[0];if(DA(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===P)return C.m=P,C;let j=!1;for(const[K,ee]of C.d)if(v(t,e,K).n!==ee){j=!0;break}if(!j)return C.m=P,C}let R=!0;const O=new Set(C.d.keys()),I=()=>{for(const j of O)C.d.delete(j)},A=()=>{if(i.has(n)){const j=!l.size;_(t,e,n),j&&(m(t,e),h(t,e))}},M=j=>{var K;if(j===n){const H=f(t,e,j);if(!DA(H))if(KD(j))b(t,e,j,j.init);else throw new Error("no atom init");return a1(H)}const ee=v(t,e,j);try{return a1(ee)}finally{O.delete(j),C.d.set(j,ee.n),l1(C.v)&&qD(n,C.v,ee),i.has(n)&&((K=i.get(j))==null||K.t.add(n)),R||A()}};let L,z;const $={get signal(){return L||(L=new AbortController),L.signal},get setSelf(){return(Ua?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Ua?"production":void 0)!=="production"&&!Hx(n)&&console.warn("setSelf function cannot be used with read-only atom"),!z&&Hx(n)&&(z=(...j)=>{if((Ua?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return y(t,e,n,j)}finally{m(t,e),h(t,e)}}),z}},q=C.n,X=o.get(n)===q;try{(Ua?"production":void 0)!=="production"&&Ux.delete(e);const j=d(t,e,n,M,$);if((Ua?"production":void 0)!=="production"&&Ux.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),b(t,e,n,j),l1(j)){x(t,e,j,()=>L==null?void 0:L.abort());const K=()=>{I(),A()};j.then(K,K)}else I();return(r=c.r)==null||r.call(c,n),C.m=P,C}catch(j){if(Bie(j))throw j;return delete C.v,C.e=j,++C.n,C.m=P,C}finally{R=!1,C.n!==q&&X&&(o.set(n,C.n),l.add(n),(s=c.c)==null||s.call(c,n))}},eoe=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),c=i(t,e,l);for(const d of GD(l,c,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},toe=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],c=t[12],d=t[13],f=t[14],h=t[15],m=t[16],v=t[17],y=t[20],_=t[28];let b=!0;const x=C=>a1(f(t,e,C)),k=(C,...P)=>{var R;const O=l(t,e,C);try{if(C===n){if(!KD(C))throw new Error("atom not writable");(Ua?"production":void 0)!=="production"&&Ux.add(e);const I=O.n,A=P[0];y(t,e,C,A),v(t,e,C),I!==O.n&&(++_[0],s.add(C),h(t,e,C),(R=i.c)==null||R.call(i,C));return}else return m(t,e,C,P)}finally{b||(d(t,e),c(t,e))}};try{return o(t,e,n,x,k,...r)}finally{b=!1}},noe=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],c=t[15],d=t[18],f=t[19],h=l(t,e,n),m=s.get(n);if(m&&h.d.size>0){for(const[v,y]of h.d)if(!m.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),m.d.add(v),y!==_.n&&(i.add(v),c(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of m.d)if(!h.d.has(v)){m.d.delete(v);const y=f(t,e,v);y==null||y.t.delete(n)}}},roe=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],c=t[11],d=t[12],f=t[13],h=t[14],m=t[16],v=t[18],y=c(t,e,n);let _=s.get(n);if(!_){h(t,e,n);for(const b of y.d.keys())v(t,e,b).t.add(n);if(_={l:new Set,d:new Set(y.d.keys()),t:new Set},s.set(n,_),Hx(n)&&Uie(n)){const b=()=>{let x=!0;const k=(...C)=>{try{return m(t,e,n,C)}finally{x||(f(t,e),d(t,e))}};try{const C=l(t,e,n,k);C&&(_.u=()=>{x=!0;try{C()}finally{x=!1}})}finally{x=!1}};i.add(b)}(r=o.m)==null||r.call(o,n)}return _},soe=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],c=t[11],d=t[19],f=c(t,e,n);let h=i.get(n);if(!h||h.l.size)return h;let m=!1;for(const v of h.t)if((r=i.get(v))!=null&&r.d.has(n)){m=!0;break}if(!m){h.u&&o.add(h.u),h=void 0,i.delete(n);for(const v of f.d.keys()){const y=d(t,e,v);y==null||y.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return h},ioe=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,c=o.v;if(l1(r))for(const d of o.d.keys())qD(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,l1(c)&&i(t,e,c))},ooe=(t,e,n)=>{const r=t[14];return a1(r(t,e,n))},aoe=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],c=s.size;try{return l(t,e,n,r)}finally{s.size!==c&&(o(t,e),i(t,e))}},loe=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},coe=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},uoe=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},YD=new WeakMap;function doe(t){const e=YD.get(t);if((Ua?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function foe(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Wie,Kie,qie,Gie,Yie,Xie,Qie,Jie,eoe,toe,noe,roe,soe,ioe,ooe,aoe,loe,void 0,new WeakMap,coe,uoe,[0]].map((o,l)=>t[l]||o);YD.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const XD={};let hoe=0;function gn(t,e){const n=`atom${++hoe}`,r={toString(){return(XD?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=poe,r.write=moe),r}function poe(t){return t(this)}function moe(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function goe(){return foe()}let Wh;function voe(){return Wh||(Wh=goe(),(XD?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Wh),globalThis.__JOTAI_DEFAULT_STORE__!==Wh&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Wh}const yoe={},_oe=g.createContext(void 0);function fE(t){return g.useContext(_oe)||voe()}const Bx=t=>typeof(t==null?void 0:t.then)=="function",Zx=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},woe=Ce.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Zx(t),t)}),_w=new WeakMap,$A=(t,e,n)=>{const r=doe(t),s=r[26];let i=_w.get(e);return i||(i=new Promise((o,l)=>{let c=e;const d=m=>v=>{c===m&&o(v)},f=m=>v=>{c===m&&l(v)},h=()=>{try{const m=n();Bx(m)?(_w.set(m,i),c=m,m.then(d(m),f(m)),s(r,t,m,h)):o(m)}catch(m){l(m)}};e.then(d(e),f(e)),s(r,t,e,h)}),_w.set(e,i)),i};function St(t,e){const{delay:n,unstable_promiseStatus:r=!Ce.use}={},s=fE(),[[i,o,l],c]=g.useReducer(f=>{const h=s.get(t);return Object.is(f[0],h)&&f[1]===s&&f[2]===t?f:[h,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(c(),d=s.get(t)),g.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const h=s.get(t);Bx(h)&&Zx($A(s,h,()=>s.get(t)))}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(c,n);return}c()});return c(),f},[s,t,n,r]),g.useDebugValue(d),Bx(d)){const f=$A(s,d,()=>s.get(t));return r&&Zx(f),woe(f)}return d}function Nt(t,e){const n=fE();return g.useCallback((...s)=>{if((yoe?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function QD(t,e){return[St(t),Nt(t)]}var $m=WD();const boe=A1($m);function xoe(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const Soe=t=>{switch(t){case"success":return Coe;case"info":return Toe;case"warning":return Poe;case"error":return Roe;default:return null}},koe=Array(12).fill(0),Eoe=({visible:t,className:e})=>Ce.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Ce.createElement("div",{className:"sonner-spinner"},koe.map((n,r)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Coe=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ce.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"})),Poe=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ce.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"})),Toe=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ce.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"})),Roe=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ce.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"})),Aoe=Ce.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"},Ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ioe=()=>{const[t,e]=Ce.useState(document.hidden);return Ce.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let Ooe=1;const Moe=100,FA=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:Ooe++};class Noe{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Moe;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=FA(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],Ce.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(Doe(d)&&!d.ok){i=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,y=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...y})}else if(d instanceof Error){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...y})}else if(n.success!==void 0){i=!1;const h=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:m,...y})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!Ce.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=FA(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Zs=new Noe,Loe=(t,e)=>Zs.message(t,e),Doe=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",$oe=Loe,Foe=()=>Zs.toasts,joe=()=>Zs.getActiveToasts(),on=Object.assign($oe,{success:Zs.success,info:Zs.info,warning:Zs.warning,error:Zs.error,custom:Zs.custom,message:Zs.message,promise:Zs.promise,dismiss:Zs.dismiss,loading:Zs.loading},{getHistory:Foe,getToasts:joe});xoe("[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 yg(t){return t.label!==void 0}const zoe=3,Voe="24px",Hoe="16px",jA=4e3,Uoe=356,Boe=14,Zoe=45,Woe=200;function Fo(...t){return t.filter(Boolean).join(" ")}function Koe(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const qoe=t=>{var e,n,r,s,i,o,l,c,d;const{invert:f,toast:h,unstyled:m,interacting:v,setHeights:y,visibleToasts:_,heights:b,index:x,toasts:k,expanded:C,removeToast:P,defaultRichColors:R,closeButton:O,style:I,cancelButtonStyle:A,actionButtonStyle:M,className:L="",descriptionClassName:z="",duration:$,position:q,gap:X,expandByDefault:j,classNames:K,icons:ee,closeButtonAriaLabel:H="Close toast"}=t,[Q,B]=Ce.useState(null),[D,G]=Ce.useState(null),[fe,ie]=Ce.useState(!1),[ue,he]=Ce.useState(!1),[we,le]=Ce.useState(!1),[se,be]=Ce.useState(!1),[Se,$e]=Ce.useState(!1),[kt,tn]=Ce.useState(0),[nn,xt]=Ce.useState(0),Dt=Ce.useRef(h.duration||$||jA),un=Ce.useRef(null),Kt=Ce.useRef(null),Le=x===0,Qe=x+1<=_,Ae=h.type,Ct=Ae??"default",ke=h.dismissible!==!1,$t=h.className||"",ft=h.descriptionClassName||"",pt=Ce.useMemo(()=>b.findIndex(st=>st.toastId===h.id)||0,[b,h.id]),tr=Ce.useMemo(()=>{var st;return(st=h.closeButton)!=null?st:O},[h.closeButton,O]),Mi=Ce.useMemo(()=>h.duration||$||jA,[h.duration,$]),Pn=Ce.useRef(0),lr=Ce.useRef(0),no=Ce.useRef(0),xs=Ce.useRef(null),[ss,nr]=q.split("-"),vn=Ce.useMemo(()=>b.reduce((st,cn,rn)=>rn>=pt?st:st+cn.height,0),[b,pt]),is=Ioe(),pr=Ce.useMemo(()=>{var st;return(st=t.swipeDirections)!=null?st:Koe(q)},[t.swipeDirections,q]),Eo=h.invert||f,Kr=Ae==="loading";lr.current=Ce.useMemo(()=>pt*X+vn,[pt,vn]),Ce.useEffect(()=>{Dt.current=Mi},[Mi]),Ce.useEffect(()=>{ie(!0)},[]),Ce.useEffect(()=>{const st=Kt.current;if(st){const cn=st.getBoundingClientRect().height;return xt(cn),y(rn=>[{toastId:h.id,height:cn,position:h.position},...rn]),()=>y(rn=>rn.filter(yn=>yn.toastId!==h.id))}},[y,h.id]),Ce.useLayoutEffect(()=>{if(!fe)return;const st=Kt.current,cn=st.style.height;st.style.height="auto";const rn=st.getBoundingClientRect().height;st.style.height=cn,xt(rn),y(yn=>yn.find(qt=>qt.toastId===h.id)?yn.map(qt=>qt.toastId===h.id?{...qt,height:rn}:qt):[{toastId:h.id,height:rn,position:h.position},...yn])},[fe,h.title,h.description,y,h.id,h.jsx,h.action,h.cancel]);const rr=Ce.useCallback(()=>{he(!0),tn(lr.current),y(st=>st.filter(cn=>cn.toastId!==h.id)),setTimeout(()=>{P(h)},Woe)},[h,P,y,lr]);Ce.useEffect(()=>{if(h.promise&&Ae==="loading"||h.duration===1/0||h.type==="loading")return;let st;return C||v||is?(()=>{if(no.current<Pn.current){const yn=new Date().getTime()-Pn.current;Dt.current=Dt.current-yn}no.current=new Date().getTime()})():(()=>{Dt.current!==1/0&&(Pn.current=new Date().getTime(),st=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),rr()},Dt.current))})(),()=>clearTimeout(st)},[C,v,h,Ae,is,rr]),Ce.useEffect(()=>{h.delete&&(rr(),h.onDismiss==null||h.onDismiss.call(h,h))},[rr,h.delete]);function Lr(){var st;if(ee!=null&&ee.loading){var cn;return Ce.createElement("div",{className:Fo(K==null?void 0:K.loader,h==null||(cn=h.classNames)==null?void 0:cn.loader,"sonner-loader"),"data-visible":Ae==="loading"},ee.loading)}return Ce.createElement(Eoe,{className:Fo(K==null?void 0:K.loader,h==null||(st=h.classNames)==null?void 0:st.loader),visible:Ae==="loading"})}const li=h.icon||(ee==null?void 0:ee[Ae])||Soe(Ae);var cr,Ss;return Ce.createElement("li",{tabIndex:0,ref:Kt,className:Fo(L,$t,K==null?void 0:K.toast,h==null||(e=h.classNames)==null?void 0:e.toast,K==null?void 0:K[Ct],h==null||(n=h.classNames)==null?void 0:n[Ct]),"data-sonner-toast":"","data-rich-colors":(cr=h.richColors)!=null?cr:R,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":fe,"data-promise":!!h.promise,"data-swiped":Se,"data-removed":ue,"data-visible":Qe,"data-y-position":ss,"data-x-position":nr,"data-index":x,"data-front":Le,"data-swiping":we,"data-dismissible":ke,"data-type":Ae,"data-invert":Eo,"data-swipe-out":se,"data-swipe-direction":D,"data-expanded":!!(C||j&&fe),"data-testid":h.testId,style:{"--index":x,"--toasts-before":x,"--z-index":k.length-x,"--offset":`${ue?kt:lr.current}px`,"--initial-height":j?"auto":`${nn}px`,...I,...h.style},onDragEnd:()=>{le(!1),B(null),xs.current=null},onPointerDown:st=>{st.button!==2&&(Kr||!ke||(un.current=new Date,tn(lr.current),st.target.setPointerCapture(st.pointerId),st.target.tagName!=="BUTTON"&&(le(!0),xs.current={x:st.clientX,y:st.clientY})))},onPointerUp:()=>{var st,cn,rn;if(se||!ke)return;xs.current=null;const yn=Number(((st=Kt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((cn=Kt.current)==null?void 0:cn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((rn=un.current)==null?void 0:rn.getTime()),$n=Q==="x"?yn:Tn,os=Math.abs($n)/qt;if((Q==="x"?pr.includes(yn>0?"right":"left"):pr.includes(Tn>0?"bottom":"top"))&&(Math.abs($n)>=Zoe||os>.11)){tn(lr.current),h.onDismiss==null||h.onDismiss.call(h,h),G(Q==="x"?yn>0?"right":"left":Tn>0?"down":"up"),rr(),be(!0);return}else{var kr,Ut;(kr=Kt.current)==null||kr.style.setProperty("--swipe-amount-x","0px"),(Ut=Kt.current)==null||Ut.style.setProperty("--swipe-amount-y","0px")}$e(!1),le(!1),B(null)},onPointerMove:st=>{var cn,rn,yn;if(!xs.current||!ke||((cn=window.getSelection())==null?void 0:cn.toString().length)>0)return;const qt=st.clientY-xs.current.y,$n=st.clientX-xs.current.x;!Q&&(Math.abs($n)>1||Math.abs(qt)>1)&&B(Math.abs($n)>Math.abs(qt)?"x":"y");let os={x:0,y:0};const sr=kr=>1/(1.5+Math.abs(kr)/20);if(Q==="y"){if(pr.includes("top")||pr.includes("bottom"))if(pr.includes("top")&&qt<0||pr.includes("bottom")&&qt>0)os.y=qt;else{const kr=qt*sr(qt);os.y=Math.abs(kr)<Math.abs(qt)?kr:qt}}else if(Q==="x"&&(pr.includes("left")||pr.includes("right")))if(pr.includes("left")&&$n<0||pr.includes("right")&&$n>0)os.x=$n;else{const kr=$n*sr($n);os.x=Math.abs(kr)<Math.abs($n)?kr:$n}(Math.abs(os.x)>0||Math.abs(os.y)>0)&&$e(!0),(rn=Kt.current)==null||rn.style.setProperty("--swipe-amount-x",`${os.x}px`),(yn=Kt.current)==null||yn.style.setProperty("--swipe-amount-y",`${os.y}px`)}},tr&&!h.jsx&&Ae!=="loading"?Ce.createElement("button",{"aria-label":H,"data-disabled":Kr,"data-close-button":!0,onClick:Kr||!ke?()=>{}:()=>{rr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Fo(K==null?void 0:K.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Ss=ee==null?void 0:ee.close)!=null?Ss:Aoe):null,(Ae||h.icon||h.promise)&&h.icon!==null&&((ee==null?void 0:ee[Ae])!==null||h.icon)?Ce.createElement("div",{"data-icon":"",className:Fo(K==null?void 0:K.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},Ae==="loading"?h.icon||Lr():h.promise?Lr():null,Ae!=="loading"?li:null):null,Ce.createElement("div",{"data-content":"",className:Fo(K==null?void 0:K.content,h==null||(i=h.classNames)==null?void 0:i.content)},Ce.createElement("div",{"data-title":"",className:Fo(K==null?void 0:K.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ce.createElement("div",{"data-description":"",className:Fo(z,ft,K==null?void 0:K.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),Ce.isValidElement(h.cancel)?h.cancel:h.cancel&&yg(h.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:st=>{yg(h.cancel)&&ke&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,st),rr())},className:Fo(K==null?void 0:K.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,Ce.isValidElement(h.action)?h.action:h.action&&yg(h.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||M,onClick:st=>{yg(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,st),!st.defaultPrevented&&rr())},className:Fo(K==null?void 0:K.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function zA(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Goe(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?Hoe:Voe;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const Yoe=Ce.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:f,mobileOffset:h,theme:m="light",richColors:v,duration:y,style:_,visibleToasts:b=zoe,toastOptions:x,dir:k=zA(),gap:C=Boe,icons:P,customAriaLabel:R,containerAriaLabel:O="Notifications"}=e,[I,A]=Ce.useState([]),M=Ce.useMemo(()=>r?I.filter(ie=>ie.toasterId===r):I.filter(ie=>!ie.toasterId),[I,r]),L=Ce.useMemo(()=>Array.from(new Set([i].concat(M.filter(ie=>ie.position).map(ie=>ie.position)))),[M,i]),[z,$]=Ce.useState([]),[q,X]=Ce.useState(!1),[j,K]=Ce.useState(!1),[ee,H]=Ce.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=Ce.useRef(null),B=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Ce.useRef(null),G=Ce.useRef(!1),fe=Ce.useCallback(ie=>{A(ue=>{var he;return(he=ue.find(we=>we.id===ie.id))!=null&&he.delete||Zs.dismiss(ie.id),ue.filter(({id:we})=>we!==ie.id)})},[]);return Ce.useEffect(()=>Zs.subscribe(ie=>{if(ie.dismiss){requestAnimationFrame(()=>{A(ue=>ue.map(he=>he.id===ie.id?{...he,delete:!0}:he))});return}setTimeout(()=>{boe.flushSync(()=>{A(ue=>{const he=ue.findIndex(we=>we.id===ie.id);return he!==-1?[...ue.slice(0,he),{...ue[he],...ie},...ue.slice(he+1)]:[ie,...ue]})})})}),[]),Ce.useEffect(()=>{if(m!=="system"){H(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const ie=window.matchMedia("(prefers-color-scheme: dark)");try{ie.addEventListener("change",({matches:ue})=>{H(ue?"dark":"light")})}catch{ie.addListener(({matches:he})=>{try{H(he?"dark":"light")}catch(we){console.error(we)}})}},[m]),Ce.useEffect(()=>{I.length<=1&&X(!1)},[I]),Ce.useEffect(()=>{const ie=ue=>{var he;if(o.length>0&&o.every(se=>ue[se]||ue.code===se)){var le;X(!0),(le=Q.current)==null||le.focus()}ue.code==="Escape"&&(document.activeElement===Q.current||(he=Q.current)!=null&&he.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[o]),Ce.useEffect(()=>{if(Q.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,G.current=!1)}},[Q.current]),Ce.createElement("section",{ref:n,"aria-label":R??`${O} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},L.map((ie,ue)=>{var he;const[we,le]=ie.split("-");return M.length?Ce.createElement("ol",{key:ie,dir:k==="auto"?zA():k,tabIndex:-1,ref:Q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":ee,"data-y-position":we,"data-x-position":le,style:{"--front-toast-height":`${((he=z[0])==null?void 0:he.height)||0}px`,"--width":`${Uoe}px`,"--gap":`${C}px`,..._,...Goe(f,h)},onBlur:se=>{G.current&&!se.currentTarget.contains(se.relatedTarget)&&(G.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||G.current||(G.current=!0,D.current=se.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{j||X(!1)},onDragEnd:()=>X(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},M.filter(se=>!se.position&&ue===0||se.position===ie).map((se,be)=>{var Se,$e;return Ce.createElement(qoe,{key:se.id,icons:P,index:be,toast:se,defaultRichColors:v,duration:(Se=x==null?void 0:x.duration)!=null?Se:y,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:s,visibleToasts:b,closeButton:($e=x==null?void 0:x.closeButton)!=null?$e:c,interacting:j,position:ie,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:fe,toasts:M.filter(kt=>kt.position==se.position),heights:z.filter(kt=>kt.position==se.position),setHeights:$,expandByDefault:l,gap:C,expanded:q,swipeDirections:e.swipeDirections})})):null}))}),Xoe=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),Qoe=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"}))]]),Joe=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"}))]]),eae=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"}))]]),tae=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"}))]]),nae=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"}))]]),rae=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"}))]]),sae=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"}))]]),iae=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"}))]]),oae=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"}))]]),aae=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"}))]]),lae=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"}))]]),cae=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"}))]]),uae=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"}))]]),dae=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"}))]]),fae=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"}))]]),hae=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"}))]]),pae=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"}))]]),mae=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),gae=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"}))]]),vae=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"}))]]),yae=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"}))]]),_ae=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"}))]]),wae=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"}))]]),bae=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"}))]]),xae=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),In=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:c,...d}=t,{color:f="currentColor",size:h,weight:m="regular",mirrored:v=!1,...y}=g.useContext(xae);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??h,height:s??h,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...y,...d},!!n&&g.createElement("title",null,n),l,c.get(i??m))});In.displayName="IconBase";const JD=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Xoe}));JD.displayName="ArrowLeftIcon";const Sae=JD,e9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Qoe}));e9.displayName="ArrowUpIcon";const kae=e9,t9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:Joe}));t9.displayName="CaretDownIcon";const Eae=t9,n9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:eae}));n9.displayName="CaretRightIcon";const Cae=n9,r9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:tae}));r9.displayName="ChatCircleIcon";const Pae=r9,s9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:nae}));s9.displayName="CheckIcon";const Tae=s9,i9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:rae}));i9.displayName="CircleNotchIcon";const q1=i9,o9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:sae}));o9.displayName="CopyIcon";const sm=o9,a9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:iae}));a9.displayName="DotsThreeIcon";const Rae=a9,l9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:oae}));l9.displayName="FolderOpenIcon";const Aae=l9,c9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:aae}));c9.displayName="FolderSimpleIcon";const Iae=c9,u9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:lae}));u9.displayName="HashIcon";const Oae=u9,d9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:cae}));d9.displayName="MagnifyingGlassIcon";const Mae=d9,f9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:uae}));f9.displayName="PencilSimpleIcon";const h9=f9,p9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:dae}));p9.displayName="PushPinIcon";const Wx=p9,m9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:fae}));m9.displayName="SidebarSimpleIcon";const Nae=m9,g9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:hae}));g9.displayName="SignInIcon";const Lae=g9,v9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:pae}));v9.displayName="SignOutIcon";const Dae=v9,y9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:mae}));y9.displayName="SparkleIcon";const ww=y9,_9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:gae}));_9.displayName="SquaresFourIcon";const $ae=_9,w9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:vae}));w9.displayName="SwatchesIcon";const b9=w9,x9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:yae}));x9.displayName="TrashIcon";const S9=x9,k9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:_ae}));k9.displayName="UserIcon";const Fae=k9,E9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:wae}));E9.displayName="XIcon";const hE=E9,C9=g.forwardRef((t,e)=>g.createElement(In,{ref:e,...t,weights:bae}));C9.displayName="XLogoIcon";const jae=C9,zae="/assets/arena-Db0j1set.png",Vae="data:image/svg+xml,%3csvg%20width='38'%20height='42'%20viewBox='0%200%2038%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2543_2)'%3e%3cmask%20id='mask0_2543_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='38'%20height='42'%3e%3cpath%20d='M0%200H38V42H0V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2543_2)'%3e%3cpath%20d='M19.025%2011.898C22.321%2011.898%2024.995%209.237%2024.995%205.949C24.995%202.661%2022.324%200%2019.025%200C15.726%200%2013.055%202.662%2013.055%205.95C13.055%209.237%2015.726%2011.898%2019.025%2011.898ZM19.025%2041.945C22.321%2041.945%2024.995%2039.283%2024.995%2035.995C24.995%2032.708%2022.324%2030.046%2019.025%2030.046C15.726%2030.046%2013.055%2032.708%2013.055%2035.996C13.055%2039.283%2015.726%2041.945%2019.025%2041.945ZM5.97%2019.41C9.266%2019.41%2011.94%2016.748%2011.94%2013.46C11.94%2010.173%209.268%207.511%205.97%207.511C2.67%207.511%200%2010.175%200%2013.463C0%2016.752%202.67%2019.413%205.97%2019.413V19.41ZM32.08%2034.434C35.376%2034.434%2038.05%2031.772%2038.05%2028.484C38.05%2025.197%2035.379%2022.535%2032.08%2022.535C28.781%2022.535%2026.11%2025.197%2026.11%2028.485C26.11%2031.772%2028.781%2034.434%2032.08%2034.434ZM32.08%2019.41C35.376%2019.41%2038.05%2016.748%2038.05%2013.46C38.05%2010.174%2035.379%207.512%2032.08%207.512C28.781%207.512%2026.11%2010.174%2026.11%2013.461C26.11%2016.748%2028.781%2019.41%2032.08%2019.41ZM5.97%2034.433C9.266%2034.433%2011.94%2031.771%2011.94%2028.483C11.94%2025.196%209.268%2022.535%205.97%2022.535C2.67%2022.535%200%2025.202%200%2028.486C0%2031.771%202.67%2034.436%205.97%2034.436V34.433Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2543_2'%3e%3crect%20width='38'%20height='42'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function P9(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=P9(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function T9(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=P9(t))&&(r&&(r+=" "),r+=e);return r}const Hae=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},Uae=(t,e)=>({classGroupId:t,validator:e}),R9=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),c1="-",VA=[],Bae="arbitrary..",Zae=t=>{const e=Kae(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Wae(o);const l=o.split(c1),c=l[0]===""&&l.length>1?1:0;return A9(l,c,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?Hae(d,c):c:d||VA}return n[o]||VA}}},A9=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=A9(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(c1):t.slice(e).join(c1),c=o.length;for(let d=0;d<c;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},Wae=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Bae+r:void 0})(),Kae=t=>{const{theme:e,classGroups:n}=t;return qae(n,e)},qae=(t,e)=>{const n=R9();for(const r in t){const s=t[r];pE(s,n,r,e)}return n},pE=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];Gae(o,e,n,r)}},Gae=(t,e,n,r)=>{if(typeof t=="string"){Yae(t,e,n);return}if(typeof t=="function"){Xae(t,e,n,r);return}Qae(t,e,n,r)},Yae=(t,e,n)=>{const r=t===""?e:I9(e,t);r.classGroupId=n},Xae=(t,e,n,r)=>{if(Jae(t)){pE(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Uae(n,t))},Qae=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,c]=s[o];pE(c,I9(e,l),n,r)}},I9=(t,e)=>{let n=t;const r=e.split(c1),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=R9(),n.nextPart.set(o,l)),n=l}return n},Jae=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,ele=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},Kx="!",HA=":",tle=[],UA=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),nle=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,c=0,d;const f=s.length;for(let _=0;_<f;_++){const b=s[_];if(o===0&&l===0){if(b===HA){i.push(s.slice(c,_)),c=_+1;continue}if(b==="/"){d=_;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const h=i.length===0?s:s.slice(c);let m=h,v=!1;h.endsWith(Kx)?(m=h.slice(0,-1),v=!0):h.startsWith(Kx)&&(m=h.slice(1),v=!0);const y=d&&d>c?d-c:void 0;return UA(i,v,m,y)};if(e){const s=e+HA,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):UA(tle,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},rle=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",c=e.has(o);l||c?(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}},sle=t=>({cache:ele(t.cacheSize),parseClassName:nle(t),sortModifiers:rle(t),postfixLookupClassGroupIds:ile(t),...Zae(t)}),ile=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},ole=/\s+/,ale=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],c=t.trim().split(ole);let d="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{isExternal:m,modifiers:v,hasImportantModifier:y,baseClassName:_,maybePostfixModifierPosition:b}=n(h);if(m){d=h+(d.length>0?" "+d:d);continue}let x=!!b,k;if(x){const I=_.substring(0,b);k=r(I);const A=k&&o[k]?r(_):void 0;A&&A!==k&&(k=A,x=!1)}else k=r(_);if(!k){if(!x){d=h+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=h+(d.length>0?" "+d:d);continue}x=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),P=y?C+Kx:C,R=P+k;if(l.indexOf(R)>-1)continue;l.push(R);const O=s(k,x);for(let I=0;I<O.length;++I){const A=O[I];l.push(P+A)}d=h+(d.length>0?" "+d:d)}return d},lle=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=O9(n))&&(s&&(s+=" "),s+=r);return s},O9=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=O9(t[r]))&&(n&&(n+=" "),n+=e);return n},cle=(t,...e)=>{let n,r,s,i;const o=c=>{const d=e.reduce((f,h)=>h(f),t());return n=sle(d),r=n.cache.get,s=n.cache.set,i=l,l(c)},l=c=>{const d=r(c);if(d)return d;const f=ale(c,n);return s(c,f),f};return i=o,(...c)=>i(lle(...c))},ule=[],Rr=t=>{const e=n=>n[t]||ule;return e.isThemeGetter=!0,e.themeKey=t,e},M9=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,N9=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dle=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fle=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hle=/\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$/,ple=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,mle=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gle=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pl=t=>dle.test(t),At=t=>!!t&&!Number.isNaN(Number(t)),jo=t=>!!t&&Number.isInteger(Number(t)),bw=t=>t.endsWith("%")&&At(t.slice(0,-1)),Pa=t=>fle.test(t),L9=()=>!0,vle=t=>hle.test(t)&&!ple.test(t),mE=()=>!1,yle=t=>mle.test(t),_le=t=>gle.test(t),wle=t=>!Ve(t)&&!Be(t),ble=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),xle=t=>bc(t,F9,mE),Ve=t=>M9.test(t),qc=t=>bc(t,j9,vle),BA=t=>bc(t,Ale,At),Sle=t=>bc(t,V9,L9),kle=t=>bc(t,z9,mE),ZA=t=>bc(t,D9,mE),Ele=t=>bc(t,$9,_le),_g=t=>bc(t,H9,yle),Be=t=>N9.test(t),Kh=t=>Vu(t,j9),Cle=t=>Vu(t,z9),WA=t=>Vu(t,D9),Ple=t=>Vu(t,F9),Tle=t=>Vu(t,$9),wg=t=>Vu(t,H9,!0),Rle=t=>Vu(t,V9,!0),bc=(t,e,n)=>{const r=M9.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Vu=(t,e,n=!1)=>{const r=N9.exec(t);return r?r[1]?e(r[1]):n:!1},D9=t=>t==="position"||t==="percentage",$9=t=>t==="image"||t==="url",F9=t=>t==="length"||t==="size"||t==="bg-size",j9=t=>t==="length",Ale=t=>t==="number",z9=t=>t==="family-name",V9=t=>t==="number"||t==="weight",H9=t=>t==="shadow",Ile=()=>{const t=Rr("color"),e=Rr("font"),n=Rr("text"),r=Rr("font-weight"),s=Rr("tracking"),i=Rr("leading"),o=Rr("breakpoint"),l=Rr("container"),c=Rr("spacing"),d=Rr("radius"),f=Rr("shadow"),h=Rr("inset-shadow"),m=Rr("text-shadow"),v=Rr("drop-shadow"),y=Rr("blur"),_=Rr("perspective"),b=Rr("aspect"),x=Rr("ease"),k=Rr("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...P(),Be,Ve],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],A=()=>[Be,Ve,c],M=()=>[Pl,"full","auto",...A()],L=()=>[jo,"none","subgrid",Be,Ve],z=()=>["auto",{span:["full",jo,Be,Ve]},jo,Be,Ve],$=()=>[jo,"auto",Be,Ve],q=()=>["auto","min","max","fr",Be,Ve],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...A()],ee=()=>[Pl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],H=()=>[l,Pl,"screen","full","dvw","lvw","svw","min","max","fit",...A()],Q=()=>[Pl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],B=()=>[t,Be,Ve],D=()=>[...P(),WA,ZA,{position:[Be,Ve]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],fe=()=>["auto","cover","contain",Ple,xle,{size:[Be,Ve]}],ie=()=>[bw,Kh,qc],ue=()=>["","none","full",d,Be,Ve],he=()=>["",At,Kh,qc],we=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[At,bw,WA,ZA],be=()=>["","none",y,Be,Ve],Se=()=>["none",At,Be,Ve],$e=()=>["none",At,Be,Ve],kt=()=>[At,Be,Ve],tn=()=>[Pl,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pa],breakpoint:[Pa],color:[L9],container:[Pa],"drop-shadow":[Pa],ease:["in","out","in-out"],font:[wle],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pa],shadow:[Pa],spacing:["px",At],text:[Pa],"text-shadow":[Pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pl,Ve,Be,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Be,Ve]}],"container-named":[ble],columns:[{columns:[At,"auto",Ve,Be,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[jo,"auto",Be,Ve]}],basis:[{basis:[Pl,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Pl,"auto","initial","none",Ve]}],grow:[{grow:["",At,Be,Ve]}],shrink:[{shrink:["",At,Be,Ve]}],order:[{order:[jo,"first","last","none",Be,Ve]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],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:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...ee()]}],"min-w":[{"min-w":[l,"screen","none",...ee()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh","none",...ee()]}],"font-size":[{text:["base",n,Kh,qc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Rle,Sle]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bw,Ve]}],"font-family":[{font:[Cle,kle,e]}],"font-features":[{"font-features":[Ve]}],"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,Ve]}],"line-clamp":[{"line-clamp":[At,"none",Be,BA]}],leading:[{leading:["none",i,...A()]}],"list-image":[{"list-image":["none",Be,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Be,qc]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[At,"auto",Be,Ve]}],"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:[jo,Be,Ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,Ve]}],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,Ve]}],"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:G()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jo,Be,Ve],radial:["",Be,Ve],conic:["",jo,Be,Ve]},Tle,Ele]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"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:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Be,Ve]}],"outline-w":[{outline:["",At,Kh,qc]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","inner","none",f,wg,_g]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",h,wg,_g]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[At,qc]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",m,wg,_g]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[At,Be,Ve]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"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":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Be,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,Ve]}],filter:[{filter:["","none",Be,Ve]}],blur:[{blur:be()}],brightness:[{brightness:[At,Be,Ve]}],contrast:[{contrast:[At,Be,Ve]}],"drop-shadow":[{"drop-shadow":["","none",v,wg,_g]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",At,Be,Ve]}],"hue-rotate":[{"hue-rotate":[At,Be,Ve]}],invert:[{invert:["",At,Be,Ve]}],saturate:[{saturate:[At,Be,Ve]}],sepia:[{sepia:["",At,Be,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,Ve]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[At,Be,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[At,Be,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Be,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Be,Ve]}],"backdrop-invert":[{"backdrop-invert":["",At,Be,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[At,Be,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[At,Be,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Be,Ve]}],"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,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Be,Ve]}],ease:[{ease:["linear","initial",x,Be,Ve]}],delay:[{delay:[At,Be,Ve]}],animate:[{animate:["none",k,Be,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Be,Ve]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:$e()}],"scale-x":[{"scale-x":$e()}],"scale-y":[{"scale-y":$e()}],"scale-z":[{"scale-z":$e()}],"scale-3d":["scale-3d"],skew:[{skew:kt()}],"skew-x":[{"skew-x":kt()}],"skew-y":[{"skew-y":kt()}],transform:[{transform:[Be,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tn()}],"translate-x":[{"translate-x":tn()}],"translate-y":[{"translate-y":tn()}],"translate-z":[{"translate-z":tn()}],"translate-none":["translate-none"],zoom:[{zoom:[jo,Be,Ve]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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,Ve]}],"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":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"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,Ve]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[At,Kh,qc,BA]}],stroke:[{stroke:["none",...B()]}],"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"]}},Ole=cle(Ile);function mn(...t){return Ole(T9(t))}const Ap=({provider:t,className:e})=>{if(t==="x")return S.jsx(jae,{className:mn("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return S.jsx("svg",{viewBox:"0 0 24 24",className:mn("h-6 w-6",e),"aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})});const n=t==="cosmos"?Vae:zae;return S.jsx("span",{"aria-hidden":"true",className:mn("h-6 w-6",t==="cosmos"?"bg-current":"bg-[#b1b1b1]",e),style:{WebkitMaskImage:`url("${n}")`,maskImage:`url("${n}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}})},Mle=t=>{const e=new URL(t).hostname.replace(/^www\./,"");return e==="are.na"?"arena":e==="pinterest.com"||e==="pin.it"?"pinterest":e==="x.com"?"x":e==="cosmos.so"?"cosmos":null},Nle=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=g.useState(!1),i=!!e&&!r,o=t.url?Mle(t.url):null,l=t.url??(i?e:void 0),c=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return S.jsxs(c,{href:l,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,"aria-label":t.title,onPointerDown:f=>f.stopPropagation(),onKeyDown:f=>{(f.key!=="ArrowUp"&&f.key!=="ArrowDown"||f.altKey||f.ctrlKey||f.metaKey||f.shiftKey)&&f.stopPropagation()},onClick:f=>{f.stopPropagation(),l&&n()},className:mn("border-main-border bg-main-input text-content hover:border-content-muted/50 flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs focus-visible:outline-2 focus-visible:-outline-offset-2",!i&&"py-1.5 pl-2"),children:[i?S.jsx("img",{src:e,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?S.jsx(Ap,{provider:o,className:mn("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?S.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},Lle=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Ii(),l=cJ(t);return l?S.jsx("div",{className:mn("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:l.map(c=>{var h;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=c.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(c.id)}/image${d}`:void 0;return S.jsx(Nle,{reference:c,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${c.id}:${((h=c.image)==null?void 0:h.hash)??""}:${f??""}`)})}):null},dye=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]==="references")return{kind:"references"};if(e[2]!=="projects"||!n)return{kind:"library"};const r=e[4]==="variants"?e[5]:void 0,s=e[4]==="variants"?e[6]:void 0,i=new URLSearchParams(t.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},fye=t=>{if(t.kind==="references")return"/rivet/library/references";if(t.kind==="library"||!t.projectId)return"/rivet/library";const e=`/rivet/library/projects/${encodeURIComponent(t.projectId)}`;return t.sessionId&&t.variantId?`${e}/variants/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${t.kind==="workspace"?"?edit=1":""}`:e},Dle=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},KA=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,qA=T9,$le=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return qA(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],h=i==null?void 0:i[d];if(f===null)return null;const m=KA(f)||KA(h);return s[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:m,...v}=f;return Object.entries(v).every(y=>{let[_,b]=y;return Array.isArray(b)?b.includes({...i,...l}[_]):{...i,...l}[_]===b})?[...d,h,m]:d},[]);return qA(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},U9={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},B9=g.createContext(null);function Fm(){const t=g.useContext(B9);return t?t.classes:U9.pill}function Fle(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function jle({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{Fle(()=>r(i))},[]);return S.jsx(B9.Provider,{value:{shape:n,setShape:s,classes:U9[n]},children:t})}const zle=$le(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-none","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50","focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground aria-expanded:text-foreground aria-pressed:text-foreground"},size:{default:"h-9 gap-1.5 px-4 text-[13px]",compact:"h-7 gap-1 px-3 text-[12px]",icon:"h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4","icon-compact":"h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5"},iconLeft:{true:""},iconRight:{true:""}},compoundVariants:[{size:"compact",iconLeft:!0,className:"pl-2"},{size:"default",iconLeft:!0,className:"pl-3"},{size:"compact",iconRight:!0,className:"pr-2"},{size:"default",iconRight:!0,className:"pr-3"}],defaultVariants:{variant:"secondary",size:"default"}}),GA={default:16,compact:14},Vle={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",secondary:"[--btn-bg:var(--accent)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active/button:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",tertiary:"bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover/button:bg-hover group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]",ghost:"bg-transparent shadow-[0_0_0_1px_transparent] group-hover/button:bg-hover group-hover/button:shadow-[0_0_0_1px_var(--hover)] group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:bg-active group-aria-expanded/button:shadow-[0_0_0_0px_var(--active)] group-aria-pressed/button:bg-active group-aria-pressed/button:shadow-[0_0_0_0px_var(--active)]"},Z9=g.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:c="button",...d},f)=>{const h=e??"secondary",m=n??"default",v=m==="icon"||m==="icon-compact",y=m==="compact"||m==="icon-compact",_=y?GA.compact:GA.default,b=Fm();return S.jsxs("button",{...d,ref:f,type:c,disabled:o||r,"aria-busy":r||d["aria-busy"],className:mn(zle({variant:h,size:m,iconLeft:!v&&!!s,iconRight:!v&&!!i}),b.button,t),children:[S.jsx("span",{"aria-hidden":!0,className:mn("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",Vle[h])}),S.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[S.jsxs("span",{className:mn("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?S.jsx(s,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null,S.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?S.jsx(i,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?S.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:S.jsx("svg",{className:y?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:S.jsx("path",{d:"M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",stroke:"currentColor",strokeWidth:"1.125",strokeLinecap:"round",pathLength:"100",className:"motion-safe:animate-[spinner-move_2s_linear_infinite,spinner-dash_4s_ease-in-out_infinite]",style:{strokeDasharray:"15 85"}})})}):null]})]})});Z9.displayName="Button";var Hle=Object.defineProperty,Qf=(t,e)=>Hle(t,"name",{value:e,configurable:!0}),W9=!!(typeof window<"u"&&window.document&&window.document.createElement);function bn(t,e,{checkForDefaultPrevented:n=!0}={}){return Qf(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Qf(bn,"composeEventHandlers");function Ule(t){var e;if(!W9)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Qf(Ule,"getOwnerWindow");function qx(t){if(!W9)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Qf(qx,"getOwnerDocument");function K9(t,e=!1){const{activeElement:n}=qx(t);if(!(n!=null&&n.nodeName))return null;if(q9(n)&&n.contentDocument)return K9(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=qx(n).getElementById(r);if(s)return s}}return n}Qf(K9,"getActiveElement");function q9(t){return t.tagName==="IFRAME"}Qf(q9,"isFrame");var Ble=Object.defineProperty,gE=(t,e)=>Ble(t,"name",{value:e,configurable:!0});function Gx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}gE(Gx,"setRef");function G9(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Gx(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Gx(t[s],null)}}}}gE(G9,"composeRefs");function xn(...t){return g.useCallback(G9(...t),t)}gE(xn,"useComposedRefs");var Zle=Object.defineProperty,Ki=(t,e)=>Zle(t,"name",{value:e,configurable:!0});function Wle(t,e){const n=g.createContext(e);n.displayName=t+"Context";const r=Ki(i=>{const{children:o,...l}=i,c=g.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:c,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,c=g.useContext(n);if(c)return c;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ki(s,"useContext"),[r,s]}Ki(Wle,"createContext");function ha(t,e=[]){let n=[];function r(i,o){const l=g.createContext(o);l.displayName=i+"Context";const c=n.length;n=[...n,o];const d=Ki(h=>{var x;const{scope:m,children:v,...y}=h,_=((x=m==null?void 0:m[t])==null?void 0:x[c])||l,b=g.useMemo(()=>y,Object.values(y));return S.jsx(_.Provider,{value:b,children:v})},"Provider");d.displayName=i+"Provider";function f(h,m,v={}){var x;const{optional:y=!1}=v,_=((x=m==null?void 0:m[t])==null?void 0:x[c])||l,b=g.useContext(_);if(b)return b;if(o!==void 0)return o;if(!y)throw new Error(`\`${h}\` must be used within \`${i}\``)}return Ki(f,"useContext"),[d,f]}Ki(r,"createContext");const s=Ki(()=>{const i=n.map(o=>g.createContext(o));return Ki(function(l){const c=(l==null?void 0:l[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])},"useScope")},"createScope");return s.scopeName=t,[r,Y9(s,...e)]}Ki(ha,"createContextScope");function Y9(...t){const e=t[0];if(t.length===1)return e;const n=Ki(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ki(function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const h=c(i)[`__scope${d}`];return{...l,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ki(Y9,"composeContextScopes");var Kle=Object.defineProperty,Oi=(t,e)=>Kle(t,"name",{value:e,configurable:!0});function dc(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const c=[];s=r$(s),g.Children.forEach(s,m=>{var v;if(t$(m)){l=!0;const y=m;let _="child"in y.props?y.props.child:y.props.children;for(;vE(_)&&typeof u1=="function";)_=u1(_._payload);o=qle(y,_),c.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else c.push(m)}),o?o=g.cloneElement(o,void 0,c):!l&&g.Children.count(s)===1&&g.isValidElement(s)&&(o=s);const d=o?e$(o):void 0,f=xn(r,d);if(!o){if(s||s===0)throw new Error(l?Xle(t):Yle(t));return s}const h=J9(i,o.props??{});return o.type!==g.Fragment&&(h.ref=r?f:d),g.cloneElement(o,h)});return e.displayName=`${t}.Slot`,e}Oi(dc,"createSlot");var X9=Symbol.for("radix.slottable");function Q9(t){const e=Oi(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=X9,e}Oi(Q9,"createSlottable");var qle=Oi((t,e)=>"child"in t.props?g.isValidElement(e)?g.cloneElement(e,void 0,t.props.children(e.props.children)):null:g.isValidElement(e)?e:null,"getSlottableElementFromSlottable");function J9(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=s$(i,s))}return{...t,...n}}Oi(J9,"mergeProps");function e$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Oi(e$,"getElementRef");function t$(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===X9}Oi(t$,"isSlottable");var Gle=Symbol.for("react.lazy");function vE(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Gle&&"_payload"in t&&n$(t._payload)}Oi(vE,"isLazyComponent");function n$(t){return typeof t=="object"&&t!==null&&"then"in t}Oi(n$,"isPromiseLike");function r$(t){let e=t;for(;vE(e)&&typeof u1=="function";)e=u1(e._payload);return e}Oi(r$,"useUnwrappedLazy");function s$(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Oi(s$,"concatAriaDescribedby");var Yle=Oi(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Xle=Oi(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),u1=Zf[" use ".trim().toString()],Qle=Object.defineProperty,Jle=(t,e)=>Qle(t,"name",{value:e,configurable:!0}),ece=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],er=ece.reduce((t,e)=>{const n=dc(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function i$(t,e){t&&$m.flushSync(()=>t.dispatchEvent(e))}Jle(i$,"dispatchDiscreteCustomEvent");var ws=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},tce=Object.defineProperty,nce=(t,e)=>tce(t,"name",{value:e,configurable:!0}),YA=Zf[" useInsertionEffect ".trim().toString()];function $u(t){const e=g.useRef(t);return typeof YA=="function"?YA(()=>{e.current=t}):ws(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}nce($u,"useCallbackRef");var rce=Object.defineProperty,Zr=(t,e)=>rce(t,"name",{value:e,configurable:!0}),Yx="dismissableLayer.update",sce="dismissableLayer.pointerDownOutside",ice="dismissableLayer.focusOutside",XA,o$=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),yE=g.forwardRef(Zr(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,h=g.useContext(o$),[m,v]=g.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=g.useState({}),b=xn(n,v),x=Array.from(h.layers),[k]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=k?x.indexOf(k):-1,P=m?x.indexOf(m):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,O=P>=C,I=g.useRef(!1),A=l$($=>{o==null||o($),c==null||c($),$.defaultPrevented||d==null||d()},{ownerDocument:y,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback($=>{if(!($ instanceof Node))return!1;const q=[...h.branches].some(X=>X.contains($));return O&&!q},[h.branches,O])}),M=c$($=>{if(s&&I.current)return;const q=$.target;[...h.branches].some(j=>j.contains(q))||(l==null||l($),c==null||c($),$.defaultPrevented||d==null||d())},y),L=m?P===x.length-1:!1,z=$u($=>{$.key==="Escape"&&(i==null||i($),!$.defaultPrevented&&d&&($.preventDefault(),d()))});return g.useEffect(()=>{if(L)return y.addEventListener("keydown",z,{capture:!0}),()=>y.removeEventListener("keydown",z,{capture:!0})},[y,L,z]),g.useEffect(()=>{if(m)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(XA=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),Xx(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(m),h.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=XA))}},[m,y,r,h]),g.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),Xx())},[m,h]),g.useEffect(()=>{const $=Zr(()=>_({}),"handleUpdate");return document.addEventListener(Yx,$),()=>document.removeEventListener(Yx,$)},[]),S.jsx(er.div,{...f,ref:b,style:{pointerEvents:R?O?"auto":"none":void 0,...e.style},onFocusCapture:bn(e.onFocusCapture,M.onFocusCapture),onBlurCapture:bn(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:bn(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function a$(){const t=g.useContext(o$),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Zr(a$,"useDismissableLayerSurface");var oce=Zr(()=>!0,"IS_TRUE");function l$(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=oce}=e,l=$u(t),c=g.useRef(!1),d=g.useRef(!1),f=g.useRef(new Map),h=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}Zr(m,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}Zr(v,"isOutsideInteractionIntercepted");function y(C){if(!d.current)return;const P=C.target;P instanceof Node&&[...i].some(O=>O.contains(P))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}Zr(y,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}Zr(_,"handleInteractionBubble");const b=Zr(C=>{if(C.target&&!c.current){let P=function(){n.removeEventListener("click",h.current);const O=v();m(),O||_E(sce,l,R,{discrete:!0})};if(Zr(P,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",h.current),m(),c.current=!1;return}const R={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?P():(n.removeEventListener("click",h.current),h.current=P,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),m();c.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of x)n.addEventListener(C,y,!0),n.addEventListener(C,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",b),n.removeEventListener("click",h.current);for(const C of x)n.removeEventListener(C,y,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:Zr(()=>c.current=!0,"onPointerDownCapture")}}Zr(l$,"usePointerDownOutside");function c$(t,e=globalThis==null?void 0:globalThis.document){const n=$u(t),r=g.useRef(!1);return g.useEffect(()=>{const s=Zr(i=>{i.target&&!r.current&&_E(ice,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Zr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Zr(()=>r.current=!1,"onBlurCapture")}}Zr(c$,"useFocusOutside");function Xx(){const t=new CustomEvent(Yx);document.dispatchEvent(t)}Zr(Xx,"dispatchUpdate");function _E(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?i$(s,i):s.dispatchEvent(i)}Zr(_E,"handleAndDispatchCustomEvent");var ace=Object.defineProperty,br=(t,e)=>ace(t,"name",{value:e,configurable:!0}),xw="focusScope.autoFocusOnMount",Sw="focusScope.autoFocusOnUnmount",QA={bubbles:!1,cancelable:!0},u$=g.forwardRef(br(function(e,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=e,[d,f]=g.useState(null),h=$u(o),m=$u(l),v=g.useRef(null),y=xn(n,f),_=g.useRef(i);g.useEffect(()=>{_.current=i});const b=g.useCallback(C=>{var P;return C?d!=null&&d.contains(C)?!0:!!((P=_.current)!=null&&P.some(R=>R.contains(C))):!1},[d]),x=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let C=function(I){if(x.paused||!d)return;const A=I.target;b(A)?v.current=A:La(v.current,{select:!0})},P=function(I){if(x.paused||!d)return;const A=I.relatedTarget;A!==null&&(b(A)||La(v.current,{select:!0}))},R=function(I){if(document.activeElement===document.body)for(const M of I)M.removedNodes.length>0&&La(d)};br(C,"handleFocusIn"),br(P,"handleFocusOut"),br(R,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",P);const O=new MutationObserver(R);return d&&O.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",P),O.disconnect()}}},[s,d,x.paused,b]),g.useEffect(()=>{if(d){JA.add(x);const C=document.activeElement;if(!d.contains(C)){const R=new CustomEvent(xw,QA);d.addEventListener(xw,h),d.dispatchEvent(R),R.defaultPrevented||(f$(v$(SE(d)),{select:!0}),document.activeElement===C&&La(d))}return()=>{d.removeEventListener(xw,h);const R=d.ownerDocument,O=CustomEvent;setTimeout(()=>{const I=new O(Sw,QA);d.addEventListener(Sw,m),d.dispatchEvent(I),I.defaultPrevented||La(C??R.body,{select:!0}),d.removeEventListener(Sw,m),JA.remove(x)},0)}}},[d,h,m,x]);const k=g.useCallback(C=>{if(!r&&!s||x.paused)return;const P=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,R=document.activeElement;if(P&&R){const O=C.currentTarget,[I,A]=h$(O);I&&A?!C.shiftKey&&R===A?(C.preventDefault(),r&&La(I,{select:!0})):C.shiftKey&&R===I&&(C.preventDefault(),r&&La(A,{select:!0})):R===O&&C.preventDefault()}},[r,s,x.paused]);return S.jsx(er.div,{tabIndex:-1,...c,ref:y,onKeyDown:k})},"FocusScope")),d$=g.createContext(null);function wE({registry:t,children:e}){return t?S.jsx(d$.Provider,{value:t,children:e}):e}br(wE,"FocusScopeBranchProvider");function bE(){const[t,e]=g.useState([]),n=g.useMemo(()=>({add:br(r=>e(s=>s.includes(r)?s:[...s,r]),"add"),remove:br(r=>e(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:t,registry:n}}br(bE,"useFocusScopeBranchRegistry");function xE(t){const e=g.useContext(d$);g.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}br(xE,"useFocusScopeBranch");function f$(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(La(r,{select:e}),document.activeElement!==n)return}br(f$,"focusFirst");function h$(t){const e=SE(t),n=Qx(e,t),r=Qx(e.reverse(),t);return[n,r]}br(h$,"getTabbableEdges");function SE(t){const e=[],r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:br(s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)e.push(r.currentNode);return e}br(SE,"getTabbableCandidates");function Qx(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):p$(r,{upTo:e})))return r}br(Qx,"findVisible");function p$(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}br(p$,"isHidden");function m$(t){return t.tagName==="INPUT"&&typeof t.select=="function"}br(m$,"isSelectableInput");function La(t,{select:e=!1}={}){if(t&&t.focus){const r=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==r&&m$(t)&&e&&t.select()}}br(La,"focus");var JA=g$();function g$(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Jx(t,e),t.unshift(e)},remove(e){var n;t=Jx(t,e),(n=t[0])==null||n.resume()}}}br(g$,"createFocusScopesStack");function Jx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}br(Jx,"arrayRemove");function v$(t){return t.filter(e=>e.tagName!=="A")}br(v$,"removeLinks");var lce=Object.defineProperty,cce=(t,e)=>lce(t,"name",{value:e,configurable:!0}),uce=Zf[" useId ".trim().toString()]||(()=>{}),dce=0;function sa(t){const[e,n]=g.useState(uce());return ws(()=>{t||n(r=>r??String(dce++))},[t]),t||(e?`radix-${e}`:"")}cce(sa,"useId");const fce=["top","right","bottom","left"],fc=Math.min,Ka=Math.max,d1=Math.round,bg=Math.floor,qa=t=>({x:t,y:t}),hce={left:"right",right:"left",bottom:"top",top:"bottom"};function y$(t,e,n){return Ka(t,fc(e,n))}function Qa(t,e){return typeof t=="function"?t(e):t}function hc(t){return t.split("-")[0]}function Jf(t){return t.split("-")[1]}function kE(t){return t==="x"?"y":"x"}function EE(t){return t==="y"?"height":"width"}function Jo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function CE(t){return kE(Jo(t))}function pce(t,e,n){n===void 0&&(n=!1);const r=Jf(t),s=CE(t),i=EE(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=f1(o)),[o,f1(o)]}function mce(t){const e=f1(t);return[eS(t),e,eS(e)]}function eS(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const eI=["left","right"],tI=["right","left"],gce=["top","bottom"],vce=["bottom","top"];function yce(t,e,n){switch(t){case"top":case"bottom":return n?e?tI:eI:e?eI:tI;case"left":case"right":return e?gce:vce;default:return[]}}function _ce(t,e,n,r){const s=Jf(t);let i=yce(hc(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(eS)))),i}function f1(t){const e=hc(t);return hce[e]+t.slice(e.length)}function wce(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function _$(t){return typeof t!="number"?wce(t):{top:t,right:t,bottom:t,left:t}}function h1(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function nI(t,e,n){let{reference:r,floating:s}=t;const i=Jo(e),o=CE(e),l=EE(o),c=hc(e),d=i==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let v;switch(c){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-s.width,y:h};break;default:v={x:r.x,y:r.y}}const y=Jf(e);return y&&(v[o]+=m*(y==="end"?1:-1)*(n&&d?-1:1)),v}async function bce(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=Qa(e,t),y=_$(v),b=l[m?h==="floating"?"reference":"floating":h],x=h1(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(l.floating)),boundary:d,rootBoundary:f,strategy:c})),k=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),P=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},R=h1(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:C,strategy:c}):k);return{top:(x.top-R.top+y.top)/P.y,bottom:(R.bottom-x.bottom+y.bottom)/P.y,left:(x.left-R.left+y.left)/P.x,right:(R.right-x.right+y.right)/P.x}}const xce=50,Sce=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:bce},c=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:h}=nI(d,r,c),m=r,v=0;const y={};for(let _=0;_<i.length;_++){const b=i[_];if(!b)continue;const{name:x,fn:k}=b,{x:C,y:P,data:R,reset:O}=await k({x:f,y:h,initialPlacement:r,placement:m,strategy:s,middlewareData:y,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,h=P??h,y[x]={...y[x],...R},O&&v<xce&&(v++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:f,y:h}=nI(d,m,c)),_=-1)}return{x:f,y:h,placement:m,strategy:s,middlewareData:y}},kce=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:c}=e,{element:d,padding:f=0}=Qa(t,e)||{};if(d==null)return{};const h=_$(f),m={x:n,y:r},v=CE(s),y=EE(v),_=await o.getDimensions(d),b=v==="y",x=b?"top":"left",k=b?"bottom":"right",C=b?"clientHeight":"clientWidth",P=i.reference[y]+i.reference[v]-m[v]-i.floating[y],R=m[v]-i.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let I=O?O[C]:0;(!I||!await(o.isElement==null?void 0:o.isElement(O)))&&(I=l.floating[C]||i.floating[y]);const A=P/2-R/2,M=I/2-_[y]/2-1,L=fc(h[x],M),z=fc(h[k],M),$=I-_[y]-z,q=I/2-_[y]/2+A,X=y$(L,q,$),j=!c.arrow&&Jf(s)!=null&&q!==X&&i.reference[y]/2-(q<L?L:z)-_[y]/2<0,K=j?q<L?q-L:q-$:0;return{[v]:m[v]+K,data:{[v]:X,centerOffset:q-X-K,...j&&{alignmentOffset:K}},reset:j}}}),Ece=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:_=!0,...b}=Qa(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=hc(s),k=Jo(l),C=hc(l)===l,P=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=m||(C||!_?[f1(l)]:mce(l)),O=y!=="none";!m&&O&&R.push(..._ce(l,_,y,P));const I=[l,...R],A=await c.detectOverflow(e,b),M=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&M.push(A[x]),h){const X=pce(s,o,P);M.push(A[X[0]],A[X[1]])}if(L=[...L,{placement:s,overflows:M}],!M.every(X=>X<=0)){var z,$;const X=(((z=i.flip)==null?void 0:z.index)||0)+1,j=I[X];if(j&&(!(h==="alignment"?k!==Jo(j):!1)||L.every(H=>Jo(H.placement)===k?H.overflows[0]>0:!0)))return{data:{index:X,overflows:L},reset:{placement:j}};let K=($=L.filter(ee=>ee.overflows[0]<=0).sort((ee,H)=>ee.overflows[1]-H.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(v){case"bestFit":{var q;const ee=(q=L.filter(H=>{if(O){const Q=Jo(H.placement);return Q===k||Q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Q=>Q>0).reduce((Q,B)=>Q+B,0)]).sort((H,Q)=>H[1]-Q[1])[0])==null?void 0:q[0];ee&&(K=ee);break}case"initialPlacement":K=l;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function rI(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function sI(t){return fce.some(e=>t[e]>=0)}const Cce=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Qa(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=rI(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:sI(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=rI(o,n.floating);return{data:{escapedOffsets:l,escaped:sI(l)}}}default:return{}}}}},w$=new Set(["left","top"]);async function Pce(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=hc(n),l=Jf(n),c=Jo(n)==="y",d=w$.has(o)?-1:1,f=i&&c?-1:1,h=Qa(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof y=="number"&&(v=l==="end"?y*-1:y),c?{x:v*f,y:m*d}:{x:m*d,y:v*f}}const Tce=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,c=await Pce(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},Rce=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:k=>{let{x:C,y:P}=k;return{x:C,y:P}}},...d}=Qa(t,e),f={x:n,y:r},h=await i.detectOverflow(e,d),m=Jo(s),v=kE(m);let y=f[v],_=f[m];const b=(k,C)=>y$(C+h[k==="y"?"top":"left"],C,C-h[k==="y"?"bottom":"right"]);o&&(y=b(v,y)),l&&(_=b(m,_));const x=c.fn({...e,[v]:y,[m]:_});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[m]:l}}}}}},Ace=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:c}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=Qa(t,e),m={x:s,y:i},v=Jo(o),y=kE(v);let _=m[y],b=m[v];const x=Qa(d,e),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(r=x.crossAxis)!=null?r:0};if(f){const R=y==="y"?"height":"width",O=l.reference[y]-l.floating[R]+k.mainAxis,I=l.reference[y]+l.reference[R]-k.mainAxis;_<O?_=O:_>I&&(_=I)}if(h){var C,P;const R=y==="y"?"width":"height",O=w$.has(hc(o)),I=l.reference[v]-l.floating[R]+(O&&((C=c.offset)==null?void 0:C[v])||0)+(O?0:k.crossAxis),A=l.reference[v]+l.reference[R]+(O?0:((P=c.offset)==null?void 0:P[v])||0)-(O?k.crossAxis:0);b<I?b=I:b>A&&(b=A)}return{[y]:_,[v]:b}}}},Ice=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=Qa(t,e),c=await s.detectOverflow(e,l),d=hc(n),f=Jf(n),h=Jo(n)==="y",{width:m,height:v}=r.floating;let y,_;d==="top"||d==="bottom"?(y=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,y=f==="end"?"top":"bottom");const b=v-c.top-c.bottom,x=m-c.left-c.right,k=fc(v-c[y],b),C=fc(m-c[_],x),P=e.middlewareData.shift,R=!P;let O=k,I=C;P!=null&&P.enabled.x&&(I=x),P!=null&&P.enabled.y&&(O=b),R&&!f&&(h?I=m-2*Ka(c.left,c.right):O=v-2*Ka(c.top,c.bottom)),await o({...e,availableWidth:I,availableHeight:O});const A=await s.getDimensions(i.floating);return m!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function G1(){return typeof window<"u"}function eh(t){return b$(t)?(t.nodeName||"").toLowerCase():"#document"}function Qs(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function rl(t){var e;return(e=(b$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function b$(t){return G1()?t instanceof Node||t instanceof Qs(t).Node:!1}function ua(t){return G1()?t instanceof Element||t instanceof Qs(t).Element:!1}function xc(t){return G1()?t instanceof HTMLElement||t instanceof Qs(t).HTMLElement:!1}function iI(t){return!G1()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qs(t).ShadowRoot}function Y1(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=da(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function Oce(t){return/^(table|td|th)$/.test(eh(t))}function X1(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Mce=/transform|translate|scale|rotate|perspective|filter/,Nce=/paint|layout|strict|content/,Gc=t=>!!t&&t!=="none";let kw;function PE(t){const e=ua(t)?da(t):t;return Gc(e.transform)||Gc(e.translate)||Gc(e.scale)||Gc(e.rotate)||Gc(e.perspective)||!TE()&&(Gc(e.backdropFilter)||Gc(e.filter))||Mce.test(e.willChange||"")||Nce.test(e.contain||"")}function Lce(t){let e=Fu(t);for(;xc(e)&&!im(e);){if(PE(e))return e;if(X1(e))return null;e=Fu(e)}return null}function TE(){return kw==null&&(kw=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),kw}function im(t){return/^(html|body|#document)$/.test(eh(t))}function da(t){return Qs(t).getComputedStyle(t)}function Q1(t){return ua(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fu(t){if(eh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||iI(t)&&t.host||rl(t);return iI(e)?e.host:e}function x$(t){const e=Fu(t);return im(e)?(t.ownerDocument||t).body:xc(e)&&Y1(e)?e:x$(e)}function om(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=x$(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Qs(s);if(i){const l=tS(o);return e.concat(o,o.visualViewport||[],Y1(s)?s:[],l&&n?om(l):[])}else return e.concat(s,om(s,[],n))}function tS(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function S$(t){const e=da(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=xc(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=d1(n)!==i||d1(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function RE(t){return ua(t)?t:t.contextElement}function Xd(t){const e=RE(t);if(!xc(e))return qa(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=S$(e);let o=(i?d1(n.width):n.width)/r,l=(i?d1(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Dce=qa(0);function k$(t){const e=Qs(t);return!TE()||!e.visualViewport?Dce:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $ce(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Qs(t)}function ju(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=RE(t);let o=qa(1);e&&(r?ua(r)&&(o=Xd(r)):o=Xd(t));const l=$ce(i,n,r)?k$(i):qa(0);let c=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,h=s.height/o.y;if(i&&r){const m=Qs(i),v=ua(r)?Qs(r):r;let y=m,_=tS(y);for(;_&&v!==y;){const b=Xd(_),x=_.getBoundingClientRect(),k=da(_),C=x.left+(_.clientLeft+parseFloat(k.paddingLeft))*b.x,P=x.top+(_.clientTop+parseFloat(k.paddingTop))*b.y;c*=b.x,d*=b.y,f*=b.x,h*=b.y,c+=C,d+=P,y=Qs(_),_=tS(y)}}return h1({width:f,height:h,x:c,y:d})}function J1(t,e){const n=Q1(t).scrollLeft;return e?e.left+n:ju(rl(t)).left+n}function E$(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-J1(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function Fce(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=rl(r),l=e?X1(e.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=qa(1);const f=qa(0),h=xc(r);if((h||!i)&&((eh(r)!=="body"||Y1(o))&&(c=Q1(r)),h)){const v=ju(r);d=Xd(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!h&&!i?E$(o,c):qa(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-c.scrollTop*d.y+f.y+m.y}}function jce(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function zce(t){const e=Q1(t),n=t.ownerDocument.body,r=Ka(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Ka(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+J1(t);const o=-e.scrollTop;return da(n).direction==="rtl"&&(i+=Ka(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const Vce=25;function Hce(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Qs(t),i=rl(t),o=s.visualViewport;let l=i.clientWidth,c=i.clientHeight,d=0,f=0;if(o){const m=!TE()||e==="fixed";r?m||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,c=o.height,m&&(d=o.offsetLeft,f=o.offsetTop))}if(J1(i)<=0){const m=i.ownerDocument,v=m.body,y=getComputedStyle(v),_=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,b=Math.abs(i.clientWidth-v.clientWidth-_),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;x<=Vce&&(l-=x)}return{width:l,height:c,x:d,y:f}}function Uce(t,e){const n=ju(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Xd(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function oI(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=Hce(t,n,e);else if(e==="document")r=zce(rl(t));else if(ua(e))r=Uce(e,n);else{const s=k$(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return h1(r)}function Bce(t,e){const n=e.get(t);if(n)return n;let r=om(t,[],!1).filter(l=>ua(l)&&eh(l)!=="body"),s=null;const i=da(t).position==="fixed";let o=i?Fu(t):t;for(;ua(o)&&!im(o);){const l=da(o),c=PE(o),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==o):s=l,o=Fu(o)}return e.set(t,r),r}function Zce(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?X1(e)?[]:Bce(e,this._c):[].concat(n),r],l=oI(e,o[0],s);let c=l.top,d=l.right,f=l.bottom,h=l.left;for(let m=1;m<o.length;m++){const v=oI(e,o[m],s);c=Ka(v.top,c),d=fc(v.right,d),f=fc(v.bottom,f),h=Ka(v.left,h)}return{width:d-h,height:f-c,x:h,y:c}}function Wce(t){const{width:e,height:n}=S$(t);return{width:e,height:n}}function Kce(t,e,n){const r=xc(e),s=rl(e),i=n==="fixed",o=ju(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=qa(0);if((r||!i)&&((eh(e)!=="body"||Y1(s))&&(l=Q1(e)),r)){const m=ju(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=J1(s));const d=s&&!r&&!i?E$(s,l):qa(0),f=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function Ew(t){return da(t).position==="static"}function aI(t,e){if(!xc(t)||da(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return rl(t)===n&&(n=n.ownerDocument.body),n}function C$(t,e){const n=Qs(t);if(X1(t))return n;if(!xc(t)){let s=Fu(t);for(;s&&!im(s);){if(ua(s)&&!Ew(s))return s;s=Fu(s)}return n}let r=aI(t,e);for(;r&&Oce(r)&&Ew(r);)r=aI(r,e);return r&&im(r)&&Ew(r)&&!PE(r)?n:r||Lce(t)||n}const qce=async function(t){const e=this.getOffsetParent||C$,n=this.getDimensions,r=await n(t.floating);return{reference:Kce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Gce(t){return da(t).direction==="rtl"}const Yce={convertOffsetParentRelativeRectToViewportRelativeRect:Fce,getDocumentElement:rl,getClippingRect:Zce,getOffsetParent:C$,getElementRects:qce,getClientRects:jce,getDimensions:Wce,getScale:Xd,isElement:ua,isRTL:Gce};function P$(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Xce(t,e,n){let r=null,s;const i=rl(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const m=t.getBoundingClientRect(),{left:v,top:y,width:_,height:b}=m;if(f||e(),!_||!b)return;const x=bg(y),k=bg(i.clientWidth-(v+_)),C=bg(i.clientHeight-(y+b)),P=bg(v),O={rootMargin:-x+"px "+-k+"px "+-C+"px "+-P+"px",threshold:Ka(0,fc(1,h))||1};let I=!0;function A(M){const L=M[0].intersectionRatio;if(!P$(m,t.getBoundingClientRect()))return l();if(L!==h){if(!I)return l();L?l(!1,L):s=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(A,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,O)}r.observe(t)}const c=Qs(t),d=()=>l(n);return c.addEventListener("resize",d),l(!0),()=>{c.removeEventListener("resize",d),o()}}function Qce(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=RE(t),f=s||i?[...d?om(d):[],...e?om(e):[]]:[];f.forEach(x=>{s&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const h=d&&l?Xce(d,n,i):null;let m=-1,v=null;o&&(v=new ResizeObserver(x=>{let[k]=x;k&&k.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),d&&!c&&v.observe(d),e&&v.observe(e));let y,_=c?ju(t):null;c&&b();function b(){const x=ju(t);_&&!P$(_,x)&&n(),_=x,y=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),h==null||h(),(x=v)==null||x.disconnect(),v=null,c&&cancelAnimationFrame(y)}}const Jce=Tce,eue=Rce,tue=Ece,nue=Ice,rue=Cce,lI=kce,sue=Ace,iue=(t,e,n)=>{const r=new Map,s=n??{},i={...Yce,...s.platform,_c:r};return Sce(t,e,{...s,platform:i})};var oue=typeof document<"u",aue=function(){},tv=oue?g.useLayoutEffect:aue;function p1(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!p1(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!p1(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function T$(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function cI(t,e){const n=T$(t);return Math.round(e*n)/n}function Cw(t){const e=g.useRef(t);return tv(()=>{e.current=t}),e}function lue(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=t,[f,h]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(r);p1(m,r)||v(r);const[y,_]=g.useState(null),[b,x]=g.useState(null),k=g.useCallback(H=>{H!==O.current&&(O.current=H,_(H))},[]),C=g.useCallback(H=>{H!==I.current&&(I.current=H,x(H))},[]),P=i||y,R=o||b,O=g.useRef(null),I=g.useRef(null),A=g.useRef(f),M=c!=null,L=Cw(c),z=Cw(s),$=Cw(d),q=g.useCallback(()=>{if(!O.current||!I.current)return;const H={placement:e,strategy:n,middleware:m};z.current&&(H.platform=z.current),iue(O.current,I.current,H).then(Q=>{const B={...Q,isPositioned:$.current!==!1};X.current&&!p1(A.current,B)&&(A.current=B,$m.flushSync(()=>{h(B)}))})},[m,e,n,z,$]);tv(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,h(H=>({...H,isPositioned:!1})))},[d]);const X=g.useRef(!1);tv(()=>(X.current=!0,()=>{X.current=!1}),[]),tv(()=>{if(P&&(O.current=P),R&&(I.current=R),P&&R){if(L.current)return L.current(P,R,q);q()}},[P,R,q,L,M]);const j=g.useMemo(()=>({reference:O,floating:I,setReference:k,setFloating:C}),[k,C]),K=g.useMemo(()=>({reference:P,floating:R}),[P,R]),ee=g.useMemo(()=>{const H={position:n,left:0,top:0};if(!K.floating)return H;const Q=cI(K.floating,f.x),B=cI(K.floating,f.y);return l?{...H,transform:"translate("+Q+"px, "+B+"px)",...T$(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:B}},[n,l,K.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:q,refs:j,elements:K,floatingStyles:ee}),[f,q,j,K,ee])}const cue=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?lI({element:r.current,padding:s}).fn(n):{}:r?lI({element:r,padding:s}).fn(n):{}}}},uue=(t,e)=>{const n=Jce(t);return{name:n.name,fn:n.fn,options:[t,e]}},due=(t,e)=>{const n=eue(t);return{name:n.name,fn:n.fn,options:[t,e]}},fue=(t,e)=>({fn:sue(t).fn,options:[t,e]}),hue=(t,e)=>{const n=tue(t);return{name:n.name,fn:n.fn,options:[t,e]}},pue=(t,e)=>{const n=nue(t);return{name:n.name,fn:n.fn,options:[t,e]}},mue=(t,e)=>{const n=rue(t);return{name:n.name,fn:n.fn,options:[t,e]}},gue=(t,e)=>{const n=cue(t);return{name:n.name,fn:n.fn,options:[t,e]}};var vue=Object.defineProperty,yue=(t,e)=>vue(t,"name",{value:e,configurable:!0});function AE(t){const[e,n]=g.useState(void 0);return ws(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});let r=0;const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let l,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,c=f.blockSize}else l=t.offsetWidth,c=t.offsetHeight;n({width:l,height:c})})});return s.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}else n(void 0)},[t]),e}yue(AE,"useSize");var _ue=Object.defineProperty,tc=(t,e)=>_ue(t,"name",{value:e,configurable:!0}),uI={Partial:"partial"},dI={Optimized:"optimized",Always:"always"},R$="Popper",[A$,ey]=ha(R$),[wue,I$]=A$(R$),O$=tc(t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,o]=g.useState(void 0);return S.jsx(wue,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),bue="PopperAnchor",M$=g.forwardRef(tc(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=I$(bue,r),l=g.useRef(null),c=o.onAnchorChange,d=g.useCallback(_=>{l.current=_,_&&c(_)},[c]),f=xn(n,d),h=g.useRef(null);g.useEffect(()=>{if(!s)return;const _=h.current;h.current=s.current,_!==h.current&&c(h.current)});const m=o.placementState&&ty(o.placementState),v=m==null?void 0:m[0],y=m==null?void 0:m[1];return s?null:S.jsx(er.div,{"data-radix-popper-side":v,"data-radix-popper-align":y,...i,ref:f})},"PopperAnchor")),N$="PopperContent",[xue,hye]=A$(N$),L$=g.forwardRef(tc(function(e,n){var se,be,Se,$e,kt,tn,nn;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m=uI.Partial,hideWhenDetached:v=!1,updatePositionStrategy:y=dI.Optimized,onPlaced:_,...b}=e,x=I$(N$,r),[k,C]=g.useState(null),P=xn(n,C),[R,O]=g.useState(null),I=AE(R),A=(I==null?void 0:I.width)??0,M=(I==null?void 0:I.height)??0,L=s+(o!=="center"?"-"+o:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},$=Array.isArray(f)?f:[f],q=$.length>0,X={padding:z,boundary:$.filter(D$),altBoundary:q},{refs:j,floatingStyles:K,placement:ee,isPositioned:H,middlewareData:Q}=lue({strategy:"fixed",placement:L,whileElementsMounted:tc((...xt)=>Qce(...xt,{animationFrame:y===dI.Always}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[uue({mainAxis:i+M,alignmentAxis:l}),d&&due({mainAxis:!0,crossAxis:!1,...m===uI.Partial?{limiter:fue()}:{},...X}),d&&hue({...X}),pue({...X,apply:tc(({elements:xt,rects:Dt,availableWidth:un,availableHeight:Kt})=>{const{width:Le,height:Qe}=Dt.reference,Ae=xt.floating.style;Ae.setProperty("--radix-popper-available-width",`${un}px`),Ae.setProperty("--radix-popper-available-height",`${Kt}px`),Ae.setProperty("--radix-popper-anchor-width",`${Le}px`),Ae.setProperty("--radix-popper-anchor-height",`${Qe}px`)},"apply")}),R&&gue({element:R,padding:c}),Sue({arrowWidth:A,arrowHeight:M}),v&&mue(q?{strategy:"referenceHidden",...X}:{strategy:"referenceHidden",padding:X.padding,altBoundary:X.altBoundary})]}),B=x.setPlacementState;ws(()=>(B(ee),()=>{B(void 0)}),[ee,B]);const[D,G]=ty(ee),fe=$u(_);ws(()=>{H&&(fe==null||fe())},[H,fe]);const ie=(se=Q.arrow)==null?void 0:se.x,ue=(be=Q.arrow)==null?void 0:be.y,he=((Se=Q.arrow)==null?void 0:Se.centerOffset)!==0,[we,le]=g.useState();return ws(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:H?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[($e=Q.transformOrigin)==null?void 0:$e.x,(kt=Q.transformOrigin)==null?void 0:kt.y].join(" "),...((tn=Q.hide)==null?void 0:tn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(xue,{scope:r,placedSide:D,placedAlign:G,onArrowChange:O,arrowX:ie,arrowY:ue,shouldHideArrow:he,children:S.jsx(er.div,{"data-side":D,"data-align":G,...b,ref:P,style:{...b.style,animation:H?(nn=b.style)==null?void 0:nn.animation:"none"}})})})},"PopperContent"));function D$(t){return t!==null}tc(D$,"isNotNull");var Sue=tc(t=>({name:"transformOrigin",options:t,fn(e){var b,x,k;const{placement:n,rects:r,middlewareData:s}=e,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[d,f]=ty(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+c/2;let y="",_="";return d==="bottom"?(y=o?h:`${m}px`,_=`${-c}px`):d==="top"?(y=o?h:`${m}px`,_=`${r.floating.height+c}px`):d==="right"?(y=`${-c}px`,_=o?h:`${v}px`):d==="left"&&(y=`${r.floating.width+c}px`,_=o?h:`${v}px`),{data:{x:y,y:_}}}}),"transformOrigin");function ty(t){const[e,n="center"]=t.split("-");return[e,n]}tc(ty,"getSideAndAlignFromPlacement");var kue=Object.defineProperty,Eue=(t,e)=>kue(t,"name",{value:e,configurable:!0}),IE=g.forwardRef(Eue(function(e,n){var c;const{container:r,...s}=e,[i,o]=g.useState(!1);ws(()=>o(!0),[]);const l=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?$m.createPortal(S.jsx(er.div,{...s,ref:n}),l):null},"Portal")),Cue=Object.defineProperty,Ja=(t,e)=>Cue(t,"name",{value:e,configurable:!0});function $$(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}Ja($$,"useStateMachine");var Sc=Ja(t=>{const{present:e,children:n}=t,r=F$(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=j$(r.ref,z$(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function F$(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=g.useRef(void 0),l=t?"mounted":"unmounted",[c,d]=$$(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(i.current=o.current??Ld(r.current),o.current=void 0):i.current="none"},[c]),ws(()=>{const f=r.current,h=s.current;if(h!==t){const v=i.current,y=Ld(f);t?(o.current=y,d("MOUNT")):y==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),ws(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,m=Ja(y=>{const b=Ld(r.current).includes(CSS.escape(y.animationName));if(y.target===e&&b&&(d("ANIMATION_END"),!s.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",f=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},"handleAnimationEnd"),v=Ja(y=>{y.target===e&&(i.current=Ld(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,o.current=Ld(h)}else r.current=null;n(f)},[])}}Ja(F$,"usePresence");function nS(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ja(nS,"setRef");function j$(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=nS(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():nS(r[o],null)}}},[])}Ja(j$,"useStableComposedRefs");function Ld(t){return(t==null?void 0:t.animationName)||"none"}Ja(Ld,"getAnimationName");function z$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Ja(z$,"getElementRef");var Pue=Object.defineProperty,Tue=(t,e)=>Pue(t,"name",{value:e,configurable:!0}),fI=Zf[" useEffectEvent ".trim().toString()],hI=Zf[" useInsertionEffect ".trim().toString()];function V$(t){if(typeof fI=="function")return fI(t);const e=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof hI=="function"?hI(()=>{e.current=t}):ws(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}Tue(V$,"useEffectEvent");var Rue=Object.defineProperty,jm=(t,e)=>Rue(t,"name",{value:e,configurable:!0}),Aue=Zf[" useInsertionEffect ".trim().toString()]||ws;function kc({prop:t,defaultProp:e,onChange:n=jm(()=>{},"onChange"),caller:r}){const[s,i,o]=H$({defaultProp:e,onChange:n}),l=t!==void 0,c=l?t:s,d=g.useCallback(f=>{var h;if(l){const m=U$(f)?f(t):f;m!==t&&((h=o.current)==null||h.call(o,m))}else i(f)},[l,t,i,o]);return[c,d]}jm(kc,"useControllableState");function H$({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return Aue(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}jm(H$,"useUncontrolledState");function U$(t){return typeof t=="function"}jm(U$,"isFunction");var pI=Symbol("RADIX:SYNC_STATE");function Iue(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,c=s!==void 0,d=V$(o),f=[{...n,state:i}];r&&f.push(r);const[h,m]=g.useReducer((b,x)=>{if(x.type===pI)return{...b,state:x.state};const k=t(b,x);return c&&!Object.is(k.state,b.state)&&d(k.state),k},...f),v=h.state,y=g.useRef(v);g.useEffect(()=>{y.current!==v&&(y.current=v,c||d(v))},[v,y,c]);const _=g.useMemo(()=>s!==void 0?{...h,state:s}:h,[h,s]);return g.useEffect(()=>{c&&!Object.is(s,h.state)&&m({type:pI,state:s})},[s,h.state,c]),[_,m]}jm(Iue,"useControllableStateReducer");var Oue=Object.defineProperty,Mue=(t,e)=>Oue(t,"name",{value:e,configurable:!0}),Nue=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"}),Lue=g.forwardRef(Mue(function(e,n){return S.jsx(er.span,{...e,ref:n,style:{...Nue,...e.style}})},"VisuallyHidden")),Due=Object.defineProperty,Mr=(t,e)=>Due(t,"name",{value:e,configurable:!0}),[OE,pye]=ha("Tooltip",[ey]),ME=ey(),$ue="TooltipProvider",Fue=700,rS="tooltip.open",[jue,NE]=OE($ue),zue=Mr(t=>{const{__scopeTooltip:e,delayDuration:n=Fue,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(jue,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),sS="Tooltip",[Vue,zm]=OE(sS),Hue=Mr(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,c=NE(sS,t.__scopeTooltip),d=ME(e),[f,h]=g.useState(null),[m,v]=g.useState(void 0),y=sa(),_=g.useRef(0),b=o??c.disableHoverableContent,x=l??c.delayDuration,k=g.useRef(!1),[C,P]=kc({prop:r,defaultProp:s??!1,onChange:Mr(L=>{L?(c.onOpen(),document.dispatchEvent(new CustomEvent(rS))):c.onClose(),i==null||i(L)},"onChange"),caller:sS}),R=g.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),O=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,P(!0)},[P]),I=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,P(!1)},[P]),A=g.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,P(!0),_.current=0},x)},[x,P]);g.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const M=m??y;return S.jsx(O$,{...d,children:S.jsx(Vue,{scope:e,contentId:M,setContentId:v,open:C,stateAttribute:R,trigger:f,onTriggerChange:h,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?A():O()},[c.isOpenDelayedRef,A,O]),onTriggerLeave:g.useCallback(()=>{b?I():(window.clearTimeout(_.current),_.current=0)},[I,b]),onOpen:O,onClose:I,disableHoverableContent:b,children:n})})},"Tooltip"),mI="TooltipTrigger",Uue=g.forwardRef(Mr(function(e,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=e,o=zm(mI,r),l=NE(mI,r),c=ME(r),d=g.useRef(null),f=xn(n,d,o.onTriggerChange),h=g.useRef(!1),m=g.useRef(!1),v=g.useCallback(()=>h.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),S.jsx(M$,{asChild:!0,...c,children:S.jsx(er.button,{"aria-describedby":o.open?Q$(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:bn(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:bn(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:bn(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:bn(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:bn(e.onBlur,o.onClose),onClick:bn(e.onClick,o.onClose)})})},"TooltipTrigger")),B$="TooltipPortal",[Bue,Zue]=OE(B$,{forceMount:void 0}),Wue=Mr(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=zm(B$,e);return S.jsx(Bue,{scope:e,forceMount:n,children:S.jsx(Sc,{present:n||i.open,children:S.jsx(IE,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),am="TooltipContent",Kue=g.forwardRef(Mr(function(e,n){const r=Zue(am,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=zm(am,e.__scopeTooltip);return S.jsx(Sc,{present:s||l.open,children:l.disableHoverableContent?S.jsx(Z$,{side:i,...o,ref:n}):S.jsx(que,{side:i,...o,ref:n})})},"TooltipContent")),que=g.forwardRef(Mr(function(e,n){const r=zm(am,e.__scopeTooltip),s=NE(am,e.__scopeTooltip),i=g.useRef(null),o=xn(n,i),[l,c]=g.useState(null),{trigger:d,onClose:f}=r,h=i.current,{onPointerInTransitChange:m}=s,v=g.useCallback(()=>{c(null),m(!1)},[m]),y=g.useCallback((_,b)=>{const x=_.currentTarget,k={x:_.clientX,y:_.clientY},C=W$(k,x.getBoundingClientRect()),P=K$(k,C),R=q$(b.getBoundingClientRect()),O=Y$([...P,...R]);c(O),m(!0)},[m]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(d&&h){const _=Mr(x=>y(x,h),"handleTriggerLeave"),b=Mr(x=>y(x,d),"handleContentLeave");return d.addEventListener("pointerleave",_),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",_),h.removeEventListener("pointerleave",b)}}},[d,h,y,v]),g.useEffect(()=>{if(l){const _=Mr(b=>{const x=b.target,k={x:b.clientX,y:b.clientY},C=(d==null?void 0:d.contains(x))||(h==null?void 0:h.contains(x)),P=!G$(k,l);C?v():P&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,h,l,f,v]),S.jsx(Z$,{...e,ref:o})},"TooltipContentHoverable")),Gue=Q9("TooltipContent"),Z$=g.forwardRef(Mr(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=zm(am,r),h=ME(r),{onClose:m}=f,[v,y]=g.useState(null),_=xn(n,y);xE(v),g.useEffect(()=>(document.addEventListener(rS,m),()=>document.removeEventListener(rS,m)),[m]),g.useEffect(()=>{if(f.trigger){const x=Mr(k=>{k.target instanceof Node&&k.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,m]);const{setContentId:b}=f;return ws(()=>(b(o),()=>{b(void 0)}),[o,b]),S.jsx(yE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:S.jsxs(L$,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...h,...d,ref:_,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(Gue,{children:s}),i?S.jsx(Lue,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function W$(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Mr(W$,"getExitSideFromRect");function K$(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Mr(K$,"getPaddedExitPoints");function q$(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}Mr(q$,"getPointsFromRect");function G$(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],c=e[o],d=l.x,f=l.y,h=c.x,m=c.y;f>r!=m>r&&n<(h-d)*(r-f)/(m-f)+d&&(s=!s)}return s}Mr(G$,"isPointInPolygon");function Y$(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),X$(e)}Mr(Y$,"getHull");function X$(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Mr(X$,"getHullPresorted");function Q$(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Mr(Q$,"concatAriaDescribedby");const Ip={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},pc={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:0},slow:{type:"spring",duration:.24,bounce:.12}},J$=g.createContext(null);function eF({value:t,children:e}){return S.jsx(J$.Provider,{value:t,children:e})}function Yue(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function LE({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[c,d]=g.useState(!1),f=o!==void 0?o:c,[h,m]=g.useState(!1),v=Fm(),y=g.useContext(J$);g.useEffect(()=>{f&&m(!0)},[f]);const _=()=>{f||m(!1)},b=Yue(n);return S.jsx(zue,{delayDuration:s,children:S.jsxs(Hue,{open:f,onOpenChange:x=>{d(x),l==null||l(x)},children:[S.jsx(Uue,{asChild:!0,children:e}),h&&S.jsx(Wue,{forceMount:!0,container:y??void 0,children:S.jsx(Kue,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Nr.div,{className:mn("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:Ip.medium},initial:{opacity:0,scale:.8,...b},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?pc.slow:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const ia=g.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=S.jsx(Z9,{ref:r,...n});return t?S.jsx(LE,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:t}),e?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});ia.displayName="Button";var Xue=Object.defineProperty,DE=(t,e)=>Xue(t,"name",{value:e,configurable:!0}),xg=0,zo=null;function Que(t){return ny(),t.children}DE(Que,"FocusGuards");function ny(){g.useEffect(()=>{zo||(zo={start:iS(),end:iS()});const{start:t,end:e}=zo;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),xg++,()=>{xg===1&&(zo==null||zo.start.remove(),zo==null||zo.end.remove(),zo=null),xg=Math.max(0,xg-1)}},[])}DE(ny,"useFocusGuards");function iS(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}DE(iS,"createFocusGuard");var Yo=function(){return Yo=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Yo.apply(this,arguments)};function tF(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function Jue(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var nv="right-scroll-bar-position",rv="width-before-scroll-bar",ede="with-scroll-bars-hidden",tde="--removed-body-scroll-bar-size";function Pw(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function nde(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var rde=typeof window<"u"?g.useLayoutEffect:g.useEffect,gI=new WeakMap;function sde(t,e){var n=nde(null,function(r){return t.forEach(function(s){return Pw(s,r)})});return rde(function(){var r=gI.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||Pw(l,null)}),i.forEach(function(l){s.has(l)||Pw(l,o)})}gI.set(n,t)},[t]),n}function ide(t){return t}function ode(t,e){e===void 0&&(e=ide);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function ade(t){t===void 0&&(t={});var e=ode(null);return e.options=Yo({async:!0,ssr:!1},t),e}var nF=function(t){var e=t.sideCar,n=tF(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Yo({},n))};nF.isSideCarExport=!0;function lde(t,e){return t.useMedium(e),nF}var rF=ade(),Tw=function(){},ry=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:Tw,onWheelCapture:Tw,onTouchMoveCapture:Tw}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,c=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,m=t.sideCar,v=t.noRelative,y=t.noIsolation,_=t.inert,b=t.allowPinchZoom,x=t.as,k=x===void 0?"div":x,C=t.gapMode,P=tF(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,O=sde([n,e]),I=Yo(Yo({},P),s);return g.createElement(g.Fragment,null,f&&g.createElement(R,{sideCar:rF,removeScrollBar:d,shards:h,noRelative:v,noIsolation:y,inert:_,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:C}),o?g.cloneElement(g.Children.only(l),Yo(Yo({},I),{ref:O})):g.createElement(k,Yo({},I,{className:c,ref:O}),l))});ry.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ry.classNames={fullWidth:rv,zeroRight:nv};var cde=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ude(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=cde();return e&&t.setAttribute("nonce",e),t}function dde(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function fde(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var hde=function(){var t=0,e=null;return{add:function(n){t==0&&(e=ude())&&(dde(e,n),fde(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},pde=function(){var t=hde();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},sF=function(){var t=pde(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},mde={left:0,top:0,right:0,gap:0},Rw=function(t){return parseInt(t||"",10)||0},gde=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[Rw(n),Rw(r),Rw(s)]},vde=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return mde;var e=gde(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},yde=sF(),Qd="data-scroll-locked",_de=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
130
- .`.concat(ede,` {
131
- overflow: hidden `).concat(r,`;
132
- padding-right: `).concat(l,"px ").concat(r,`;
133
- }
134
- body[`).concat(Qd,`] {
135
- overflow: hidden `).concat(r,`;
136
- overscroll-behavior: contain;
137
- `).concat([e&&"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(l,"px ").concat(r,`;
144
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
145
- }
146
-
147
- .`).concat(nv,` {
148
- right: `).concat(l,"px ").concat(r,`;
149
- }
150
-
151
- .`).concat(rv,` {
152
- margin-right: `).concat(l,"px ").concat(r,`;
153
- }
154
-
155
- .`).concat(nv," .").concat(nv,` {
156
- right: 0 `).concat(r,`;
157
- }
158
-
159
- .`).concat(rv," .").concat(rv,` {
160
- margin-right: 0 `).concat(r,`;
161
- }
162
-
163
- body[`).concat(Qd,`] {
164
- `).concat(tde,": ").concat(l,`px;
165
- }
166
- `)},vI=function(){var t=parseInt(document.body.getAttribute(Qd)||"0",10);return isFinite(t)?t:0},wde=function(){g.useEffect(function(){return document.body.setAttribute(Qd,(vI()+1).toString()),function(){var t=vI()-1;t<=0?document.body.removeAttribute(Qd):document.body.setAttribute(Qd,t.toString())}},[])},bde=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;wde();var i=g.useMemo(function(){return vde(s)},[s]);return g.createElement(yde,{styles:_de(i,!e,s,n?"":"!important")})},oS=!1;if(typeof window<"u")try{var Sg=Object.defineProperty({},"passive",{get:function(){return oS=!0,!0}});window.addEventListener("test",Sg,Sg),window.removeEventListener("test",Sg,Sg)}catch{oS=!1}var Pd=oS?{passive:!1}:!1,xde=function(t){return t.tagName==="TEXTAREA"},iF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!xde(t)&&n[e]==="visible")},Sde=function(t){return iF(t,"overflowY")},kde=function(t){return iF(t,"overflowX")},yI=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=oF(t,r);if(s){var i=aF(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ede=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Cde=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},oF=function(t,e){return t==="v"?Sde(e):kde(e)},aF=function(t,e){return t==="v"?Ede(e):Cde(e)},Pde=function(t,e){return t==="h"&&e==="rtl"?-1:1},Tde=function(t,e,n,r,s){var i=Pde(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,c=e.contains(l),d=!1,f=o>0,h=0,m=0;do{if(!l)break;var v=aF(t,l),y=v[0],_=v[1],b=v[2],x=_-b-i*y;(y||x)&&oF(t,l)&&(h+=x,m+=y);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},kg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_I=function(t){return[t.deltaX,t.deltaY]},wI=function(t){return t&&"current"in t?t.current:t},Rde=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Ade=function(t){return`
167
- .block-interactivity-`.concat(t,` {pointer-events: none;}
168
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
169
- `)},Ide=0,Td=[];function Ode(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(Ide++)[0],i=g.useState(sF)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=Jue([t.lockRef.current],(t.shards||[]).map(wI),!0).filter(Boolean);return _.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=g.useCallback(function(_,b){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var x=kg(_),k=n.current,C="deltaX"in _?_.deltaX:k[0]-x[0],P="deltaY"in _?_.deltaY:k[1]-x[1],R,O=_.target,I=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in _&&I==="h"&&O.type==="range")return!1;var A=window.getSelection(),M=A&&A.anchorNode,L=M?M===O||M.contains(O):!1;if(L)return!1;var z=yI(I,O);if(!z)return!0;if(z?R=I:(R=I==="v"?"h":"v",z=yI(I,O)),!z)return!1;if(!r.current&&"changedTouches"in _&&(C||P)&&(r.current=R),!R)return!0;var $=r.current||R;return Tde($,b,_,$==="h"?C:P)},[]),c=g.useCallback(function(_){var b=_;if(!(!Td.length||Td[Td.length-1]!==i)){var x="deltaY"in b?_I(b):kg(b),k=e.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&Rde(R.delta,x)})[0];if(k&&k.should){b.cancelable&&b.preventDefault();return}if(!k){var C=(o.current.shards||[]).map(wI).filter(Boolean).filter(function(R){return R.contains(b.target)}),P=C.length>0?l(b,C[0]):!o.current.noIsolation;P&&b.cancelable&&b.preventDefault()}}},[]),d=g.useCallback(function(_,b,x,k){var C={name:_,delta:b,target:x,should:k,shadowParent:Mde(x)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(P){return P!==C})},1)},[]),f=g.useCallback(function(_){n.current=kg(_),r.current=void 0},[]),h=g.useCallback(function(_){d(_.type,_I(_),_.target,l(_,t.lockRef.current))},[]),m=g.useCallback(function(_){d(_.type,kg(_),_.target,l(_,t.lockRef.current))},[]);g.useEffect(function(){return Td.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Pd),document.addEventListener("touchmove",c,Pd),document.addEventListener("touchstart",f,Pd),function(){Td=Td.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,Pd),document.removeEventListener("touchmove",c,Pd),document.removeEventListener("touchstart",f,Pd)}},[]);var v=t.removeScrollBar,y=t.inert;return g.createElement(g.Fragment,null,y?g.createElement(i,{styles:Ade(s)}):null,v?g.createElement(bde,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Mde(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Nde=lde(rF,Ode);var $E=g.forwardRef(function(t,e){return g.createElement(ry,Yo({},t,{ref:e,sideCar:Nde}))});$E.classNames=ry.classNames;var Lde=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Rd=new WeakMap,Eg=new WeakMap,Cg={},Aw=0,lF=function(t){return t&&(t.host||lF(t.parentNode))},Dde=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=lF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},$de=function(t,e,n,r){var s=Dde(e,Array.isArray(t)?t:[t]);Cg[n]||(Cg[n]=new WeakMap);var i=Cg[n],o=[],l=new Set,c=new Set(s),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};s.forEach(d);var f=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(l.has(m))f(m);else try{var v=m.getAttribute(r),y=v!==null&&v!=="false",_=(Rd.get(m)||0)+1,b=(i.get(m)||0)+1;Rd.set(m,_),i.set(m,b),o.push(m),_===1&&y&&Eg.set(m,!0),b===1&&m.setAttribute(n,"true"),y||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(e),l.clear(),Aw++,function(){o.forEach(function(h){var m=Rd.get(h)-1,v=i.get(h)-1;Rd.set(h,m),i.set(h,v),m||(Eg.has(h)||h.removeAttribute(r),Eg.delete(h)),v||h.removeAttribute(n)}),Aw--,Aw||(Rd=new WeakMap,Rd=new WeakMap,Eg=new WeakMap,Cg={})}},cF=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Lde(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),$de(r,s,n,"aria-hidden")):function(){return null}},Fde=Object.defineProperty,oi=(t,e)=>Fde(t,"name",{value:e,configurable:!0}),FE="Dialog",[uF,mye]=ha(FE),[jde,ko]=uF(FE),sy=oi(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=g.useRef(null),c=g.useRef(null),{nodes:d,registry:f}=bE(),[h,m]=kc({prop:r,defaultProp:s??!1,onChange:i,caller:FE}),[v,y]=g.useState(0),[_,b]=g.useState(0);return S.jsx(jde,{scope:e,triggerRef:l,contentRef:c,contentId:sa(),titleId:sa(),descriptionId:sa(),titlePresent:v>0,descriptionPresent:_>0,setTitleCount:y,setDescriptionCount:b,open:h,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(x=>!x),[m]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),zde="DialogTrigger",gye=g.forwardRef(oi(function(e,n){const{__scopeDialog:r,...s}=e,i=ko(zde,r),o=xn(n,i.triggerRef);return S.jsx(er.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":uy(i.open),...s,ref:o,onClick:bn(e.onClick,i.onOpenToggle)})},"DialogTrigger")),dF="DialogPortal",[Vde,fF]=uF(dF,{forceMount:void 0}),iy=oi(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=ko(dF,e);return S.jsx(Vde,{scope:e,forceMount:n,children:g.Children.map(r,o=>S.jsx(Sc,{present:n||i.open,children:S.jsx(IE,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),aS="DialogOverlay",oy=g.forwardRef(oi(function(e,n){const r=fF(aS,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=ko(aS,e.__scopeDialog);return o.modal?S.jsx(Sc,{present:s||o.open,children:S.jsx(Ude,{...i,ref:n})}):null},"DialogOverlay")),Hde=dc("DialogOverlay.RemoveScroll"),Ude=g.forwardRef(oi(function(e,n){const{__scopeDialog:r,...s}=e,i=ko(aS,r),o=a$(),l=xn(n,o);return S.jsx($E,{as:Hde,allowPinchZoom:!0,shards:g.useMemo(()=>[i.contentRef,...i.branchNodes.map(c=>({current:c}))],[i.contentRef,i.branchNodes]),children:S.jsx(er.div,{"data-state":uy(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),lm="DialogContent",ay=g.forwardRef(oi(function(e,n){const r=fF(lm,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=ko(lm,e.__scopeDialog);return S.jsx(Sc,{present:s||o.open,children:o.modal?S.jsx(Bde,{...i,ref:n}):S.jsx(Zde,{...i,ref:n})})},"DialogContent")),Bde=g.forwardRef(oi(function(e,n){const r=ko(lm,e.__scopeDialog),s=g.useRef(null),i=xn(n,r.contentRef,s);return g.useEffect(()=>{const o=s.current;if(o)return cF(o)},[]),S.jsx(hF,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:bn(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:bn(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&o.preventDefault()}),onFocusOutside:bn(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),Zde=g.forwardRef(oi(function(e,n){const r=ko(lm,e.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(hF,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),hF=g.forwardRef(oi(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":l,children:c,...d}=e,f=ko(lm,r);return ny(),S.jsx(wE,{registry:f.branchRegistry,children:S.jsx(u$,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(yE,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?pF(l,f.descriptionId):l,"data-state":uy(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:c})})})},"DialogContentImpl")),ly=g.forwardRef(oi(function(e,n){const{__scopeDialog:r,...s}=e,i=ko("DialogTitle",r),{setTitleCount:o}=i;return ws(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(er.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),cy=g.forwardRef(oi(function(e,n){const{__scopeDialog:r,...s}=e,i=ko("DialogDescription",r),{setDescriptionCount:o}=i;return ws(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(er.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),Wde="DialogClose",vye=g.forwardRef(oi(function(e,n){const{__scopeDialog:r,...s}=e,i=ko(Wde,r);return S.jsx(er.button,{type:"button",...s,ref:n,onClick:bn(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function pF(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}oi(pF,"concatAriaDescribedby");function uy(t){return t?"open":"closed"}oi(uy,"getState");var Kde=Object.defineProperty,sl=(t,e)=>Kde(t,"name",{value:e,configurable:!0}),jE="Popover",[mF,yye]=ha(jE,[ey]),zE=ey(),[qde,th]=mF(jE),VE=sl(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=zE(e),c=g.useRef(null),[d,f]=g.useState(!1),[h,m]=g.useState(0),[v,y]=g.useState(0),[_,b]=kc({prop:r,defaultProp:s??!1,onChange:i,caller:jE});return S.jsx(O$,{...l,children:S.jsx(qde,{scope:e,contentId:sa(),titleId:sa(),descriptionId:sa(),titlePresent:h>0,descriptionPresent:v>0,setTitleCount:m,setDescriptionCount:y,triggerRef:c,open:_,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(x=>!x),[b]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),Gde="PopoverTrigger",HE=g.forwardRef(sl(function(e,n){const{__scopePopover:r,...s}=e,i=th(Gde,r),o=zE(r),l=xn(n,i.triggerRef),c=S.jsx(er.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ZE(i.open),...s,ref:l,onClick:bn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:S.jsx(M$,{asChild:!0,...o,children:c})},"PopoverTrigger")),gF="PopoverPortal",[Yde,Xde]=mF(gF,{forceMount:void 0}),UE=sl(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=th(gF,e);return S.jsx(Yde,{scope:e,forceMount:n,children:S.jsx(Sc,{present:n||i.open,children:S.jsx(IE,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),cm="PopoverContent",BE=g.forwardRef(sl(function(e,n){const r=Xde(cm,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=th(cm,e.__scopePopover);return S.jsx(Sc,{present:s||o.open,children:o.modal?S.jsx(Jde,{...i,ref:n}):S.jsx(efe,{...i,ref:n})})},"PopoverContent")),Qde=dc("PopoverContent.RemoveScroll"),Jde=g.forwardRef(sl(function(e,n){const r=th(cm,e.__scopePopover),s=g.useRef(null),i=xn(n,s),o=g.useRef(!1),{nodes:l,registry:c}=bE();return g.useEffect(()=>{const d=s.current;if(d)return cF(d)},[]),S.jsx($E,{as:Qde,allowPinchZoom:!0,shards:g.useMemo(()=>[s,...l.map(d=>({current:d}))],[s,l]),children:S.jsx(vF,{...e,ref:i,branchNodes:l,branchRegistry:c,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bn(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:bn(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,m=f.button===2||h;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:bn(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),efe=g.forwardRef(sl(function(e,n){const r=th(cm,e.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(vF,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),vF=g.forwardRef(sl(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,"aria-describedby":m,branchNodes:v,branchRegistry:y,..._}=e,b=th(cm,r),x=zE(r),[k,C]=g.useState(null),P=xn(n,C);return xE(k),ny(),S.jsx(wE,{registry:y,children:S.jsx(u$,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(yE,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(L$,{"data-state":ZE(b.open),role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?yF(m,b.descriptionId):m,...x,..._,ref:P,style:{..._.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function ZE(t){return t?"open":"closed"}sl(ZE,"getState");function yF(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}sl(yF,"concatAriaDescribedby");const tfe="data-hover-dead-zone";function _F(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=g.useRef(new Map),[i,o]=g.useState(null),[l,c]=g.useState([]),d=g.useRef([]),f=g.useRef(0),h=g.useRef(null),m=g.useRef(null),v=g.useCallback(()=>{const C=[];return s.current.forEach((P,R)=>{C[R]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),C},[]),y=g.useCallback(()=>{if(!t.current)return;const P=v();d.current=P,c(P)},[t,v]),_=g.useCallback((C,P)=>{P?s.current.set(C,P):s.current.delete(C),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,y()})},[y]),b=g.useCallback(C=>{const P=C.clientX,R=C.clientY,O=C.target instanceof Element&&C.target.closest(`[${tfe}]`)!==null;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const I=t.current;if(!I)return;if(O){o(null);return}const A=v(),M=d.current;(A.length!==M.length||A.some((fe,ie)=>{const ue=M[ie];return!ue||!fe||fe.top!==ue.top||fe.height!==ue.height||fe.left!==ue.left||fe.width!==ue.width}))&&(d.current=A,c(A));const z=I.getBoundingClientRect(),$=n==="x"?P:R;let q=null,X=1/0,j=null;const K=d.current,ee=n==="x"?I.scrollLeft:I.scrollTop,H=n==="x"?I.clientLeft:I.clientTop,Q=n==="x"?z.left:z.top,B=n==="x"?I.offsetWidth:I.offsetHeight,D=n==="x"?z.width:z.height,G=B>0?D/B:1;for(let fe=0;fe<K.length;fe++){const ie=K[fe];if(!ie)continue;const ue=n==="x"?ie.left:ie.top,he=Q+(H+ue-ee)*G,we=(n==="x"?ie.width:ie.height)*G,le=he+we;$>=he&&$<=le&&(j=fe);let se=0;$<he?se=he-$:$>le&&(se=$-le),se<X&&(X=se,q=fe)}o(j??(X<=r?q:null))})},[n,t,r,v]),x=g.useCallback(()=>{f.current+=1,y()},[y]),k=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),o(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:b,onMouseEnter:x,onMouseLeave:k},registerItem:_,measureItems:y}}function nfe(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const um=t=>{const e=g.useRef(t);return g.useLayoutEffect(()=>{e.current=t}),e};let sv=0;const rfe=()=>{sv+=1;let t=!1;return()=>{t||(t=!0,sv=Math.max(0,sv-1))}},sfe=()=>sv>0,ife='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',wF=({itemSelector:t=ife,loop:e=!1,onDismiss:n}={})=>{const r=g.useRef(null),s=g.useRef(null),i=um(n),o=g.useRef(!1),l=g.useCallback(f=>{var h;if(r.current=f,f){o.current=!1;const m=rfe(),v=f.ownerDocument.defaultView;let y;const _=()=>{v==null||v.clearTimeout(y),y=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",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(y),m()}}else(h=s.current)==null||h.call(s),s.current=null},[i]),c=f=>{o.current&&f.preventDefault()},d=g.useCallback(f=>{var k;const{key:h}=f;if(h!=="ArrowDown"&&h!=="ArrowUp"&&h!=="Home"&&h!=="End")return;const m=r.current;if(!m)return;const v=Array.from(m.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const y=v.indexOf(document.activeElement),_=v.length-1,b=C=>{if(y===-1)return C===1?0:_;const P=y+C;return e?(P+v.length)%v.length:Math.min(Math.max(P,0),_)};let x;h==="Home"?x=0:h==="End"?x=_:h==="ArrowDown"?x=b(1):x=b(-1),(k=v[x])==null||k.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:c}},bF=({queryKey:t,data:e})=>{const n=Om(),[r,s]=g.useState(null),i=r!==null&&r.base===e?r.value:e,o=um({queryKey:t,data:e,visible:i}),l=g.useCallback(c=>{const d=o.current,f=c(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:l}},lS=["project-library"],bI=[...lS,"history"],xI=["library-project-preview"],SI=["variants-history"],Js={rivetConfig:["rivet-config"],featureFlags:["rivet-feature-flags"],account:["rivet-account"],serverConfig:["server-config"],integrations:["integrations"],cosmosProfile:["cosmos-profile"],previewUpstreamHealth:t=>["preview-upstream-health",t],variantsUiState:t=>["variants-ui-state",t],variantsHistory:{all:SI,list:t=>[...SI,t]},designLibrary:(t,e)=>["design-library",t,e],designReferenceSearch:({profileId:t,revision:e,references:n,search:r,sourceId:s})=>["design-reference-search",t,e,n,r,s],designLibraryImage:({profileId:t,referenceId:e,hash:n})=>["design-library-image",t,e,n],projectLibrary:{all:lS,projects:[...lS,"projects"],histories:bI,history:t=>[...bI,t]},libraryProjectPreview:{project:t=>[...xI,t],thumbnail:(t,e)=>[...xI,t,e]},libraryWorkspace:t=>["library-workspace",t],libraryPreview:({projectId:t,sessionId:e,variantId:n})=>["library-preview",t,e,n]};var iv={exports:{}},ofe=iv.exports,kI;function afe(){return kI||(kI=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(ofe,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(_,b){var x=_[b];if(typeof x.bind=="function")return x.bind(_);try{return Function.prototype.bind.call(x,_)}catch{return function(){return Function.prototype.apply.apply(x,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),b=0;b<s.length;b++){var x=s[b];this[x]=b<_?e:this.methodFactory(x,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function h(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function m(_,b,x){return d(_)||h.apply(this,arguments)}function v(_,b){var x=this,k,C,P,R="loglevel";typeof _=="string"?R+=":"+_:typeof _=="symbol"&&(R=void 0);function O(z){var $=(s[z]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function I(){var z;if(!(typeof window===n||!R)){try{z=window.localStorage[R]}catch{}if(typeof z===n)try{var $=window.document.cookie,q=encodeURIComponent(R),X=$.indexOf(q+"=");X!==-1&&(z=/^([^;]+)/.exec($.slice(X+q.length+1))[1])}catch{}return x.levels[z]===void 0&&(z=void 0),z}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function M(z){var $=z;if(typeof $=="string"&&x.levels[$.toUpperCase()]!==void 0&&($=x.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=x.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+z)}x.name=_,x.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},x.methodFactory=b||m,x.getLevel=function(){return P??C??k},x.setLevel=function(z,$){return P=M(z),$!==!1&&O(P),f.call(x)},x.setDefaultLevel=function(z){C=M(z),I()||x.setLevel(z,!1)},x.resetLevel=function(){P=null,A(),f.call(x)},x.enableAll=function(z){x.setLevel(x.levels.TRACE,z)},x.disableAll=function(z){x.setLevel(x.levels.SILENT,z)},x.rebuild=function(){if(o!==x&&(k=M(o.getLevel())),f.call(x),o===x)for(var z in i)i[z].rebuild()},k=M(o?o.getLevel():"WARN");var L=I();L!=null&&(P=M(L)),f.call(x)}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 x=i[b];return x||(x=i[b]=new v(b,o.methodFactory)),x};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return i},o.default=o,o})})(iv)),iv.exports}var lfe=afe();const go=A1(lfe),cfe="INFO",ufe=cfe.toUpperCase();go.setLevel(go.levels[ufe]||go.levels.INFO);const ai=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>go.trace(`${e}${n}`,...r),debug:(n,...r)=>go.debug(`${e}${n}`,...r),info:(n,...r)=>go.info(`${e}${n}`,...r),warn:(n,...r)=>go.warn(`${e}${n}`,...r),error:(n,...r)=>{go.error(`${e}${n}`,...r);try{const i=r.map(l=>Ys(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Xe.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>go.info(`${e}API: ${n}`,...r),hook:(n,...r)=>go.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>go.debug(`${e}Mount: ${n}`,...r)}},dfe=ai("useVariantsHistory"),EI=[],ffe=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&JSON.stringify(n.references)===JSON.stringify(s.references)&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),hfe=({historyQuery:t,snapshotKey:e,isEnabled:n,isListed:r,onLoaded:s})=>{const i=Js.variantsHistory.list({historyQuery:t,snapshotKey:e}),o=um(s),l=la({queryKey:i,queryFn:async({signal:v})=>{let y;try{const b=await Ft(`/api/variants/history${t}`,{credentials:"same-origin",signal:v});if(!b.ok)return h.current;y=((await b.json()).variants??[]).filter(r)}catch(b){return v.aborted||dfe.warn("Failed to load past variants",b),h.current}if(v.aborted)return h.current;o.current(y);const _=h.current;return ffe(_,y)?_:y},enabled:n,placeholderData:UJ,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:c,updateData:d}=bF({queryKey:i,data:l.data}),f=c??EI,h=um(f),m=g.useCallback(v=>{d(y=>v(y??EI))},[d]);return{pastVariants:f,setPastVariants:m}},CI=ai("useVariantsUiState"),pfe={groups:[],rows:{}},ov={pinned:[],order:pfe},cp="pinned",mfe="top",Iw=t=>`rows:${t}`,Ow=t=>({projectPath:t,mutations:[],preview:ov}),gfe=(t,e)=>e.reduce((n,r)=>r(n),t),xF=t=>t?`/api/variants/ui-state?projectPath=${encodeURIComponent(t)}`:"/api/variants/ui-state",vfe=async t=>{const e=await Ft(xF(t));if(!e.ok)throw new Error(`Failed to load variants UI state (${e.status})`);return kJ.parse(await e.json()).uiState},yfe=async({projectPath:t,uiState:e})=>{await Ft(xF(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:e})})},PI=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},_fe=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),wfe=(t,e)=>n=>{if(t===cp){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===mfe?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},bfe=t=>{const e=Om(),n=Js.variantsUiState(t),[r,s]=g.useState(()=>Ow(t)),i=g.useRef(r),o=g.useCallback(P=>{i.current=P,s(P)},[]),l=g.useCallback(P=>i.current.projectPath===P?i.current:Ow(P),[]),{mutate:c}=oL({mutationFn:yfe,onError:P=>{CI.warn("persist failed — arrangement kept for this session only",P)}}),d=la({queryKey:n,queryFn:async()=>{let P;try{P=await vfe(t)}catch(I){throw CI.warn("load failed — arrangement is session-local until reload",I),I}const{mutations:R}=l(t);if(R.length===0)return P;o(Ow(t));const O=gfe(P,R);return t&&c({projectPath:t,uiState:O}),O},enabled:t!==null,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:f,updateData:h}=bF({queryKey:n,data:d.isSuccess?d.data:void 0}),m=g.useCallback(()=>{var P;return t!==null&&((P=e.getQueryState(Js.variantsUiState(t)))==null?void 0:P.status)==="success"},[t,e]),v=g.useCallback(()=>m()?e.getQueryData(Js.variantsUiState(t))??ov:l(t).preview,[m,t,e,l]),y=g.useCallback(P=>{if(t!==null&&m()){const O=h(I=>P(I??ov));c({projectPath:t,uiState:O});return}const R=l(t);o({projectPath:t,mutations:[...R.mutations,P],preview:P(R.preview)})},[m,c,t,l,o,h]),_=g.useCallback(P=>{const R=!v().pinned.includes(P);y(R?PI(P):_fe(P))},[y,v]),b=g.useCallback(P=>{v().pinned.includes(P)||y(PI(P))},[y,v]),x=g.useCallback((P,R)=>{y(wfe(P,R))},[y]);let k=ov;f?k=f:r.projectPath===t&&(k=r.preview);const C=g.useMemo(()=>new Set(k.pinned),[k.pinned]);return{pinnedKeys:k.pinned,pinnedKeySet:C,listOrder:k.order,togglePin:_,pinItem:b,reorder:x}},xfe=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=g.useState(null),c=g.useCallback(h=>{const m=e.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(h)}"]`)):[]},[e]),d=g.useCallback(h=>{if(!n){o&&l(null);return}const m=e.current;if(!m)return;if(r){const x=m.querySelector(r);if(x){const k=x.getBoundingClientRect();if(h.clientY>=k.top&&h.clientY<=k.bottom){o&&l(null);return}}}if(s){const x=m.querySelector(s),k=x==null?void 0:x.getBoundingClientRect();if(!k||h.clientY<k.top||h.clientY>k.bottom){o&&l(null);return}}const v=c(n.container);if(v.length===0){o&&l(null);return}const y=m.getBoundingClientRect().top;let _=v.length;for(let x=0;x<v.length;x++){const k=v[x].getBoundingClientRect();if(h.clientY<k.top+k.height/2){_=x;break}}let b;_===0?b=v[0].getBoundingClientRect().top-y-1:_===v.length?b=v[v.length-1].getBoundingClientRect().bottom-y:b=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-y,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:b})},[e,n,o,c,r,s]),f=g.useCallback(()=>{if(!n||!o)return;l(null);const h=c(o.container).map(y=>y.dataset.reorderKey).filter(y=>!!y),m=h.indexOf(n.key);if(m===-1)return;h.splice(m,1);const v=o.index>m?o.index-1:o.index;h.splice(v,0,n.key),i(o.container,h)},[n,o,c,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},Sfe={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}},SF=Object.fromEntries(Object.entries(Sfe).map(([t,e])=>[t,{isEnabled:e.default}])),kF=gn(!0),EF=gn(null),CF=gn(0),kfe=gn({name:null,email:null}),cS=gn(0),m1=gn(null),uS=gn(!1),dS=gn(null),PF=gn(!1),TF=gn(!1),av=gn(null),lv=gn(null),$f=gn(null),WE=gn(null),mc=gn(null),RF=gn(!1),Vm=gn({active:!1}),AF=gn([]),fS=gn(SF),Efe=gn(!1),dy=gn(null),Cfe=gn(null),fy=gn(!0),Pfe=gn(!1),IF=gn(!1),OF=gn(null),Tfe=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},hy=gn(Tfe()),Rfe=gn(null);function Afe(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const Ife=t=>{var e;return[t.label.trim(),(e=t.description)==null?void 0:e.trim()].filter(n=>!!n).join(`
170
- `)},MF=async({text:t,copyKind:e})=>{const n=t.trim();if(n)try{await navigator.clipboard.writeText(n),Xe.capture("variants_panel.copy_completed",{outcome:"success",copyKind:e}),on.success("Copied")}catch(r){Xe.capture("variants_panel.copy_failed",{outcome:"failure",copyKind:e,errorName:r instanceof Error?r.name:"UnknownError"}),on.error("Couldn't copy")}},Ofe=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],KE=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:Ofe.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),Mfe=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(sm,{size:12,weight:"bold"}):null,o]})]})},NF=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:c})=>{const[d,f]=g.useState(!1),h=i?o??t:t,m=c.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,h]}),m?S.jsxs(VE,{open:d,onOpenChange:f,children:[S.jsx(HE,{asChild:!0,children:S.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(Eae,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(UE,{children:S.jsx(BE,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(v=>{const y=v.icon;return S.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),f(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[y?S.jsx(y,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},zu=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(LE,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),Nfe=32,Lfe=2048,LF=Vd().max(Lfe).refine(t=>{let e;try{e=decodeURIComponent(t.split(/[?#]/)[0])}catch{return!1}return t.startsWith("/")&&!t.startsWith("//")&&!t.includes("\\")&&!/^\/%(?:2f|5c)/i.test(t)&&!e.includes("\\")&&!e.split("/").some(n=>n==="."||n==="..")&&![...t].some(n=>n<=" "||n==="")},"Expected an app-relative preview route");oJ(LF).min(1).max(Nfe).transform(t=>[...new Set(t)]);const py="/__rivet/preview",TI=`${py}/variant/`,RI=`${py}/history/`,DF=t=>t?t.startsWith("/")?t:`/${t}`:"/",$F=(t,e)=>{if(!e)return t;const n=LF.parse(e);if(t.includes("?")||t.includes("#"))throw new Error("Preview target must not contain an application query or hash");return t.replace(/\/$/,"")+n},AI=(t,e)=>{const n=new URLSearchParams(e);return n.set("targetAddressed","1"),`/api/variants/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}/run?${n}`},Dfe=t=>{const e="/api/variants/history/"+encodeURIComponent(t.sessionId)+"/"+encodeURIComponent(t.variantId);return t.routePath?$F(e+"/site/"+encodeURIComponent(t.projectPath??"current"),t.routePath):e+"/preview"+(t.projectPath?"?projectPath="+encodeURIComponent(t.projectPath):"")},$fe=t=>`${py}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${DF(t.routePath)}`,II=t=>`${py}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${DF(t.routePath)}`,OI=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(TI)||e.pathname.startsWith(RI)}catch{return t.startsWith(TI)||t.startsWith(RI)}},Cu=t=>{var s,i,o,l,c,d;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?$F(n.preview.url,(i=n.previewRoutes)==null?void 0:i[0]):e&&(((o=n.preview)==null?void 0:o.kind)==="dev_server"||typeof n.port=="number")?$fe({sessionId:e,variantId:n.workItemId,routePath:((l=n.previewRoutes)==null?void 0:l[0])??((r==null?void 0:r.kind)==="fresh"?"/":t.routePath)}):e&&(r==null?void 0:r.kind)==="fresh"&&((c=r.executionPlan)==null?void 0:c.mode)!=="vite_app"&&((d=n.preview)==null?void 0:d.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},MI="/rivet/",FF=t=>{if(!t.startsWith(MI))return null;const e=t.slice(MI.length);return!e||e==="/"?null:`/${e}`},Jd=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},Ffe=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static"||((n=t.serve)==null?void 0:n.kind)==="static"||Jd(t)},jfe=t=>[...t].sort((e,n)=>new Date(n.createdAt).getTime()-new Date(e.createdAt).getTime()).find(e=>!Jd(e)),dm=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},NI=t=>{var e,n;return dm(t)&&(((e=t.preview)==null?void 0:e.kind)==="static_artifact"||((n=t.preview)==null?void 0:n.kind)==="dev_server")},jF=({entry:t,projectPath:e})=>{var n;return Dfe({sessionId:t.sessionId,variantId:t.variantId,projectPath:e,routePath:(n=t.previewRoutes)==null?void 0:n[0]})},zfe=({entry:t,projectPath:e})=>({selectedPastVariant:{sessionId:t.sessionId,variantId:t.variantId,previewKind:"static",references:t.references,projectPath:e??void 0},previewUrl:jF({entry:t,projectPath:e})}),Vfe=({incomingSessionId:t,previousSessionId:e,isIncomingSessionPreviewable:n,selectedPastVariant:r,displayedLiveVariantId:s,pastVariants:i})=>{if(n)return{kind:"clear"};if(r)return r.sessionId===t?{kind:"clear"}:{kind:"keep_selected"};const o=i.find(l=>l.sessionId===e&&l.variantId===s&&!Jd(l));return o?{kind:"show_saved",entry:o}:{kind:"clear"}},Ff=(t,e=Ft)=>{if((t==null?void 0:t.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:t.sessionId,variantId:t.variantId});e(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},Hfe=(t,e=Ft)=>{const n=new Set;for(const r of[t==null?void 0:t.left,t==null?void 0:t.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),Ff(r,e))}},g1=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},LI=6,zF="original",qE="Original",VF="The original state of your app before any variants were generated.",DI=200,HF="h-6 w-6 rounded",hS=[.33,1,.68,1],pS=.22,Xr=ai("AgentVariantsPanel"),Mw=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},Ufe=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Nw(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const Bfe=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},UF=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},Zfe="original",mS="pinned-section";function BF(t){return`rivet:collapsedRuns:${t}`}function Pg(t){try{const e=window.localStorage.getItem(BF(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Lw(t,e){try{window.localStorage.setItem(BF(t),JSON.stringify([...e]))}catch{}}const $I=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=Bfe(s,e);let o="";s.kind==="original"?o=Zfe:i&&(o=UF(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function Ta(t){try{const e=await t.json();return{message:typeof e.message=="string"?e.message:null,errorCode:typeof e.errorCode=="string"?e.errorCode:null}}catch{return{message:null,errorCode:null}}}const ZF=t=>t.status==="succeeded",WF=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},Wfe=t=>t.status==="succeeded"&&!dm(t)&&(!t.previewUnavailable||WF(t)),Dw=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},FI=(t,e,n)=>{const r=new URL(t,window.location.origin);return r.searchParams.set(e,n),`${r.pathname}${r.search}${r.hash}`},Kfe=t=>{var e;return ZF(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},jI=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),qfe=()=>{var Wu,Ku,Rc;const t=fE(),e=St(Vm),n=St(RF),r=g.useRef(!1),s=St(AF),i=St(dy),o=St(fy),l=St(fS),c=((Wu=l.share)==null?void 0:Wu.isEnabled)??!1,d=((Ku=l.deployPrototype)==null?void 0:Ku.isEnabled)??!1,f=((Rc=l.canvasShare)==null?void 0:Rc.isEnabled)??!1,h=St(IF),m=St(OF),v=Nt(cS),y=Nt(m1),_=Nt(uS),b=Nt(dS),x=Nt(PF),k=Nt(TF),C=Nt($f),P=St($f),R=Nt(WE),O=Nt(EF);g.useEffect(()=>(O("Directions"),()=>O(null)),[O]);const I=St(mc),A=Nt(mc),M=g.useCallback((U=!1)=>{if(Hfe(I),A(null),U&&I){const ae=g1("ended",I);Xe.capture(ae.event,ae.properties)}},[A,I]),L=St(av),z=Nt(av),$=St(lv),q=Nt(lv),X=$?`${$.sessionId}:${$.variantId}`:null,[j,K]=g.useState(""),[ee,H]=g.useReducer(U=>U+1,0),Q=g.useMemo(()=>i!==null?Pg(i):new Set,[i,ee]),B=g.useCallback(U=>{if(i===null)return;const ae=new Set(Pg(i));ae.delete(U)||ae.add(U),Lw(i,ae),H()},[i]),[D,G]=g.useState(null),[fe,ie]=g.useState(null),[ue,he]=g.useState(!1),[we,le]=g.useState({}),[se,be]=g.useState(null),[Se,$e]=g.useState({}),[kt,tn]=g.useState(null),[nn,xt]=g.useState(!1),[Dt]=g.useState(()=>Dle(window.location.search)),un=g.useRef(!1),Kt=Dt!==null||$!==null||L!==null||nn,Le=g.useMemo(()=>e.active?e.variants:[],[e]),Qe=g.useMemo(()=>Le.filter(Kfe),[Le]),Ae=g.useMemo(()=>jI(Qe,we),[Qe,we]),Ct=(se==null?void 0:se.key)===Ae?se.shareUrl:null,ke=e.active?e.sessionId:null,$t=g.useMemo(()=>{const U=new Set;for(const ae of Le)ae.adoptedSource&&U.add(`${ae.adoptedSource.sessionId}:${ae.adoptedSource.variantId}`);return U},[Le]),ft=e.active?e.projectContext:null,pt=(ft==null?void 0:ft.kind)==="fresh"?ft.workspacePath:i,tr=g.useMemo(()=>pt?`?projectPath=${encodeURIComponent(pt)}`:"",[pt]),Mi=e.active?`${e.sessionId}:${e.stage}`:"inactive",Pn=g.useMemo(()=>{var ae;if(nn||X)return null;const U=L?Le.find(Oe=>Oe.workItemId===L):null;return L&&!U?null:U?dm(U)?U.workItemId:null:e.active?((ae=Le.find(NI))==null?void 0:ae.workItemId)??null:null},[L,X,nn,e,Le]),lr=g.useCallback(U=>{const ae=zfe({entry:U,projectPath:pt});q(ae.selectedPastVariant),xt(!1),y(ae.previewUrl)},[pt,y,q]),no=g.useRef(!1),xs=U=>{if(!no.current&&!Kt&&Pn===null&&U.length>0&&U.every(ae=>ae.projectKind==="fresh")){const ae=jfe(U);ae&&(no.current=!0,lr(ae))}q(ae=>{if(!ae)return ae;const Oe=U.find(Pe=>Pe.sessionId===ae.sessionId&&Pe.variantId===ae.variantId);return!Oe||JSON.stringify(ae.references)===JSON.stringify(Oe.references)?ae:{...ae,references:Oe.references}})},{pastVariants:ss,setPastVariants:nr}=hfe({historyQuery:tr,snapshotKey:Mi,isEnabled:!o,isListed:Ffe,onLoaded:xs}),vn=g.useMemo(()=>[...ss.filter(ae=>ae.sessionId!==ke&&!$t.has(`${ae.sessionId}:${ae.variantId}`))].sort((ae,Oe)=>{const Pe=new Date(ae.createdAt).getTime(),Ie=new Date(Oe.createdAt).getTime();return(Number.isNaN(Ie)?0:Ie)-(Number.isNaN(Pe)?0:Pe)}),[$t,ss,ke]),is=g.useMemo(()=>$?Le.find(U=>{var ae,Oe;return((ae=U.adoptedSource)==null?void 0:ae.sessionId)===$.sessionId&&((Oe=U.adoptedSource)==null?void 0:Oe.variantId)===$.variantId})??null:null,[$,Le]),pr=g.useMemo(()=>$?vn.find(U=>U.sessionId===$.sessionId&&U.variantId===$.variantId)??null:null,[$,vn]),Eo=!e.active&&vn.length>0&&vn.every(U=>U.projectKind==="fresh"),Kr=e.active?Ufe(ft):!!i&&!Eo,{pinnedKeys:rr,pinnedKeySet:Lr,listOrder:li,togglePin:cr,pinItem:Ss,reorder:st}=bfe(pt),cn=g.useRef(null),rn=g.useRef(null),yn=typeof window>"u"?"/":FF(window.location.pathname)??"/",Tn=g.useRef(null),qt=g.useRef(!1),$n=g.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),Mw(),Tn.current={kind:"live",variantId:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]),os=g.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),Mw(),Tn.current={kind:"past",entry:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]);g.useEffect(()=>{const U=Pe=>{var ut;const Ie=Tn.current;if(!Ie)return;const De=Pe.clientX-Ie.startX,Pt=Pe.clientY-Ie.startY;if(!Ie.committed){if(De*De+Pt*Pt<LI*LI)return;if(Mw(),Ie.kind==="live"){const gt=Le.find(ls=>ls.workItemId===Ie.variantId);if(!gt||gt.status!=="succeeded"){Tn.current=null;return}const Cr=Cu({sessionId:ke,variant:gt,projectContext:ft,routePath:yn});C({sessionId:ke??"",variantId:gt.workItemId,label:gt.label||"Direction",url:Cr,source:"live",runLabel:gt.runLabel,description:gt.description})}else{const{entry:gt}=Ie,Cr=Jd(gt),ls=Cr?II({sessionId:gt.sessionId,variantId:gt.variantId,routePath:((ut=gt.previewRoutes)==null?void 0:ut[0])??yn}):jF({entry:gt,projectPath:pt});if(C({sessionId:gt.sessionId,variantId:gt.variantId,label:gt.label||"Direction",url:ls,source:Cr?"history-dev-server":"history-static",runLabel:gt.runLabel,description:gt.brief}),Cr){const Es=AI(gt,tr);(async()=>{try{if(!(await Ft(Es,{method:"POST"})).ok)return;const sn=FI(ls,"replay",String(Date.now()));C(Tt=>!Tt||Tt.sessionId!==gt.sessionId||Tt.variantId!==gt.variantId||Tt.source!=="history-dev-server"?Tt:{...Tt,url:sn}),A(Tt=>{if(!Tt)return Tt;const Oo=Di=>!Di||Di.sessionId!==gt.sessionId||Di.variantId!==gt.variantId?Di:{...Di,url:sn};return{...Tt,left:Oo(Tt.left),right:Oo(Tt.right)}})}catch(Fs){Xr.warn("history replay drag boot failed",Fs)}})()}}Ie.committed=!0}R({x:Pe.clientX,y:Pe.clientY})},ae=()=>{const Pe=Tn.current;Pe!=null&&Pe.committed&&(qt.current=!0,window.setTimeout(()=>{qt.current=!1},0)),Tn.current=null,R(null)},Oe=Pe=>{if(Pe.key!=="Escape")return;const Ie=Tn.current;Ie!=null&&Ie.committed&&(Ie.kind==="past"&&Jd(Ie.entry)&&Ff({sessionId:Ie.entry.sessionId,variantId:Ie.entry.variantId,source:"history-dev-server"}),Tn.current=null,C(null),R(null))};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),window.addEventListener("keydown",Oe),()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae),window.removeEventListener("keydown",Oe)}},[Le,ke,ft,yn,tr,pt,C,R,A]);const sr=g.useCallback(()=>{var U;(U=Tn.current)!=null&&U.committed&&(qt.current=!0,window.setTimeout(()=>{qt.current=!1},0)),Tn.current=null,R(null),P&&(P.source==="history-dev-server"&&Ff({sessionId:P.sessionId,variantId:P.variantId,source:"history-dev-server"}),C(null))},[P,C,R]),kr=g.useCallback((U,ae)=>{const Oe=!Lr.has(U);Xe.capture(Oe?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:ae}),cr(U)},[Lr,cr]),Ut=g.useCallback(()=>{P&&(Xe.capture("variants_panel.direction_pinned",{method:"drag"}),Ss(`row:past:${P.sessionId}:${P.variantId}`),sr())},[P,sr,Ss]),Ni=g.useCallback(U=>{Xe.capture("variants_panel.direction_unpinned",{method:"drag"}),cr(U),sr()},[cr,sr]),rh=g.useCallback((U,ae)=>{st(U,ae),sr()},[st,sr]),il=nn||Kr&&L===null&&X===null&&Pn===null,Co=g.useCallback(async U=>{var Oe,Pe,Ie,De,Pt;if(!ke)return;const ae=(U==null?void 0:U.workItemId)??null;G({kind:"switch",variantId:ae??void 0});try{if(((Oe=U==null?void 0:U.preview)==null?void 0:Oe.kind)==="static_artifact"){const gt=Cu({sessionId:ke,variant:U,projectContext:e.active?e.projectContext:null})??U.preview.url;_(!1),b(null),((Pe=U.refinement)==null?void 0:Pe.status)==="succeeded"&&!((Ie=U.previewRoutes)!=null&&Ie.length)?y(FI(gt,"refinement",U.refinement.workItemId)):y(gt);return}if(ae&&ke&&e.active&&e.projectContext.kind==="fresh"&&((De=e.projectContext.executionPlan)==null?void 0:De.mode)!=="vite_app"&&((Pt=U==null?void 0:U.preview)==null?void 0:Pt.kind)!=="dev_server"){_(!1),b(null),y(`/api/variants/${ke}/static/${ae}`);return}const ut=U&&ae?Cu({sessionId:ke,variant:U,projectContext:e.active?e.projectContext:null,routePath:yn}):null;if(ut){_(!1),b(null),y(ut);return}Xe.capture("variants_panel.preview_display_failed",{sessionId:ke,variantId:ae,previewKind:U?Dw(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:"No addressable dev-server preview URL"}),_(!1),b(null)}catch(ut){Xr.warn("preview display failed",ut),Xe.capture("variants_panel.preview_display_failed",{sessionId:ke,variantId:ae,previewKind:U?Dw(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:ut instanceof Error?ut.message:String(ut)}),_(!1),b(null)}finally{G(null)}},[ke,e,yn,y,_,b]),Dr=g.useRef(0),Li=g.useCallback(()=>{Dr.current++,G(U=>(U==null?void 0:U.kind)==="switch"?null:U),x(!1),k(!1)},[x,k]),Ds=g.useCallback(async U=>{if(ke){G({kind:"switch",variantId:U.workItemId});try{const ae=await Ft(`/api/variants/${ke}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:U.workItemId})});if(!ae.ok){const Oe=await Ta(ae);throw new Error(Oe.message??`Preview restoration failed (${ae.status})`)}}catch(ae){Xr.warn("preview restoration failed",ae),Xe.capture("variants_panel.preview_display_failed",{sessionId:ke,variantId:U.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ae instanceof Error?ae.message:String(ae)})}finally{G(null)}}},[ke]),ro=g.useCallback(U=>{var De,Pt,ut,gt,Cr;if(qt.current){qt.current=!1;return}const ae=dm(U),Oe=U.status==="pending"||U.status==="running"||Wfe(U);Li();const Pe=Dw(U),Ie=Le.find(ls=>ls.workItemId===L);Xe.capture("variants_panel.preview_requested",{sessionId:ke,fromVariantId:Ie==null?void 0:Ie.workItemId,toVariantId:U.workItemId,variantStatus:U.status,isPreviewReady:ae,isArmed:Oe,previewKind:Pe,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((Pt=(De=U.actions)==null?void 0:De.view)==null?void 0:Pt.enabled)??null,previewUnavailableReason:((ut=U.previewUnavailable)==null?void 0:ut.reason)??null}),z(U.workItemId),q(null),ae?(rn.current=U.workItemId,xt(!1),M(!0),Co(U)):(rn.current=null,xt(!1),y(null),_(!1),Oe&&Xe.capture("variants_panel.preview_armed",{sessionId:ke,fromVariantId:Ie==null?void 0:Ie.workItemId,toVariantId:U.workItemId,variantStatus:U.status,previewKind:Pe,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((Cr=(gt=U.actions)==null?void 0:gt.view)==null?void 0:Cr.enabled)??null}),WF(U)&&Ds(U)),Xe.capture("variants_panel.preview_switched",{sessionId:ke,fromVariantId:Ie==null?void 0:Ie.workItemId,toVariantId:U.workItemId,armed:Oe})},[L,ke,M,z,q,Li,Ds,Co,Le,y,_]),$s=g.useCallback(U=>{if(qt.current){qt.current=!1;return}if(M(!0),z(null),Jd(U)){q({sessionId:U.sessionId,variantId:U.variantId,previewKind:"dev_server",references:U.references,projectPath:pt??void 0}),xt(!1);const ae=++Dr.current;x(!0),k(!0),(async()=>{var Pe;G({kind:"switch"}),Xe.capture("variants_panel.history_replay_started",{sessionId:U.sessionId,variantId:U.variantId});const Oe=(Ie,De)=>{Xe.capture("variants_panel.history_replay_failed",{sessionId:U.sessionId,variantId:U.variantId,...De}),x(!1),k(!1),q(Pt=>Pt?{...Pt,previewError:Ie}:null),y(null)};try{const Ie=await Ft(AI(U,tr),{method:"POST"});if(ae!==Dr.current)return;if(!Ie.ok){const{message:Pt,errorCode:ut}=await Ta(Ie);if(ae!==Dr.current)return;Xr.warn(`history replay failed: HTTP ${Ie.status} ${ut??""}`),Oe(Pt??`Preview startup failed (${Ie.status})`,{httpStatus:Ie.status,errorCode:ut});return}const De=await Ie.json();if(ae!==Dr.current)return;k(!1),_(!1),b(null),y(II({sessionId:U.sessionId,variantId:U.variantId,routePath:((Pe=U.previewRoutes)==null?void 0:Pe[0])??yn})),De.alreadyRunning||v(Pt=>Pt+1),Xe.capture("variants_panel.history_replay_ready",{sessionId:U.sessionId,variantId:U.variantId})}catch(Ie){if(ae!==Dr.current)return;Xr.warn("history replay failed",Ie);const De=Ys(Ie,"Preview startup failed");Oe(De,{errorMessage:De})}finally{ae===Dr.current&&G(null)}})();return}Li(),_(!1),b(null),lr(U)},[pt,yn,lr,G,x,k,v,q,z,y,b,M,_,Li,tr]);g.useEffect(()=>{if(!Dt||un.current)return;const U=ss.find(ae=>ae.sessionId===Dt.sessionId&&ae.variantId===Dt.variantId);U&&(un.current=!0,$s(U))},[Dt,ss,$s]);const ol=g.useCallback(async()=>{Li();const U=()=>{M(!0),z(null),q(null),xt(!0),rn.current=null,_(!1),b(null),y(null)};if(!ke){U();return}G({kind:"switch"});try{const ae=await Ft(`/api/variants/${ke}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ae.ok){Xr.warn(`switch to original failed: HTTP ${ae.status}`);return}U(),_(!0),Xe.capture("variants_panel.preview_switched",{sessionId:ke,fromVariantId:L,toVariantId:null,target:"original",armed:!1})}catch(ae){Xr.warn("preview-port original switch failed",ae)}finally{G(null)}},[L,ke,z,q,y,b,M,_,Li]),ci=g.useCallback(async(U,ae,Oe)=>{Xe.capture("variants_panel.deploy_clicked",{sessionId:U,variantId:ae,variantLabel:Oe});try{const Pe=await Ft(`/api/variants/${U}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ae,...i?{projectPath:i}:{}})});if(!Pe.ok){const{message:Pt,errorCode:ut}=await Ta(Pe);return Xr.warn(`deploy failed: HTTP ${Pe.status} ${ut??""} ${Pt??""}`),Xe.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:Pe.status,errorCode:ut??null,errorMessage:Pt??null}),on.error("Couldn't deploy this direction",{description:Pt??`The server rejected the request (HTTP ${Pe.status}). Try again.`}),null}const Ie=await Pe.json().catch(()=>null),De=Ie==null?void 0:Ie.shareUrl;return De?(await navigator.clipboard.writeText(De).catch(()=>{}),Xe.capture("variants_panel.deploy_succeeded",{sessionId:U,variantId:ae}),on.success(`"${Oe}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(De,"_blank","noopener")}}),De):(on.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(Pe){return Xr.warn("deploy failed",Pe),Xe.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:Pe instanceof Error?Pe.message:String(Pe)}),on.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),Cc=g.useCallback(async U=>{if(!ke)return;const ae=we[U.workItemId];if(ae){await navigator.clipboard.writeText(ae).catch(()=>{}),on.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ae,"_blank","noopener")}});return}G({kind:"deploy",variantId:U.workItemId});try{const Oe=await ci(ke,U.workItemId,U.label);Oe&&le(Pe=>({...Pe,[U.workItemId]:Oe}))}finally{G(null)}},[ke,we,ci]),Uu=g.useCallback(async()=>{if(!(!ke||Qe.length===0)){if(Ct){await navigator.clipboard.writeText(Ct).catch(()=>{}),on.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Ct,"_blank","noopener")}});return}Xe.capture("variants_panel.deploy_clicked",{sessionId:ke,variantId:"canvas",variantLabel:"Canvas",variantCount:Qe.length}),G({kind:"deploy-canvas"});try{const U=await Ft(`/api/variants/${ke}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Qe.map(De=>De.workItemId),...i?{projectPath:i}:{}})});if(!U.ok){const{message:De,errorCode:Pt}=await Ta(U);Xr.warn(`canvas deploy failed: HTTP ${U.status} ${Pt??""} ${De??""}`),Xe.capture("variants_panel.deploy_failed",{sessionId:ke,variantId:"canvas",httpStatus:U.status,errorCode:Pt??null,errorMessage:De??null,variantCount:Qe.length}),on.error("Couldn't share this canvas",{description:De??`The server rejected the request (HTTP ${U.status}). Try again.`});return}const ae=await U.json().catch(()=>null),Oe=ae==null?void 0:ae.shareUrl;if(!Oe){on.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const Pe=Object.fromEntries(((ae==null?void 0:ae.variants)??[]).filter(De=>typeof De.variantId=="string"&&typeof De.shareUrl=="string").map(De=>[De.variantId,De.shareUrl])),Ie=Object.keys(Pe).length>0?{...we,...Pe}:we;Ie!==we&&le(Ie),await navigator.clipboard.writeText(Oe).catch(()=>{}),be({key:jI(Qe,Ie),shareUrl:Oe}),Xe.capture("variants_panel.deploy_succeeded",{sessionId:ke,variantId:"canvas",variantCount:Qe.length}),on.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Oe,"_blank","noopener")}})}catch(U){Xr.warn("canvas deploy failed",U),Xe.capture("variants_panel.deploy_failed",{sessionId:ke,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:U instanceof Error?U.message:String(U),variantCount:Qe.length}),on.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{G(null)}}},[Ct,Qe,we,i,ke]),al=g.useCallback(async U=>{const ae=`${U.sessionId}:${U.variantId}`,Oe=Se[ae];if(Oe){await navigator.clipboard.writeText(Oe).catch(()=>{}),on.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Oe,"_blank","noopener")}});return}tn(ae);try{const Pe=await ci(U.sessionId,U.variantId,U.label);Pe&&$e(Ie=>({...Ie,[ae]:Pe}))}finally{tn(null)}},[Se,ci]),dn=g.useCallback(async U=>{if(ke){Xe.capture("variants_panel.remove_clicked",{sessionId:ke,variantId:U.workItemId,variantLabelLength:U.label.length}),G({kind:"remove",variantId:U.workItemId});try{const ae=await Ft(`/api/variants/${ke}/${U.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ae.ok){const{message:Oe}=await Ta(ae);Xr.warn(`remove failed: HTTP ${ae.status} ${Oe??""}`),on.error("Couldn't remove direction",{description:Oe??`The server rejected the request (HTTP ${ae.status}). Try again.`});return}(U.workItemId===Pn||U.workItemId===L)&&(z(null),y(null),_(!1),v(Oe=>Oe+1))}catch(ae){Xr.warn("remove failed",ae),on.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{G(null)}}},[ke,L,Pn,z,y,_,v]),Po=g.useCallback(async U=>{if(!pt){on.error("Couldn't remove direction",{description:"No project path available."});return}Xe.capture("variants_panel.remove_past_clicked",{sessionId:U.sessionId,variantId:U.variantId});const ae=`${U.sessionId}:${U.variantId}`,Oe=Pe=>Pe.sessionId===U.sessionId&&Pe.variantId===U.variantId;G({kind:"remove",variantId:ae}),nr(Pe=>Pe.filter(Ie=>!Oe(Ie))),X===ae&&(q(null),y(null),_(!1),v(Pe=>Pe+1));try{const Pe=await Ft(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:pt})});if(!Pe.ok){const{message:Ie}=await Ta(Pe);nr(De=>De.some(Oe)?De:[...De,U]),on.error("Couldn't remove direction",{description:Ie??`The server rejected the request (HTTP ${Pe.status}). Try again.`})}}catch(Pe){Xr.warn("remove past failed",Pe),nr(Ie=>Ie.some(Oe)?Ie:[...Ie,U]),on.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{G(null)}},[pt,X,q,y,_,v,nr]),ui=g.useCallback(U=>{ie(U)},[]),To=g.useCallback(U=>{if(!U.label||!U.run)return;const ae=U.rows.flatMap(Pe=>Pe.kind==="active"?[Pe.variant]:[]),Oe=U.rows.flatMap(Pe=>Pe.kind==="past"?[Pe.entry]:[]);ae.length===0&&Oe.length===0||ie({kind:"run",label:U.label,variants:ae,entries:Oe})},[]),qr=g.useCallback(async()=>{if(!(!fe||ue)){he(!0);try{if(fe.kind==="active")await dn(fe.variant);else if(fe.kind==="past")await Po(fe.entry);else{for(const U of fe.variants)await dn(U);for(const U of fe.entries)await Po(U)}}finally{he(!1),ie(null)}}},[fe,ue,dn,Po]),[Pc,Tc]=g.useState(null),[ma,as]=g.useState(null),Bu=g.useCallback(U=>{as(U)},[]),ks=g.useCallback(()=>{as(null)},[]),sh=g.useCallback(async(U,ae)=>{as(null);const Oe=ae.trim();if(!Oe||U.kind==="original")return;if(U.kind==="active"){if(!ke||Oe===U.variant.label)return;Xe.capture("variants_panel.rename",{sessionId:ke,variantId:U.variant.workItemId,labelLength:Oe.length,past:!1});try{const De=await Ft(`/api/variants/${ke}/${U.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Oe})});if(!De.ok){const{message:Pt}=await Ta(De);on.error("Couldn't rename direction",{description:Pt??`The server rejected the request (HTTP ${De.status}). Try again.`})}}catch(De){Xr.warn("rename failed",De),on.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:Pe}=U;if(Oe===Pe.label.trim())return;if(!pt){on.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 Ie=De=>De.sessionId===Pe.sessionId&&De.variantId===Pe.variantId;nr(De=>De.map(Pt=>Ie(Pt)?{...Pt,label:Oe}:Pt));try{const De=await Ft(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Oe,projectPath:pt})});if(!De.ok){const{message:Pt}=await Ta(De);nr(ut=>ut.map(gt=>Ie(gt)?{...gt,label:Pe.label}:gt)),on.error("Couldn't rename direction",{description:Pt??`The server rejected the request (HTTP ${De.status}). Try again.`})}}catch(De){Xr.warn("rename failed",De),nr(Pt=>Pt.map(ut=>Ie(ut)?{...ut,label:Pe.label}:ut)),on.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[ke,pt,nr]),[Zu,Ro]=g.useState(null),Ao=g.useCallback(U=>{Ro(U)},[]),F=g.useCallback(()=>{Ro(null)},[]),pe=g.useCallback(async(U,ae)=>{if(Ro(null),!U.label||!U.run)return;const Oe=U.label,Pe=ae.trim();if(!Pe||Pe===Oe)return;Xe.capture("variants_panel.rename_run",{runLabelLength:Pe.length});const Ie="requestId"in U.run?U.run.requestId:void 0,De=Ie?U.key:UF({sessionId:U.run.sessionId,runLabel:Pe}),Pt=De!==U.key;let ut=!1,gt=!1;if(i!==null&&Pt){const sn=Pg(i);ut=sn.has(U.key),gt=sn.has(De),ut&&(sn.add(De),Lw(i,sn),H())}const Cr=sn=>{if(i===null||!Pt)return;const Tt=Pg(i);sn?Tt.delete(U.key):(ut?Tt.add(U.key):Tt.delete(U.key),gt?Tt.add(De):Tt.delete(De)),Lw(i,Tt),H()},ls=new Set(U.rows.flatMap(sn=>sn.kind==="past"?[`${sn.entry.sessionId}:${sn.entry.variantId}`]:[])),Es=sn=>ls.has(`${sn.sessionId}:${sn.variantId}`);nr(sn=>sn.map(Tt=>Es(Tt)?{...Tt,runLabel:Pe}:Tt));const Fs=()=>nr(sn=>sn.map(Tt=>Es(Tt)?{...Tt,runLabel:Oe}:Tt));try{const sn=await Ft("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:U.run.sessionId,...Ie?{requestId:Ie}:{},runLabel:Oe,label:Pe,...pt?{projectPath:pt}:{}})});if(sn.ok)Cr(!0);else{const{message:Tt}=await Ta(sn);Fs(),Cr(!1),on.error("Couldn't rename run",{description:Tt??`The server rejected the request (HTTP ${sn.status}). Try again.`})}}catch(sn){Xr.warn("run rename failed",sn),Fs(),Cr(!1),on.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[pt,i,nr]);g.useEffect(()=>{const U=n&&!r.current;if(r.current=n,cn.current!==ke){const Oe=cn.current===null,Pe=cn.current;cn.current=ke;const Ie=t.get(lv);if(U&&Dt&&(Ie==null?void 0:Ie.sessionId)===Dt.sessionId&&(Ie==null?void 0:Ie.variantId)===Dt.variantId)return;const De=Vfe({incomingSessionId:ke,previousSessionId:Pe,isIncomingSessionPreviewable:e.active&&Le.some(NI),selectedPastVariant:Ie,displayedLiveVariantId:t.get(av)??rn.current,pastVariants:ss});switch(rn.current=null,be(null),_(!1),b(null),M(),z(null),xt(!1),no.current=!1,De.kind){case"keep_selected":break;case"show_saved":lr(De.entry);break;case"clear":y(null),q(null);break;default:{const Pt=De;throw new Error(`Unhandled session preview: ${String(Pt)}`)}}if(!Oe)return}if(X||nn||!Pn||e.active!==!0||rn.current===Pn)return;const ae=Le.find(Oe=>Oe.workItemId===Pn);ae&&(rn.current=Pn,M(),Co(ae))},[ke,n,Dt,t,X,nn,Pn,e,Le,Co,M,ss,z,q,y,lr,b,_]),g.useEffect(()=>{!$||!is||(rn.current=null,q(null),z(is.workItemId))},[is,$,ke,z,q]),g.useEffect(()=>{!$||is||pr||q(null)},[is,$,pr,ke,q,vn]),g.useEffect(()=>{const U=j.trim().toLowerCase(),ae=[...Le.map(ut=>({kind:"active",variant:ut})),...vn.map(ut=>({kind:"past",entry:ut})),...Kr?[{kind:"original"}]:[]],Oe=U?ae.filter(ut=>zI(ut,U)):ae,{pinned:Pe,unpinned:Ie}=VI(UI($I(Oe,ke),li),rr,ke),De=[...Q.has(mS)?[]:Pe,...Ie.flatMap(ut=>ut.key!==""&&Q.has(ut.key)?[]:ut.rows)];return De.length===0?void 0:Nie(ut=>{if(sfe())return;if(ut.key==="Enter"){const Tt=Le.find(Oo=>Oo.workItemId===Pc);Tt&&(ut.preventDefault(),ro(Tt));return}if(ut.key!=="ArrowUp"&&ut.key!=="ArrowDown")return;ut.preventDefault();const gt=L??Pn;let Cr=gt?`live:${gt}`:null;X?Cr=`past:${X}`:il&&(Cr=zF);const ls=Cr?De.findIndex(Tt=>jf(Tt)===Cr):-1;let Es;if(ls===-1?Es=ut.key==="ArrowDown"?0:De.length-1:ut.key==="ArrowDown"?Es=Math.min(ls+1,De.length-1):Es=Math.max(ls-1,0),Es===ls)return;const Fs=De[Es];Fs.kind==="active"?ro(Fs.variant):Fs.kind==="past"?$s(Fs.entry):ol();const sn=document.querySelector(`[data-variant-key="${jf(Fs)}"]`);sn instanceof HTMLElement&&sn.focus({preventScroll:!0})})},[Le,vn,j,Kr,Q,rr,li,ke,L,X,il,Pn,Pc,ro,$s,ol]);const ge=Le.find(U=>U.workItemId===Pn)??null,Ee=X?vn.find(U=>`${U.sessionId}:${U.variantId}`===X)??null:null,Ze=!!Ee,mt=[...(e.active?Le:[]).map(U=>({kind:"active",variant:U})),...vn.map(U=>({kind:"past",entry:U})),...Kr?[{kind:"original"}]:[]],jt=j.trim().toLowerCase(),Qt=jt?mt.filter(U=>zI(U,jt)):mt,_t=UI($I(Qt,ke),li),{pinned:Fn,unpinned:it}=VI(_t,rr,ke);let $r=null;P&&($r=P.source==="live"?`live:${P.variantId}`:`past:${P.sessionId}:${P.variantId}`);const ll=new Set(Le.map(U=>U.requestId).filter(Boolean)),Io=s.filter(U=>!ll.has(U.requestId)),Er=Io.length>0,ga=o&&!Er&&mt.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[mt.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(Mae,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:j,onChange:U=>K(U.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[Er?S.jsx(she,{groups:Io}):null,ga?S.jsx(ihe,{}):null,e.active&&mt.length===0&&!Er&&!ga?S.jsx(ohe,{}):null,!e.active&&!Er&&!ga&&vn.length===0&&!Kr?S.jsx(ahe,{isMCPSession:h,mcpEditor:m}):null,mt.length>0&&Qt.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",j.trim(),"”."]}):null,Qt.length>0?S.jsx(ehe,{groups:it,pinned:Fn,pinnedKeys:Lr,draggedRowKey:$r,onDropPin:Ut,onDropUnpin:Ni,onTogglePin:kr,onReorder:rh,collapsedRuns:Q,onToggleRun:B,activeVariantId:L??Pn,activePastKey:X,isOriginalSelected:il,busy:D,editingKey:ma,onSelectActive:ro,onSelectPast:$s,onSelectOriginal:ol,onActivePointerDown:$n,onPastPointerDown:os,onHover:Tc,onRemove:U=>ui({kind:"active",variant:U}),onRemovePast:U=>ui({kind:"past",entry:U}),onStartRename:Bu,onCommitRename:sh,onCancelRename:ks,editingRunKey:Zu,onStartRunRename:Ao,onCommitRunRename:pe,onCancelRunRename:F,onRemoveRun:To,onCopyVariantContext:MF,activeSessionId:e.active?e.sessionId:null,projectPath:pt}):null]}),c&&Ze&&Ee?S.jsx(Mfe,{entry:Ee,deploying:kt===X,deployedUrl:X?Se[X]??null:null,onDeploy:al,isDeployDisabled:!d}):null,!Ze&&e.active?S.jsx(rhe,{selectedVariant:ge,busy:D,onDeploy:Cc,onDeployCanvas:Uu,canShare:c,canDeploy:d&&(ft==null?void 0:ft.kind)==="fresh",canDeployCanvas:d&&f&&(ft==null?void 0:ft.kind)==="fresh",canvasVariantCount:Qe.length,canvasDeployedUrl:Ct,deployedUrl:ge?we[ge.workItemId]??null:null}):null,S.jsx(Yfe,{target:fe,isConfirming:ue,onCancel:()=>ie(null),onConfirm:qr})]})},Gfe=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",Yfe=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=Gfe(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(sy,{open:!0,onOpenChange:c=>{!c&&!e&&n()},children:S.jsxs(iy,{children:[S.jsx(oy,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(ay,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(ly,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(cy,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},jf=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:zF,zI=(t,e)=>t.kind==="active"?Nw(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Nw(e,t.entry.label,t.entry.runLabel,t.entry.brief):Nw(e,qE,VF),KF=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,qF=(t,e)=>KF(jf(t),e),VI=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const c=[];for(const d of l.rows){const f=qF(d,n);r.has(f)?s.set(f,d):c.push(d)}c.length>0&&i.push(c.length===l.rows.length?l:{...l,rows:c})}return{pinned:e.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),unpinned:i}},HI=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.flatMap(o=>{const l=r.get(n(o));return l===void 0?[]:[{item:o,index:l}]}).sort((o,l)=>o.index-l.index).map(({item:o})=>o);return[...s,...i]},UI=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:HI(r.rows,s,jf)}});return HI(n,e.groups,r=>r.key)},Xfe=t=>t.length<=DI?t:`${t.slice(0,DI-1)}…`,Qfe=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,Jfe=t=>t.kind==="active"?t.variant.directionRef??null:t.kind==="past"?t.entry.directionRef??null:null,ehe=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:c,onToggleRun:d,activeVariantId:f,activePastKey:h,isOriginalSelected:m,busy:v,editingKey:y,onSelectActive:_,onSelectPast:b,onSelectOriginal:x,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:R,onRemovePast:O,onStartRename:I,onCommitRename:A,onCancelRename:M,editingRunKey:L,onStartRunRename:z,onCommitRunRename:$,onCancelRunRename:q,onRemoveRun:X,onCopyVariantContext:j,activeSessionId:K,projectPath:ee})=>{const H=g.useRef(null),{activeIndex:Q,itemRects:B,handlers:D,registerItem:G}=_F(H,{snapTolerancePx:5}),[fe,ie]=g.useState(0),[ue,he]=g.useState(!1),[we,le]=g.useState(!1),se=c.has(mS),be=r!==null,Se=g.useMemo(()=>{if(!r)return null;const Ae=KF(r,K);if(n.has(Ae))return{container:cp,key:Ae};const Ct=t.find(ke=>ke.rows.some($t=>jf($t)===r));return Ct?{container:Iw(Ct.key),key:r}:null},[r,n,t,K]),$e=(Se==null?void 0:Se.container)===cp,{dropTarget:kt,onPointerMove:tn,onPointerUp:nn}=xfe({containerRef:H,dragged:Se,yieldToSelector:$e?void 0:"[data-pinned-drop-zone]",restrictToSelector:$e?"[data-pinned-drop-zone]":void 0,onReorder:l}),xt=Q!==null?B[Q]:null,Dt=Ae=>Ae.kind==="active"?Ae.variant.workItemId===f:Ae.kind==="past"?`${Ae.entry.sessionId}:${Ae.entry.variantId}`===h:m,un=(Ae,Ct,ke,$t)=>{const ft=jf(Ae),pt=qF(Ae,K);return S.jsx(nhe,{rowKey:ft,row:Ae,index:Ct,isSelected:Dt(Ae),isEditing:y===ft,isPinned:n.has(pt),onTogglePin:tr=>o(pt,tr),reorderContainer:ke,reorderKey:ke===cp?pt:ft,isNested:$t,busy:v,registerItem:G,onSelectActive:_,onSelectPast:b,onSelectOriginal:x,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:R,onRemovePast:O,onStartRename:I,onCommitRename:A,onCancelRename:M,onCopyVariantContext:j,activeSessionId:K,projectPath:ee},ft)};let Kt=0;const Le=Ae=>{if(Ae.key==="")return Ae.rows.map(ft=>un(ft,Kt++,Iw(Ae.key),!1));const Ct=c.has(Ae.key),ke=Ct?null:Ae.rows.map(ft=>un(ft,Kt++,Iw(Ae.key),!0)),$t=Ae.label;return S.jsx(the,{label:$t??qE,collapsed:Ct,onToggle:()=>d(Ae.key),directionCount:Ae.rows.length,isEditing:$t!==null&&L===Ae.key,onStartRename:$t!==null?()=>z(Ae.key):void 0,onCommitRename:$t!==null?ft=>$(Ae,ft):void 0,onCancelRename:q,onRemove:$t!==null?()=>X(Ae):void 0,children:ke},Ae.key)},Qe=e.length>0||be;return S.jsxs("div",{ref:H,className:"relative",onMouseEnter:()=>{ie(Ae=>Ae+1),D.onMouseEnter()},onMouseMove:D.onMouseMove,onMouseLeave:D.onMouseLeave,onPointerMove:tn,onPointerUp:Ae=>{var Ct;if($e&&Se){const ke=(Ct=H.current)==null?void 0:Ct.querySelector("[data-pinned-drop-zone]"),$t=ke==null?void 0:ke.getBoundingClientRect();if(!($t!==void 0&&Ae.clientY>=$t.top&&Ae.clientY<=$t.bottom)){i(Se.key);return}}nn()},children:[Se&&kt?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:kt.top}}):null,S.jsx(Ei,{children:xt&&S.jsx(Nr.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:xt.top,left:xt.left,width:xt.width,height:xt.height},animate:{opacity:1,top:xt.top,left:xt.left,width:xt.width,height:xt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...pc.fast,opacity:{duration:.08}}},fe)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(Ei,{initial:!1,children:Qe?S.jsxs(Nr.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:pS,ease:hS},"data-pinned-drop-zone":"",className:mn("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",be&&"ring-content-muted/30 ring-1",be&&ue&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:be?()=>he(!0):void 0,onPointerLeave:be?()=>he(!1):void 0,onPointerUp:be?()=>{he(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d(mS),"aria-expanded":!se,"aria-label":`${se?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors duration-80 hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[S.jsx(Wx,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),S.jsx(Ei,{initial:!1,children:!se&&S.jsx(Nr.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:pS,ease:hS},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Ae=>un(Ae,Kt++,cp,!1))}):null},"body")})]},"pinned-section"):null}),Qe&&t.length>0?S.jsxs("li",{className:mn("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",$e&&"ring-content-muted/30 ring-1",$e&&we&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:$e?()=>le(!0):void 0,onPointerLeave:$e?()=>le(!1):void 0,onPointerUp:$e?()=>le(!1):void 0,children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[S.jsx($ae,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),S.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Ae=>Le(Ae))})]}):t.map(Ae=>Le(Ae))]})]})},GF=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=wF({onDismiss:()=>e(!1)});return S.jsxs(VE,{open:t,onOpenChange:e,children:[S.jsx(zu,{label:n,children:S.jsx(HE,{asChild:!0,children:S.jsx(ia,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:HF,children:S.jsx(Rae,{size:15,weight:"bold"})})})}),S.jsx(UE,{children:S.jsx(BE,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-popover shadow-surface-4 z-[60] min-w-[160px] rounded-lg p-1",children:r.map(o=>S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label,o.detail?S.jsx("span",{className:"text-content-muted ml-auto pl-3 font-mono",children:o.detail}):null]},o.key))})})]})},the=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:c,children:d})=>{const f=Ii(),[h,m]=g.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(h9,{size:13,weight:"bold"}),onSelect:i}]:[],...c?[{key:"remove",label:"Remove",icon:S.jsx(S9,{size:13,weight:"bold"}),onSelect:c}]:[]],y=e?S.jsx(Iae,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(Aae,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[y,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(YF,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(Ei,{initial:!1,children:!e&&S.jsx(Nr.ul,{className:"overflow-hidden",children:d},"body")})]}):S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[S.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){m(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors duration-80 hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[y,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&S.jsx("div",{className:mn("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",h&&"pointer-events-auto opacity-100"),children:S.jsx(GF,{open:h,onOpenChange:m,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(Ei,{initial:!1,children:!e&&S.jsx(Nr.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:pS,ease:hS},className:"overflow-hidden",children:d},"body")})]})},nhe=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:c,isNested:d,busy:f,registerItem:h,onSelectActive:m,onSelectPast:v,onSelectOriginal:y,onActivePointerDown:_,onPastPointerDown:b,onHover:x,onRemove:k,onRemovePast:C,onStartRename:P,onCommitRename:R,onCancelRename:O,onCopyVariantContext:I,activeSessionId:A,projectPath:M})=>{var se,be;const L=g.useRef(null);nfe(h,n,L);const[z,$]=g.useState(!1),q=e.kind==="active",X=e.kind==="original",j=e.kind==="active"?e.variant:null,K=e.kind==="past"?e.entry:null,ee=j?j.status==="succeeded":!0,H=j?dm(j):!0,Q=j!==null&&(j.status==="pending"||j.status==="running"),B=(j==null?void 0:j.status)==="failed",D=(j==null?void 0:j.status)==="cancelled",G=j!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===j.workItemId,fe=j!==null&&(((se=j.refinement)==null?void 0:se.status)==="pending"||((be=j.refinement)==null?void 0:be.status)==="running");let ie=qE;j?ie=j.label||`Direction ${n+1}`:K&&(ie=K.label.trim()||"Untitled direction");let ue=VF;j?ue=j.description:K&&(ue=K.brief);const he=ue?Xfe(ue):null,we=Jfe(e),le=we??Qfe(e,A);return s?S.jsx("li",{ref:L,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":c,className:"group relative z-10",children:S.jsx("div",{className:mn("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(YF,{initial:ie,onCommit:Se=>R(e,Se),onCancel:O}),he&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:he})]})})}):S.jsxs("li",{ref:L,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":c,className:mn("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:j?()=>x(j.workItemId):void 0,onMouseLeave:q?()=>x(null):void 0,children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":j==null?void 0:j.workItemId,"data-variant-key":t,onClick:Se=>{if(Se.metaKey||Se.ctrlKey){$(!0);return}const $e=window.getSelection();$e&&!$e.isCollapsed||(e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):y())},onKeyDown:Se=>{(Se.key==="Enter"||Se.key===" ")&&(Se.preventDefault(),Se.stopPropagation(),e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):y())},onPointerDown:Se=>{Se.metaKey||Se.ctrlKey||(e.kind==="active"?H&&_(e.variant.workItemId,Se):e.kind==="past"&&b(e.entry,Se))},"aria-pressed":r,"aria-disabled":q?!1:void 0,"aria-busy":Q||fe,className:mn("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",H&&"cursor-grab active:cursor-grabbing",!H&&"cursor-pointer"),style:H?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(Q||fe)&&S.jsx(KE,{className:"text-content-muted shrink-0 text-sm","data-testid":fe&&!Q?"variant-refining":void 0}),S.jsx(zu,{label:"Double-click to rename",disabled:X,children:S.jsx("span",{onDoubleClick:Se=>{Se.stopPropagation(),X||P(t)},className:mn("min-w-0 flex-1 truncate text-sm font-medium select-text",X?"cursor-default":"cursor-text",ee||r?"text-content":"text-content-muted"),children:ie})}),B&&S.jsx(zu,{label:(j==null?void 0:j.errorMessage)??(j==null?void 0:j.errorCode)??"Failed",disabled:!(j!=null&&j.errorMessage)&&!(j!=null&&j.errorCode),children:S.jsx("span",{className:"shrink-0",children:S.jsx(BI,{label:"Failed"})})}),D&&S.jsx(BI,{label:"Cancelled"})]}),he&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:he})]})}),X?null:S.jsx(Lle,{references:(j==null?void 0:j.references)??(K==null?void 0:K.references),source:q?"active":"history",sessionId:(K==null?void 0:K.sessionId)??A,variantId:(K==null?void 0:K.variantId)??(j==null?void 0:j.workItemId),projectPath:M,className:d?"pl-[33px]":"pl-3"}),S.jsxs("div",{className:mn("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",z&&"pointer-events-auto opacity-100"),children:[S.jsx(ia,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:Se=>Se.stopPropagation(),onKeyDown:Se=>{(Se.key!=="ArrowUp"&&Se.key!=="ArrowDown"||Se.altKey||Se.ctrlKey||Se.metaKey||Se.shiftKey)&&Se.stopPropagation()},onClick:Se=>{Se.stopPropagation(),o("button")},className:HF,children:S.jsx(Wx,{weight:i?"fill":"bold"})}),S.jsx(GF,{open:z,onOpenChange:$,triggerLabel:"Direction actions",actions:[...le?[{key:"copy-ref",label:"Copy ref",detail:le,icon:S.jsx(Oae,{size:13,weight:"bold"}),onSelect:()=>I({text:le,copyKind:we?"direction_ref":"reference"})}]:[],...!le&&ue?[{key:"copy",label:"Copy description",icon:S.jsx(sm,{size:13,weight:"bold"}),onSelect:()=>I({text:Ife({label:ie,description:ue}),copyKind:"description"})}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(Wx,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...X?[]:[{key:"rename",label:"Rename",icon:S.jsx(h9,{size:13,weight:"bold"}),onSelect:()=>P(t)},{key:"remove",label:"Remove",icon:S.jsx(S9,{size:13,weight:"bold"}),disabled:G,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},YF=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),o=g.useCallback(c=>{c&&(c.focus(),c.select())},[]),l=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),l(!0)):c.key==="Escape"&&(c.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},BI=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),rhe=({selectedVariant:t,busy:e,onDeploy:n,onDeployCanvas:r,canShare:s,canDeploy:i,canDeployCanvas:o,canvasVariantCount:l,canvasDeployedUrl:c,deployedUrl:d})=>{const f=t?ZF(t):!1,h=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),m=(e==null?void 0:e.kind)==="deploy-canvas",v=!i||!f||e!==null,y=o&&l>0,b=h?"Deploying…":d?"Copy link":"Share",k=m?"Sharing…":c?"Copy canvas link":"Share canvas";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),d?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsx("div",{className:"flex shrink-0 items-center gap-2",children:s?S.jsx(NF,{primaryLabel:b,primaryIcon:d&&!h?sm:void 0,primaryAction:()=>{t&&n(t)},isDisabled:v,isDropdownDisabled:e!==null,isLoading:h,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:y?[{label:k,icon:c&&!m?sm:void 0,onClick:r,isDisabled:e!==null}]:[]}):null})]})},XF=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(KE,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),she=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(XF,{},`${e.requestId}-${r}`)))}),ihe=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(XF,{},e))}),ohe=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),ZI="Try different ways to create a dropdown that feels fluid and dynamic",ahe=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=Afe(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(ZI).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",ZI,"”"]}),S.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(Tae,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(sm,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},lhe="Open Rivet",gS="Close Rivet",che=".",uhe=229,dhe=/Mac|iPhone|iPad|iPod/,fhe={ariaKeyShortcuts:"Meta+.",modifier:"metaKey"},hhe={ariaKeyShortcuts:"Control+.",modifier:"ctrlKey"},GE=()=>typeof navigator<"u"&&dhe.test(navigator.platform)?fhe:hhe,phe=t=>{const{modifier:e}=GE();return t.key===che&&!t.isComposing&&t.keyCode!==uhe&&t.metaKey===(e==="metaKey")&&t.ctrlKey===(e==="ctrlKey")&&!t.altKey&&!t.shiftKey},mhe="rivet:show-projects",ghe=t=>{const e=new URLSearchParams(t),n=e.get("libraryOrigin");if(e.get("library")!=="1"||!n)return null;try{const r=new URL(n);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.origin}catch{return null}},vhe=({onClose:t,libraryOrigin:e})=>{const n=Ii(),r=St(EF),s=St(dy),i=ghe(window.location.search),o=window.parent!==window&&i!==null,l=(s==null?void 0:s.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!t)return null;let c=r?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:r,children:r}):S.jsx("span",{});if(o||e){const f=S.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[S.jsx("li",{className:"shrink-0",children:S.jsx("button",{type:"button",onClick:async()=>{if(o&&i)window.parent.postMessage(mhe,i);else{try{const h=await Ft("/api/library/browser-launches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({view:"projects"})});if(!h.ok)throw new Error("The project library could not be opened.");const{url:m}=bJ.parse(await h.json());window.location.assign(m)}catch{on.error("Could not open the project library. Please try again.");return}n==null||n.capture("library_view_changed",{view:"projects"})}},className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),S.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:S.jsx(Cae,{className:"h-3 w-3"})}),S.jsx("li",{className:"min-w-0",children:S.jsx("span",{"aria-current":"page",title:l,className:"text-content block truncate font-medium",children:l})})]});c=S.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:f})}const d=GE();return S.jsxs("div",{className:"border-main-border bg-main-light z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[c,S.jsx(zu,{label:gS,side:"bottom",children:S.jsx("button",{onClick:t,"aria-label":gS,"aria-keyshortcuts":d.ariaKeyShortcuts,className:"text-content-subtle hover:bg-main-input hover:text-content flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 transition-colors duration-80",children:S.jsx(Nae,{className:"h-4 w-4",weight:"bold"})})})]})},yhe=ze({agentModeAvailable:Xs(),email:re().optional(),userId:re().optional(),name:re().optional(),isMCPSession:Xs(),mcpEditor:re().nullable(),agentApplyMode:Vt(["embedded","external"]).nullable().optional(),queueAccessToken:re().nullable().optional(),projectPath:re(),projectId:re().uuid().nullable().optional(),libraryOrigin:re().url().nullable()}),QF=async({signal:t})=>{const e=await Ft("/api/config",{signal:t});if(!e.ok)throw new Error(`Failed to fetch config: ${e.statusText}`);return yhe.parse(await e.json())},JF=5e3,_he=async({signal:t})=>{const e=await Ft("/api/account",{signal:t});if(!e.ok)throw new Error("Could not load your account.");return SJ.parse(await e.json())},whe=t=>({isAuthenticated:t.agentModeAvailable,name:t.name,email:t.email,userId:t.userId}),bhe=t=>la({queryKey:Js.account,queryFn:_he,enabled:t,refetchInterval:JF,retry:!1}),xhe=t=>la({queryKey:Js.rivetConfig,queryFn:QF,select:whe,enabled:t,refetchInterval:JF,retry:!1}),She=()=>{const t=window.location.pathname.startsWith("/rivet/library"),e=bhe(t),n=xhe(!t);return t?e:n},v1="rivet_just_signed_in",vS="https://rivet-proxy.onrender.com",khe=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},$w=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),WI=ai("useLogin"),Ehe=2e3,Che=60,KI="Connecting to Google...",Phe=`<!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>${KI}</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">${KI}</div>
198
- </body>
199
- </html>`,The=ze({success:Xs(),authUrl:re().optional(),sessionId:re().optional(),pollSecret:re().optional(),error:re().optional(),message:re().optional()}),Rhe=ze({success:Xs(),token:re().optional(),refreshToken:re().optional(),user:ze({id:re().optional(),email:re().optional()}).optional(),error:re().optional(),message:re().optional()}),Ahe="/api/auth/install-ref",Ihe=ze({installRef:re().nullable()}),Ohe=async()=>{try{const t=await fetch(Ahe);if(!t.ok)return;const e=Ihe.safeParse(await t.json());return e.success?e.data.installRef??void 0:void 0}catch{return}},ej=(t="editor_gate",e)=>{const n=Ii(),[r,s]=g.useState(!1),[i,o]=g.useState(null);return{startLogin:g.useCallback(async()=>{var m;const c=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=$w({outcome:"started",authAttemptId:c,entryPoint:t,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let h=null;try{if(h=window.open("","_blank"),!h)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{h.document.open(),h.document.write(Phe),h.document.close()}catch(x){WI.warn("Failed to render loading state in auth popup:",x)}const v=await Ohe(),y=await fetch(`${vS}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),_=The.safeParse(await y.json());if(!_.success)throw new Error("Invalid Google login response");const b=_.data;if(!y.ok||!b.success||!b.authUrl||!b.sessionId||!b.pollSecret)throw new Error(b.error||b.message||"Failed to start Google login");if(h.closed)throw new Error("Sign-in window was closed before Google login started.");h.location.href=b.authUrl;for(let x=0;x<Che;x+=1){if(h.closed)throw new Error("Sign-in window was closed before authentication completed.");const k=await fetch(`${vS}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b.sessionId,pollSecret:b.pollSecret})}),C=Rhe.safeParse(await k.json());if(!C.success)throw new Error("Invalid Google token response");const P=C.data;if(P.success&&P.token&&((m=P.user)!=null&&m.email)){const R={email:P.user.email,token:P.token,refreshToken:P.refreshToken,userId:P.user.id,...v?{installRef:v}:{}};if(e)await e(R);else if(!(await Ft("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error("Signed in, but failed to store session locally.");h.close(),window.sessionStorage.setItem(v1,"1");const O=$w({outcome:"completed",authAttemptId:c,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(O.event,O.properties),window.location.reload();return}if(P.error&&P.error!=="Pending")throw new Error(P.error||"Google login failed");await new Promise(R=>setTimeout(R,Ehe))}throw new Error("Authentication timed out. Please try again.")}catch(v){h&&!h.closed&&h.close();const y=Ys(v,"Failed to start login flow");WI.warn("Login failed:",y);const _=$w({outcome:"failed",authAttemptId:c,entryPoint:t,startedAt:d,now:Date.now(),failureReason:khe(y)});n==null||n.capture(_.event,_.properties),o(y),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},Mhe=ai("useIntegrations"),Nhe=ze({provider:re(),status:re(),externalUsername:re().nullable(),connectedAt:re()}),Lhe=ze({integrations:Rt(Nhe).optional()}),Dhe=ze({authUrl:re().min(1).optional(),error:re().optional()}),$he="rivet:connect-result",Fhe=t=>typeof t=="object"&&t!==null&&t.type===$he,jhe=gn(null),qI=async()=>{const t=await Ft("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return Lhe.parse(await t.json()).integrations??[]},zhe=async t=>{const e=await Ft(`/api/integrations/${t}`,{method:"DELETE"});if(!e.ok){const n=jN.safeParse(await e.json().catch(()=>({})));throw new Error(n.success&&n.data.error||`Could not disconnect ${t}`)}},Vhe=()=>{const t=Om(),[e,n]=QD(jhe),r=la({queryKey:Js.integrations,queryFn:qI,staleTime:1e4}),s=g.useCallback(async()=>(await t.invalidateQueries({queryKey:Js.integrations,refetchType:"none"}),t.fetchQuery({queryKey:Js.integrations,queryFn:qI})),[t]),i=g.useCallback(async c=>{const d=window.open("","_blank","width=560,height=720");if(!d)throw new Error("Popup blocked. Allow popups to connect.");n(c);try{const f=await Ft(`/api/integrations/${c}/connect`,{method:"POST"}),h=Dhe.safeParse(await f.json().catch(()=>({}))),m=h.success?h.data:{};if(!f.ok||!m.authUrl)throw d.close(),new Error(m.error||`Could not connect ${c}`);return d.location.href=m.authUrl,await new Promise(v=>{let y=!1,_=null;const b=async(k,C=!1)=>{if(!y){y=!0,window.removeEventListener("message",x),_&&clearInterval(_);try{const R=(await s()).some(O=>O.provider===c&&O.status==="connected");v(C&&R?"connected":k)}catch{v(k)}}},x=k=>{if(Fhe(k.data)&&k.data.provider===c){if(k.data.status==="error"){Mhe.warn(`Connect failed for ${c}:`,k.data.message),b("failed");return}b("connected")}};window.addEventListener("message",x),_=setInterval(()=>{d.closed&&b("closed",!0)},500)})}finally{n(null)}},[s,n]),{mutateAsync:o}=oL({mutationFn:zhe,onSuccess:s}),l=g.useCallback(async c=>{n(c);try{await o(c)}finally{n(null)}},[o,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:l,refetch:s}},Yc=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),Pu=re().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),tj=re().min(1).max(4096),YE=t=>{const e=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length!==1)throw e();let s;try{s=decodeURIComponent(r[0])}catch{throw e()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw e();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}},nj=re().max(2048).transform((t,e)=>{try{return YE(t).url}catch(n){return e.addIssue({code:PN.custom,message:Ys(n,"Invalid Cosmos profile URL")}),z5}}),rj=t=>{const e=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length<2||r.length>3||r[0]==="e")throw e();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw e()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw e();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},Hhe=re().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),Uhe=ze({id:Pu,title:re().min(1).max(500),url:re().url().transform(t=>rj(t).url),children:Rt(Pu)}),Bhe=ze({id:Pu,url:re().url(),title:re().max(1e3),text:re().max(1e5),author:re().nullable(),owner:re().nullable(),sourceUrl:re().url().nullable(),images:Rt(ze({url:Hhe,representation:Vt(["image","video-cover"])})).max(100),unsupportedReason:re().optional()}),Zhe=ze({collection:Uhe,elements:Rt(Bhe),total:Dn().int().nonnegative(),nextCursor:tj.nullable()});lQ("status",[Zhe.extend({status:Tf("ok")}),ze({status:Tf("error"),message:re(),reason:Vt(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:Dn().nonnegative().optional()})]);const sj=ze({id:Pu,username:re().min(1).max(100),title:re().max(500),url:re().transform(t=>YE(t).url)}),Whe=ze({id:Pu,title:re().min(1).max(500),description:re().max(1e4).nullable(),url:re().transform(t=>rj(t).url),total:Dn().int().nonnegative(),parentId:Pu.nullable(),children:Rt(Pu).max(1e4)});ze({profile:sj,collections:Rt(Whe),total:Dn().int().nonnegative(),nextCursor:tj.nullable()});const ij=Vt(["pinterest","arena","x"]),Khe=Vt(["cosmos","pinterest","arena","x"]),ef=re().min(1).max(200).regex(/^[a-zA-Z0-9:_-]+$/),oj={"www.cosmos.so":"cosmos","www.pinterest.com":"pinterest","www.are.na":"arena","x.com":"x"},qhe=re().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&!e.username&&!e.password&&!e.port&&!e.search&&!e.hash&&ij.safeParse(oj[e.hostname]).success&&/^\/[a-zA-Z0-9_-]+\/?$/.test(e.pathname)},"Use a canonical reference provider profile URL"),XE=ze({id:ef,username:re().min(1).max(100),title:re().max(500),url:Am([nj,qhe])}).transform(t=>oj[new URL(t.url).hostname]==="cosmos"?sj.parse(t):t),QE=ze({id:ef,title:re().min(1).max(500),description:re().max(1e4).nullable(),url:re().url().nullable(),total:Dn().int().nonnegative().nullable(),parentId:ef.nullable(),children:Rt(ef).max(1e4)});Am([ze({url:nj}).strict(),ze({provider:ij}).strict()]);const Ghe=ze({collections:Rt(QE),total:Dn().int().nonnegative().nullable(),nextCursor:re().min(1).max(4096).nullable()});Ghe.extend({profile:XE});const fm=1e3,Yhe=1e4,Xhe=ze({profile:XE,collections:Rt(QE).max(fm),total:Dn().int().nonnegative().max(fm)}),Qhe=Xhe.extend({id:re().uuid(),createdAt:re().datetime()}),Jhe=ze({collection:QE,collectionIds:Rt(ef).min(1).max(fm),references:Rt($N.extend({provider:Khe})).max(Yhe)}),epe=ze({discoveryId:re().uuid(),runtime:Im,sources:Rt(Jhe).min(1).max(fm),reusableCount:Dn().int().nonnegative()});epe.extend({id:re().uuid(),profile:XE,revision:re().regex(/^[a-f0-9]{64}$/),createdAt:re().datetime(),expiresAt:re().datetime(),approvedAt:re().datetime().nullable(),jobIds:Rt(re().uuid())});ze({discoveryId:re().uuid(),collectionIds:Rt(ef).min(1).max(fm),runtime:Im}).strict();ze({id:re().uuid(),revision:re().regex(/^[a-f0-9]{64}$/),isApproved:Tf(!0)}).strict();Vt(["later","dismiss","reset"]);const Hm=async(t,e,n="GET",r)=>{if(window.location.pathname.startsWith("/rivet/library"))return TJ(t,{schema:e,method:n,body:r});const s=await Ft(t.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},aj=()=>Hm("/profile",zN),tpe=t=>la({queryKey:Js.cosmosProfile,queryFn:aj,enabled:t}),npe=t=>Hm("/profile/discoveries",Qhe,"POST",{url:t}),rpe=({discoveryId:t,collectionIds:e,runtime:n})=>Hm("/profile/import-plans",VN,"POST",{discoveryId:t,collectionIds:e,runtime:n}),spe=t=>Hm("/profile",zN,"PATCH",{isEnabled:!0,runtime:t}),ipe=t=>Hm(`/profile/import-plans/${t.id}/imports`,VN,"POST",{revision:t.revision,isApproved:!0}),ope=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=g.useState(""),[i,o]=g.useState(null),[l,c]=g.useState([]),[d,f]=g.useState(""),[h,m]=g.useState(null),[v,y]=g.useState(null),[_,b]=g.useState(!1),x=g.useRef(0),k=Ii(),C=()=>{x.current+=1,s(""),o(null),c([]),f(""),m(null),y(null),b(!1)},P=()=>{k==null||k.capture("visual_editor_cosmos_modal_closed"),C(),e()},R=async M=>{M.preventDefault(),y(null);let L;try{L=YE(r.trim()).url}catch($){y(Ys($,"Invalid Cosmos profile URL"));return}k==null||k.capture("visual_editor_cosmos_discovery_started");const z=++x.current;b(!0);try{const $=await npe(L);if(z!==x.current)return;o($),c([]),k==null||k.capture("visual_editor_cosmos_discovery_completed",{collection_count:$.collections.length})}catch($){if(z!==x.current)return;y(Ys($,"Could not find Cosmos profile")),k==null||k.capture("visual_editor_cosmos_discovery_failed")}finally{z===x.current&&b(!1)}},O=async()=>{if(!i||l.length===0||!d)return;y(null),k==null||k.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const M=++x.current;b(!0);try{const L=await rpe({discoveryId:i.id,collectionIds:l,runtime:d});if(M!==x.current)return;m(L),k==null||k.capture("visual_editor_cosmos_plan_completed",{collection_count:L.collectionCount,reference_count:L.referenceCount})}catch(L){if(M!==x.current)return;y(Ys(L,"Could not prepare import plan")),k==null||k.capture("visual_editor_cosmos_plan_failed")}finally{M===x.current&&b(!1)}},I=async()=>{if(!h||!d)return;y(null),k==null||k.capture("visual_editor_cosmos_import_started",{collection_count:h.collectionCount,reference_count:h.referenceCount});const M=++x.current;b(!0);try{if((await aj()).profile.isEnabled||await spe(d),await ipe(h),k==null||k.capture("visual_editor_cosmos_import_completed",{reference_count:h.referenceCount}),n(),M!==x.current)return;C(),e()}catch(L){if(k==null||k.capture("visual_editor_cosmos_import_failed"),M!==x.current)return;y(Ys(L,"Could not start Cosmos import"))}finally{M===x.current&&b(!1)}},A=M=>{c(L=>L.includes(M)?L.filter(z=>z!==M):[...L,M]),k==null||k.capture("visual_editor_cosmos_collection_toggled")};return S.jsx(sy,{open:t,onOpenChange:M=>!M&&P(),children:S.jsxs(iy,{children:[S.jsx(oy,{className:"z-max fixed inset-0 bg-black/60"}),S.jsxs(ay,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg border shadow-2xl outline-none",children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(ly,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),S.jsx(ia,{onClick:P,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(hE,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"space-y-4 p-4",children:[S.jsx(cy,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:S.jsxs("form",{onSubmit:M=>void R(M),className:"space-y-4",children:[S.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),S.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:M=>s(M.target.value),placeholder:"https://www.cosmos.so/username",className:"border-main-border bg-main-input text-content placeholder:text-content-muted focus:border-secondary w-full rounded-md border px-3 py-2 text-sm outline-none"}),S.jsx("button",{type:"submit",disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Finding collections…":"Continue"})]}),i&&!h?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),S.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(M=>S.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[S.jsx("input",{type:"checkbox",checked:l.includes(M.id),disabled:_,onChange:()=>A(M.id)}),S.jsx("span",{className:"min-w-0 flex-1 truncate",children:M.title}),S.jsx("span",{className:"text-content-muted text-xs",children:M.total??"—"})]},M.id))}),i.collections.length===0?S.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,S.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",S.jsxs("select",{value:d,disabled:_,onChange:M=>{const L=M.target.value;f(L),k==null||k.capture("visual_editor_cosmos_runtime_selected",{runtime:L})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[S.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),S.jsx("option",{value:"codex",children:"Codex"}),S.jsx("option",{value:"claude",children:"Claude"}),S.jsx("option",{value:"cursor",children:"Cursor"})]})]}),S.jsx("button",{type:"button",onClick:()=>void O(),disabled:_||l.length===0||!d,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Preparing plan…":"Review import plan"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_profile_changed"),C()},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,h?S.jsxs("div",{className:"space-y-4 text-sm",children:[S.jsxs("p",{className:"text-content",children:[h.collectionCount," ",h.collectionCount===1?"collection":"collections"," ·"," ",h.referenceCount," ",h.referenceCount===1?"reference":"references"," ·"," ",h.imageCount," ",h.imageCount===1?"image":"images"]}),S.jsx("p",{className:"text-content-subtle",children:h.scopeDisclosure}),S.jsx("p",{className:"text-content-subtle",children:h.usageDisclosure}),S.jsxs("p",{className:"text-content-muted text-xs",children:[h.reusableCount," reusable · ",h.unsupportedCount," ","unsupported · runtime: ",d]}),S.jsx("button",{type:"button",onClick:()=>void I(),disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Starting import…":"Approve and import"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_plan_revised"),m(null)},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?S.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},GI=ai("ConnectorsModal"),ape=[{provider:"x",name:"X",iconClassName:"text-content",icon:S.jsx(Ap,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:S.jsx(Ap,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:S.jsx(Ap,{provider:"arena"})}],lpe={name:"Cosmos",iconClassName:"text-content",icon:S.jsx(Ap,{provider:"cosmos"})},YI=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>S.jsxs("li",{className:`flex min-h-[64px] items-center gap-3 py-3 ${i?"ring-secondary -mx-2 rounded-md px-2 ring-2":""}`,children:[S.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),S.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),S.jsx("button",{type:"button","aria-label":n,onClick:o,disabled:s,className:"active-push bg-main-input text-content hover:bg-main-input/80 inline-flex min-h-8 w-24 flex-none items-center justify-center rounded-md px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:r})]}),yS=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var O;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:c,disconnect:d}=Vhe(),f=Ii(),[h,m]=g.useState(null),[v,y]=g.useState(!1),_=tpe(t),b=I=>s.find(A=>A.provider===I),x=g.useCallback(I=>{const A=Date.now(),M=Yc({action:"connect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(M.event,M.properties),c(I).then(L=>{const z=Date.now()-A;if(L==="connected"){const q=Yc({action:"connect",outcome:"completed",provider:I,entryPoint:n,durationMs:z});f==null||f.capture(q.event,q.properties);return}const $=Yc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:z,failureReason:L==="closed"?"popup_closed":"provider_failed"});f==null||f.capture($.event,$.properties)}).catch(L=>{const z=Ys(L,"Could not connect."),$=Yc({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-A,failureReason:z.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture($.event,$.properties),GI.warn(`Connect error for ${I}:`,z),on.error(z)})},[c,n,f]),k=g.useCallback(I=>{const A=Date.now(),M=Yc({action:"disconnect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(M.event,M.properties),d(I).then(()=>{const L=Yc({action:"disconnect",outcome:"completed",provider:I,entryPoint:n,durationMs:Date.now()-A});f==null||f.capture(L.event,L.properties)}).catch(L=>{const z=Ys(L,"Could not disconnect."),$=Yc({action:"disconnect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-A,failureReason:"request_failed"});f==null||f.capture($.event,$.properties),GI.warn(`Disconnect error for ${I}:`,z),on.error(z)})},[n,d,f]),C=n==="onboarding",P=(O=_.data)==null?void 0:O.sources.some(I=>I.provider==="cosmos");let R=P?"Connected":"Not connected";return _.isError&&(R="Status unavailable"),_.isPending&&(R="Checking status…"),S.jsxs(S.Fragment,{children:[S.jsx(sy,{open:t,onOpenChange:I=>!I&&e(),children:S.jsxs(iy,{children:[S.jsx(oy,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(ay,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(eF,{value:h,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(ly,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(ia,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(hE,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(cy,{className:"text-content-subtle text-sm",children:"Connect your references to add them to your Rivet library. Rivet can use them to inspire new design directions."}),o?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,S.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[ape.map(I=>{const A=b(I.provider),M=(A==null?void 0:A.status)==="connected",L=A==null?void 0:A.externalUsername;let z=M?`Connected${L?` as @${L}`:""}`:"Not connected";i&&(z="Checking status…");const $=l===I.provider,q=M?"Disconnect":"Connect";return S.jsx(YI,{meta:I,status:z,actionLabel:`${q} ${I.name}`,buttonLabel:$?`${q}ing…`:q,isDisabled:i||$,isHighlighted:r===I.provider,onAction:()=>M?k(I.provider):x(I.provider)},I.provider)}),S.jsx(YI,{meta:lpe,status:R,actionLabel:P?"Add Cosmos profile":"Connect Cosmos",buttonLabel:P?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),y(!0)}})]}),C?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})}),S.jsx(ope,{isOpen:v,onClose:()=>y(!1),onImported:()=>{_.refetch()}})]})},XI=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),cpe=ai("SupportTicketModal"),QI=5e3,Fw="feedback",upe=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},dpe=async t=>{let e;try{const n=_J.safeParse(await t.json());e=n.success?n.data:void 0}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=upe(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},fpe=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Ii(),[s,i]=g.useState(""),[o,l]=g.useState(!1),[c,d]=g.useState(null),f=g.useCallback(()=>{i("")},[]),h=g.useCallback(()=>{o||(f(),e())},[o,e,f]),m=g.useCallback(async()=>{const b=s.trim();if(!(!b||o)){l(!0);try{const x=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,k=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,C=n==null?void 0:n.trim(),P=await Ft("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:Fw,message:b,contactEmail:C||void 0,metadata:{posthogSessionId:x??void 0,posthogDistinctId:k??void 0,appVersion:"0.28.0",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!P.ok){const R=await dpe(P);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:Fw,has_posthog_session_id:!!x}),on.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(x){const k=Ys(x,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:Fw,error:k}),cpe.error("Failed to submit support ticket:",k),on.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),v=g.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),m())},[m]),y=QI-s.length,_=o||s.trim().length===0;return S.jsx(sy,{open:t,onOpenChange:b=>!b&&h(),children:S.jsxs(iy,{children:[S.jsx(oy,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(ay,{ref:d,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(eF,{value:c,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(ly,{className:"text-content text-base font-medium",children:"Send feedback"}),S.jsx(ia,{onClick:h,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(hE,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(cy,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:b=>i(b.target.value),onKeyDown:v,maxLength:QI,rows:6,disabled:o,placeholder:"What happened?",className:"text-content placeholder-content-subtle max-h-64 w-full resize-none overflow-y-auto bg-transparent pt-3 pr-3 pb-1 pl-3 text-sm focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[S.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[y<=500&&S.jsx("span",{className:"text-content-subtle text-xs",children:y}),S.jsx(ia,{onClick:m,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",variant:"primary",size:"icon-compact",children:o?S.jsx(q1,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(kae,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},hpe=ai("ProfileAvatar"),lj=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},ppe=(t,e)=>lj(t,e).charAt(0).toUpperCase(),mpe=({className:t="",side:e="bottom",align:n="end"})=>{var q,X,j;const r=She(),s=((q=r.data)==null?void 0:q.name)??null,i=((X=r.data)==null?void 0:X.email)??null,o=((j=r.data)==null?void 0:j.isAuthenticated)===!0,l=Ii(),{startLogin:c,isStartingLogin:d,loginError:f}=ej("account_menu"),[h,m]=g.useState(!1),[v,y]=g.useState(!1),[_,b]=g.useState(!1),[x,k]=g.useState(!1),{containerRef:C,onKeyDown:P,onCloseAutoFocus:R}=wF({onDismiss:()=>$(!1)}),O=ppe(s,i);if(r.isPending)return S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(XI,{className:"h-8 w-8 rounded-full"}),S.jsx(XI,{className:"h-3.5 w-16"})]});const I=lj(s,i),A=(s==null?void 0:s.trim())||null,M=(i==null?void 0:i.trim())||null,L=async()=>{k(!0);try{const K=await Ft("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!K.ok)throw new Error(`Logout failed: ${K.status}`);window.location.pathname.startsWith("/rivet/library")&&BN()}catch(K){hpe.warn("Logout request failed",K),on.error("Could not log out. Please try again."),k(!1);return}window.location.reload()};let z="Log in";o&&(z=I||"Account"),r.error&&!r.data&&(z="Account unavailable");const $=K=>{m(K),l==null||l.capture(`visual_editor_account_menu_${K?"opened":"closed"}`,{is_authenticated:o})};return S.jsxs(S.Fragment,{children:[S.jsxs(VE,{open:h,onOpenChange:$,children:[S.jsx(HE,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account","data-rivet-private":!0,className:`ph-no-capture text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[S.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:O||S.jsx(Fae,{className:"h-4 w-4",weight:"bold"})}),S.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:z})]})}),S.jsx(UE,{children:S.jsxs(BE,{"data-rivet-private":!0,ref:C,onKeyDown:P,onCloseAutoFocus:R,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[A||M?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[A?S.jsx("div",{className:"text-content truncate text-sm font-medium",children:A}):null,M?S.jsx("div",{className:"text-content-muted truncate text-xs",children:M}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),y(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(b9,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),b(!0)},className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none",children:[S.jsx(Pae,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:L,disabled:x,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(Dae,{className:"h-4 w-4",weight:"bold"}),x?"Logging out…":"Log out"]}):null,!o&&!r.error?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c()},disabled:d,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm focus:outline-none disabled:opacity-50",children:[S.jsx(Lae,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?S.jsx("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{r.refetch()},className:"text-content mt-1 px-3 py-1.5 text-sm",children:"Retry account"}):null,f?S.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?S.jsx(yS,{isOpen:!0,onClose:()=>y(!1)}):null,S.jsx(fpe,{isOpen:_,onClose:()=>b(!1),contactEmail:i??void 0})]})},gpe=({onClose:t,libraryOrigin:e})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(vhe,{onClose:t,libraryOrigin:e}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(qfe,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:S.jsx(mpe,{side:"top",align:"start"})})]}),JI=ai("useServerConfig"),hm=[250,500,1e3,2e3,4e3],vpe=hm.length+1,ype=async()=>{var n;const t=await Ft("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},_pe=(t,e)=>t<hm.length?(JI.warn(`Server config fetch failed (attempt ${t+1}); retrying in ${hm[t]}ms`,e),!0):(JI.warn("Error fetching server config:",e),Xe==null||Xe.capture("preview_config_load_failed",{message:Ys(e,"unknown_error"),attempts:vpe}),!1),wpe=t=>hm[Math.min(t,hm.length-1)],bpe=()=>{const t=la({queryKey:Js.serverConfig,queryFn:ype,retry:_pe,retryDelay:wpe,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),e=t.isFetching&&!t.data,{refetch:n}=t;return{config:t.data??null,isLoading:e,error:t.error&&!e?t.error.message:null,retry:()=>{n()}}},xpe="#1C1C20",Ra=[118,118,124],eO=.85,Spe=3,kpe=.15,Tg=36,Epe=4.4,Cpe=.7,Ppe=3.5,Tpe=.8,tO=9,Rpe=11,Ape=[1.35,1.12,.95,.85],Ipe=[0,1.1,2.3,3.1],Ope=[0,.35,.16,.13],Mpe=[.9,.5,.4,.35],Xc=3,jw=[[{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}]],Rg=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},cv=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Qc=(t,e)=>(Math.round(t/e-.5)+.5)*e,Npe=Math.sin(Math.PI/3),nO=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*Npe;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},Lpe=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-tO}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-tO}return cv(.5-r/(2*Rpe))},cj=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=Nt(CF),r=g.useRef(null),s=g.useCallback(i=>{var L;if((L=r.current)==null||L.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(z=>z+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],d=0,f=0,h=Tg,m=Tg,v=null,y=null,_=0,b=-1;const x=new Array(33),k=z=>{const $=Math.round(z*32);let q=x[$];if(!q){const X=$/32,j=Math.round(Ra[0]+(255-Ra[0])*X),K=Math.round(Ra[1]+(255-Ra[1])*X),ee=Math.round(Ra[2]+(255-Ra[2])*X);q=`rgba(${j}, ${K}, ${ee}, ${eO})`,x[$]=q}return q},C=z=>{const $=1-.35*z,q=Math.round(Ra[0]*$),X=Math.round(Ra[1]*$),j=Math.round(Ra[2]*$);return`rgba(${q}, ${X}, ${j}, ${eO})`},P=z=>{let $=Math.floor(Math.random()*jw.length);$===b&&($=($+1)%jw.length),b=$;const q=[0,0,0,0],X=jw[$].map((D,G)=>{const fe=D.level,ie=q[fe]++,ue=Ipe[fe]+ie*Ope[fe],he=Mpe[fe]+Rg($*131+G*17+5)*.2;if(D.hline){const se=Qc((D.y??0)*f,m);return{hline:!0,x1:Qc(D.x1*d,h),x2:Qc(D.x2*d,h),y1:se,y2:se,level:fe,start:ue,dur:he}}const we=Qc(D.x1*d,h),le=Qc((D.y1??0)*f,m);return{hline:!1,x1:we,y1:le,x2:Math.max(Qc(D.x2*d,h),we+h),y2:Math.max(Qc((D.y2??0)*f,m),le+m),level:fe,start:ue,dur:he}}),j=X.reduce((D,G)=>Math.max(D,G.start+G.dur),0),K=c.length,ee=new Float32Array(K*Xc),H=new Int16Array(K*Xc).fill(-1),Q=new Uint8Array(K),B=X[0];for(let D=0;D<K;D++){const G=c[D];G.x>B.x1&&G.x<B.x2&&G.y>B.y1&&G.y<B.y2&&(Q[D]=1);const fe=D*Xc;for(let ie=0;ie<X.length;ie++){const ue=Lpe(G.x,G.y,X[ie]);if(ue<=.02)continue;let he=fe;for(let we=fe;we<fe+Xc;we++){if(H[we]===-1){he=we;break}ee[we]<ee[he]&&(he=we)}(H[he]===-1||ue>ee[he])&&(ee[he]=ue,H[he]=ie)}}return{startT:z,buildEnd:j,els:X,frame:B,cellQ:ee,cellEl:H,inFrame:Q}},R=()=>{const z=i.getBoundingClientRect();d=Math.max(1,z.width),f=Math.max(1,z.height);const $=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*$),i.height=Math.round(f*$),o.setTransform($,0,0,$,0,0);const q=Math.max(8,Math.round(d/Tg)),X=Math.max(6,Math.round(f/Tg));h=d/q,m=f/X,c=[];for(let j=0;j<X;j++){const K=X>1?j/(X-1):.5,ee=Epe*(1+Cpe*.4*(K*2-1));for(let H=0;H<q;H++){const Q=j*8191+H*131+1,B={x:(H+.5)*h,y:(j+.5)*m,size:ee,seed:Q,phase:Rg(Q),kind:0};B.kind=Math.floor(Rg(Q*97)*3),c.push(B)}}y=null,v=null},O=new Float32Array(32),I=z=>{o.fillStyle=xpe,o.fillRect(0,0,d,f),v||(v=P(z+.2)),z>=v.startT+v.buildEnd+Ppe&&(y=v,_=z,v=P(z+.2));let $=0;y&&($=1-cv((z-_)/Tpe),$<=0&&(y=null));const q=v;for(let B=0;B<q.els.length;B++){const D=q.els[B];O[B]=cv(Math.min(1,Math.max(0,(z-q.startT-D.start)/D.dur)))}const X=O[0],j=C(0),K=C(X),ee=$>0?C($):j,H=$>0?C(Math.max(X,$)):K,Q=c.length;for(let B=0;B<Q;B++){const D=c[B];let G=0,fe=0;const ie=B*Xc;for(let Se=ie;Se<ie+Xc;Se++){const $e=q.cellEl[Se];if($e<0)break;const kt=q.cellQ[Se]*O[$e];kt>G&&(G=kt,fe=q.els[$e].level)}if(y)for(let Se=ie;Se<ie+Xc;Se++){const $e=y.cellEl[Se];if($e<0)break;const kt=y.cellQ[Se]*$;kt>G&&(G=kt,fe=y.els[$e].level)}const ue=z/Spe+D.phase,he=Math.floor(ue),we=ue-he,le=cv(Math.min(we,1-we)/kpe),se=Math.floor(Rg(D.seed*97+he*7919)*3);se!==D.kind&&G<.02&&le<.05&&(D.kind=se);const be=Math.max(le*(1-G),G);if(!(be<.01))if(G<.02){const Se=q.inFrame[B]===1,$e=y?y.inFrame[B]===1:!1;Se?o.fillStyle=$e?H:K:o.fillStyle=$e?ee:j;const kt=Math.max(Se?X:0,$e?$:0);nO(o,D.kind,D.x,D.y,D.size*be*(1-.2*kt))}else{o.fillStyle=k(G);const Se=1+(Ape[fe]-1)*G;nO(o,D.kind,D.x,D.y,D.size*be*Se)}}};R();let A=0;if(l)v=P(-100),I(0);else{const z=performance.now(),$=q=>{I((q-z)/1e3),A=requestAnimationFrame($)};A=requestAnimationFrame($)}const M=new ResizeObserver(()=>{R(),l&&(v=P(-100),I(0))});M.observe(i),r.current=()=>{cancelAnimationFrame(A),M.disconnect(),e&&n(z=>z-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},Dpe=[["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"]],$pe=t=>{var n;const e=[];for(const[r,s]of Dpe){const i=(n=t[s])==null?void 0:n.trim();i&&e.push(`${r}: ${i}`)}return e.join(`
200
- `)},rO={kind:"base"};function sO(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}const Fpe=async(t=null)=>{if(t)return jpe(t);let e;try{e=await Ft("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return Ag();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Ag()}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}:Ag()},uj=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},jpe=t=>uj(t),Ag=()=>uj("/"),zw=ai("usePreviewUpstreamHealth"),zpe=500,Vpe=4e3,Hpe=15e3,Upe=3,Bpe={completedProbeCount:0,isUpstreamReady:!1,unavailableReason:"upstream_unreachable",isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!1,hasCapturedUnreachable:!1,downSince:null,everReady:!1,consecutiveServerErrors:0,hasFiredPersistentErrorHook:!1,lastUpstreamStatus:null},Zpe=({history:t,outcome:e,now:n,startedAt:r,firstUnreachableCaptureAfterMs:s})=>{const i=[],{upstreamStatus:o}=e,l=e.isOk&&o!==null&&o>=500;let c=t.consecutiveServerErrors;l&&t.everReady?c+=1:e.isOk&&!l&&(c=0);const d=c>=Upe;let f=t.hasFiredPersistentErrorHook;d&&!f&&o!==null&&(f=!0,i.push({kind:"persistent_server_errors",upstreamStatus:o,consecutiveCount:c}));const h={...t,completedProbeCount:t.completedProbeCount+1,lastUpstreamStatus:o,consecutiveServerErrors:c,hasFiredPersistentErrorHook:f};if(e.isOk&&!d)return t.hasCapturedFirstReady?t.isUpstreamReady||i.push({kind:"restored"}):i.push({kind:"first_ready",readyAfterMs:n-r}),{history:{...h,everReady:h.everReady||!l,hasFiredPersistentErrorHook:h.hasFiredPersistentErrorHook&&l,isUpstreamReady:!0,unavailableReason:null,downSince:null,hasCapturedUnreachable:!1,isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!0},events:i};const m=t.downSince===null,v=t.downSince??n;let y=m?!1:t.hasCapturedUnreachable,_=m?!1:t.isFirstUnreachableWindowExceeded;t.isUpstreamReady&&i.push({kind:"lost",upstreamStatus:o});const b=n-v;return b>=s&&!y&&(y=!0,_=!0,i.push({kind:"first_unreachable",elapsedMs:b,upstreamStatus:o})),{history:{...h,isUpstreamReady:!1,unavailableReason:e.unavailableReason,downSince:v,hasCapturedUnreachable:y,isFirstUnreachableWindowExceeded:_},events:i}},iO=(t,e)=>({id:e,identity:t,startedAt:Date.now()}),Wpe=(t,e={})=>{const n=g.useId(),r=e.probeMsWhileDown??zpe,s=e.probeMsWhileUp??Vpe,i=e.firstUnreachableCaptureAfterMs??Hpe,o=e.probePath??null,l=e.skip??!1,c=t!=="static"&&!l,d=um(e.onPersistentUpstreamServerErrors),f=c?JSON.stringify([t,o,r,s,i]):null,[h,m]=g.useState(()=>iO(f,0)),v=h.identity===f?h:iO(f,h.id+1);v!==h&&m(v);const[y,_]=g.useState(0),b=g.useRef(null),x=P=>{var R;switch(P.kind){case"persistent_server_errors":Xe==null||Xe.capture("preview_upstream_error_responses",{framework:t,upstream_status:P.upstreamStatus,consecutive_count:P.consecutiveCount}),zw.warn(`Preview upstream is listening but has served ${P.consecutiveCount} consecutive ${P.upstreamStatus} responses`),(R=d.current)==null||R.call(d,{upstreamStatus:P.upstreamStatus,consecutiveCount:P.consecutiveCount});return;case"first_ready":Xe==null||Xe.capture("preview_dev_server_ready",{framework:t,ready_after_ms:P.readyAfterMs});return;case"restored":Xe==null||Xe.capture("preview_upstream_restored",{framework:t});return;case"lost":Xe==null||Xe.capture("preview_upstream_lost",{framework:t,upstream_status:P.upstreamStatus}),_(O=>O+1),zw.warn("Preview upstream became unavailable after it was ready");return;case"first_unreachable":Xe==null||Xe.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:P.elapsedMs,upstream_status:P.upstreamStatus}),zw.warn("Dev server did not become ready within timeout window");return;default:{const O=P;throw new Error(`Unhandled probe event: ${String(O)}`)}}},k=la({queryKey:Js.previewUpstreamHealth({instanceId:n,sessionId:v.id,rerunVersion:e.rerunProbeImmediatelyOnVersion??null}),queryFn:async({signal:P})=>{var M;const R=await Fpe(o),O=((M=b.current)==null?void 0:M.sessionId)===v.id?b.current.history:Bpe;if(P.aborted)return O;const{history:I,events:A}=Zpe({history:O,outcome:R,now:Date.now(),startedAt:v.startedAt,firstUnreachableCaptureAfterMs:i});return b.current={sessionId:v.id,history:I},A.forEach(x),I},enabled:c,placeholderData:(P,R)=>(R==null?void 0:R.queryKey[1].sessionId)===v.id?P:void 0,refetchInterval:P=>{var R;return(R=P.state.data)!=null&&R.isUpstreamReady?s:r},refetchIntervalInBackground:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,gcTime:0,networkMode:"always"});if(t==="static")return{isUpstreamReady:!0,iframeRemountKey:y,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:null};if(l)return{isUpstreamReady:!1,iframeRemountKey:y,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:"upstream_unreachable"};const C=k.data;return{isUpstreamReady:(C==null?void 0:C.isUpstreamReady)??!1,iframeRemountKey:y,probeStartedAt:v.startedAt,probeAttemptCount:((C==null?void 0:C.completedProbeCount)??0)+(k.isFetching?1:0),isFirstUnreachableWindowExceeded:(C==null?void 0:C.isFirstUnreachableWindowExceeded)??!1,initialProbeComplete:C!==void 0,unavailableReason:C?C.unavailableReason:"upstream_unreachable"}};function Kpe(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const dj=t=>{var r;if(typeof window>"u")return"";const e=(r=window.__RIVET_BOOTSTRAP__)==null?void 0:r.previewOrigin;if(e)return e;const n=new URL(window.location.origin);return n.hostname="localhost",n.origin},_S=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${dj()}${e}`:e,qpe="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Gpe=t=>qpe,Ype=ai("PreviewSurface"),qh=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",wS=({target:t,src:e,framework:n,remountKey:r,isActive:s=!0})=>{St(hy);const i=Ii(),o=g.useRef(!1),l=g.useRef(s),c=g.useCallback(f=>{t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:qh(e,t),framework:n,isReused:f}))},[n,i,e,t]),d=g.useCallback(f=>{f&&(s&&!l.current&&o.current&&c(!0),l.current=s)},[c,s]);return S.jsx("div",{ref:d,className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:Gpe(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src_kind:qh(e,t)}),s&&c(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src_kind:qh(e,t)}),s&&t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:qh(e,t),framework:n})),Ype.warn("Preview iframe failed to load",{framework:n,src_kind:qh(e,t)})}},r)})},Xpe=7,Qpe=t=>{const e=sO(t.target),n=`${e}:${t.src}`,r=t.src==="about:blank",[s,i]=g.useState(()=>({selectedKey:n,remountKey:t.remountKey,selection:0,frames:r?[]:[{key:n,props:t,lastSelected:0}]}));if(s.selectedKey!==n||s.remountKey!==t.remountKey){const o=s.selection+1,l=s.remountKey!==t.remountKey;let c=s.frames.filter(d=>!l||sO(d.props.target)!==e);if(!r){const d=c.find(f=>f.key===n);if(d?c=c.map(f=>f===d?{...f,lastSelected:o}:f):c=[...c,{key:n,props:t,lastSelected:o}],c.length>Xpe){const f=c.reduce((h,m)=>m.lastSelected<h.lastSelected?m:h);c=c.filter(h=>h!==f)}}i({selectedKey:n,remountKey:t.remountKey,selection:o,frames:c})}return S.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const l=!r&&o.key===n;return S.jsx("div",{className:"absolute inset-0",style:{visibility:l?"visible":"hidden",pointerEvents:l?"auto":"none"},"aria-hidden":!l,children:S.jsx(wS,{...o.props,isActive:l})},`${o.key}:${o.props.remountKey??""}`)}),r?S.jsx(wS,{...t}):null]})},Jpe=g.lazy(()=>t4(()=>Promise.resolve().then(()=>D0e),void 0)),eme={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},tme={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},nme={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},Tu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:c,state:d,role:f="status",busy:h=!1,className:m=""})=>{const v=g.useCallback(_=>{_&&d&&(Xe==null||Xe.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),y=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${eme[o]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":h||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,y?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:tme[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:nme[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},bS=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Tu,{...r,size:n,busy:!0,backdrop:S.jsx(cj,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Tu,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(Jpe,{className:"absolute inset-0"})})}):S.jsx(Tu,{...r,size:n,busy:!0,media:S.jsx(q1,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),fj=({icon:t,...e})=>S.jsx(Tu,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),JE=t=>S.jsx(Tu,{...t,tone:"error",role:"alert"}),oO="/static/",rme=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(oO)}catch{return t.endsWith(oO)}},aO="The direction is saved, but Rivet couldn’t prepare its preview.",sme={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:aO},unknown:{summary:aO}},ime=t=>t.nextStep?`${t.summary} ${t.nextStep}`:t.summary,ome=t=>({label:"Copy for agent",onClick:()=>void MF({text:t,copyKind:"failure_report"})}),ame=(t,e)=>{if(t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE")return{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED")return{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed")return{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="cancelled")return{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1};if(t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"){const n=t.previewUnavailable,r=n.portInUse?"The preview port was already in use.":void 0,s=sme[n.reason],i="Rivet couldn’t preview this direction";return{state:"preview_unavailable",title:i,description:ime(s),detail:n.detail??r,isError:!0,agentPastePackage:$pe({problem:`${i}. ${s.summary}`,reasonCode:n.reasonCode,reasonDetail:n.reasonDetail,nextStep:s.nextStep,rivetVersion:"0.28.0",nodeVersion:n.nodeVersion,directionLabel:t.label,directionRef:t.directionRef,sessionId:e})}}return null},lme=({issue:t,retryTarget:e})=>{const n=Ii(),r=g.useRef(!1),[s,i]=g.useState(!1),[o,l]=g.useState(null),c=async()=>{if(!(!e||r.current)){r.current=!0,i(!0),l(null),n==null||n.capture("preview_retry_clicked",{session_id:e.sessionId,variant_id:e.variantId});try{const f=await Ft(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!f.ok){const h=yJ.safeParse(await f.json().catch(()=>({})));throw new Error(h.success?h.data.message:"The preview could not restart. Try again.")}}catch(f){l(Ys(f,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}},d=[...e&&!s?[{label:"Retry preview",onClick:()=>void c()}]:[],...t.agentPastePackage?[ome(t.agentPastePackage)]:[]];return S.jsxs(Tu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,busy:s,actions:d,children:[s?S.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?S.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?S.jsx("p",{"data-rivet-private":!0,className:"ph-no-capture text-content-subtle max-h-40 overflow-auto text-xs leading-relaxed break-words whitespace-pre-wrap",children:t.detail}):null]})},cme=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var Kt;const r=St(dy),s=St(cS),i=Nt(cS),o=St(m1),l=Nt(m1),c=St(Vm),d=St(hy),f=St(uS),h=St(dS),m=St(PF),v=St(TF),y=Nt(dS),_=St(mc),b=St(lv),x=Nt(uS),k=c.active&&c.projectContext.kind==="fresh",C=St(av),P=c.active?c.variants.find(Le=>Le.workItemId===C&&(Le.status==="pending"||Le.status==="running"||Le.status==="succeeded"&&!Le.preview&&typeof Le.port!="number"&&(!Le.previewUnavailable||Le.previewUnavailable.reason==="idle_timeout")))??null:null,R=c.active&&c.variants.some(Le=>Le.status==="pending"||Le.status==="running"),O=k||R,I=c.active?c.variants.find(Le=>Le.workItemId===C)??null:null,A=c.active&&I?ame(I,c.sessionId):null,M=e==="static"&&o!==null&&rme(o);g.useEffect(()=>{c.active||x(!1)},[c.active,x]);const L=g.useRef(!1);g.useEffect(()=>{const Le=!!(_!=null&&_.left||_!=null&&_.right),Qe=Le&&!L.current;L.current=Le;const Ae=c.active?c.sessionId:null;!Ae||!Kpe({enteringSplit:Qe,isExistingSession:c.active&&c.projectContext.kind==="existing",hasActiveVariantProxy:f&&h!==null})||(x(!1),y(null),i(Ct=>Ct+1),Ft(`/api/variants/${encodeURIComponent(Ae)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[_,c,f,h,x,y,i]);const $=g.useMemo(()=>{var $t;if(f||o&&!M||!c.active)return null;const{stage:Le,variants:Qe}=c,Ae=Le==="ready"||Le==="degraded",Ct=Qe.some(ft=>{var pt,tr;return((pt=ft.refinement)==null?void 0:pt.status)==="pending"||((tr=ft.refinement)==null?void 0:tr.status)==="running"});if(!Ae&&!Ct)return null;const ke=Qe.find(ft=>{var pt;return ft.status==="succeeded"&&((pt=ft.preview)==null?void 0:pt.kind)==="static_artifact"});return(($t=ke==null?void 0:ke.preview)==null?void 0:$t.kind)==="static_artifact"?Cu({sessionId:c.sessionId,variant:ke,projectContext:c.projectContext}):null},[M,o,f,c])??o,q=g.useMemo(()=>!c.active||!$?null:c.variants.find(Le=>{var Qe;return((Qe=Le.preview)==null?void 0:Qe.kind)==="static_artifact"&&$.startsWith(Le.preview.url)})??null,[$,c]),X=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"&&$&&OI($))return{kind:"variant",sessionId:b.sessionId,variantId:b.variantId};if(!c.active)return rO;if(q)return{kind:"variant",sessionId:c.sessionId,variantId:q.workItemId};if($){const Qe=$.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Ae=Qe!=null&&Qe[1]?decodeURIComponent(Qe[1]):null,Ct=Qe!=null&&Qe[2]?decodeURIComponent(Qe[2]):null;if(Ae===c.sessionId&&Ct&&c.variants.some(ft=>ft.workItemId===Ct))return{kind:"variant",sessionId:c.sessionId,variantId:Ct};const ke=$.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),$t=ke!=null&&ke[1]?decodeURIComponent(ke[1]):null;if($t&&c.variants.some(ft=>ft.workItemId===$t))return{kind:"variant",sessionId:c.sessionId,variantId:$t}}const Le=!!(_!=null&&_.left||_!=null&&_.right);return(!Le||k)&&!$&&f&&h&&c.variants.some(Qe=>Qe.workItemId===h)?{kind:"variant",sessionId:c.sessionId,variantId:h}:(!Le||k)&&!$&&C&&c.variants.some(Qe=>Qe.workItemId===C)?{kind:"variant",sessionId:c.sessionId,variantId:C}:rO},[b,q,c,f,h,$,_,k,C]),j=g.useRef(null);g.useEffect(()=>{var Ct,ke,$t;if(!q||((Ct=q.preview)==null?void 0:Ct.kind)!=="static_artifact"||((ke=q.refinement)==null?void 0:ke.status)!=="succeeded")return;const Le=`${q.workItemId}:${q.refinement.workItemId}`;if(j.current===Le)return;if(j.current=Le,($t=q.previewRoutes)!=null&&$t.length){i(ft=>ft+1);return}const Qe=q.preview.url.includes("?")?"&":"?",Ae=`${q.preview.url}${Qe}refinement=${encodeURIComponent(q.refinement.workItemId)}`;$!==Ae&&(l(Ae),i(ft=>ft+1))},[$,q,i,l,c]);const K=$!==null&&OI($),ee=$!==null&&!K||k&&!f&&!K,{isUpstreamReady:H,iframeRemountKey:Q,probeAttemptCount:B,initialProbeComplete:D}=Wpe(e,{rerunProbeImmediatelyOnVersion:s,probePath:K?$:null,skip:ee}),[G,fe]=g.useState(()=>m&&H?s:null),[ie,ue]=g.useState(null);m?G!==s&&((ie==null?void 0:ie.remountKey)!==s?ue({remountKey:s,probeAttemptCount:B}):H&&B>ie.probeAttemptCount&&fe(s)):(ie!==null&&ue(null),G!==null&&fe(null));const we=$!==null&&!K||H,se=v||m&&!K&&G!==s||m&&!we,be=`${Q}:${s}`,Se=FF(window.location.pathname),$e=e==="static"?`/static${Se??"/"}`:Se??"/",kt=dj();let tn=null;$&&(tn=_S({agentApplyMode:d,url:$}));const nn=K&&!we?"about:blank":tn,xt=P||A||b!=null&&b.previewError||se?"about:blank":nn??(we?`${kt}${$e}`:"about:blank"),Dt=!!P||!!A||!we&&D;let un=null;if(b!=null&&b.previewError)un=S.jsx(Tu,{fill:"overlay",size:"sm",state:"preview_replay_failed",role:"alert",tone:"error",title:"Rivet couldn’t preview this direction",description:"Select the direction again to retry.",children:S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:b.previewError})});else if(se)un=S.jsx(bS,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(P)un=S.jsx(bS,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(A){const Le=c.active&&I&&A.state==="preview_unavailable"&&((Kt=I.previewUnavailable)==null?void 0:Kt.reason)!=="missing_static_entry"?{sessionId:c.sessionId,variantId:I.workItemId}:void 0;un=S.jsx(lme,{issue:A,retryTarget:Le},I==null?void 0:I.workItemId)}else Dt&&(un=O?S.jsx(fj,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(JE,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}));return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:S.jsxs("div",{className:"relative min-h-0 flex-1",children:[un,S.jsx(Qpe,{target:X,src:xt,framework:e,remountKey:be},r)]})})};function lO({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=St(mc),c=Nt(mc),d=Ii(),f=St(Vm),h=St(hy),m=g.useRef(!1),v=g.useCallback(()=>{m.current||(m.current=!0,Ff({source:i,sessionId:e,variantId:n}))},[i,e,n]),y=g.useCallback(()=>{if(o){c(null);const I=g1("ended",l);d==null||d.capture(I.event,I.properties);return}v();const P={...l};delete P[t];const R=P.left||P.right?P:null;c(R);const O=g1(R?"updated":"ended",R??l);d==null||d.capture(O.event,O.properties)},[o,d,c,t,l,v]),_=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),b=g.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(P=>P.workItemId===n)??null,[e,n,f]),x=g.useMemo(()=>{var R,O,I;let P=r;if(((R=b==null?void 0:b.preview)==null?void 0:R.kind)==="static_artifact"&&((O=b.refinement)==null?void 0:O.status)==="succeeded"){if((I=b.previewRoutes)!=null&&I.length)return _S({agentApplyMode:h,url:Cu({sessionId:e,variant:b,projectContext:null})??r});const A=b.preview.url.includes("?")?"&":"?";P=`${b.preview.url}${A}refinement=${encodeURIComponent(b.refinement.workItemId)}`}return _S({agentApplyMode:h,url:P})},[h,b,e,r]),k=((C=b==null?void 0:b.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${b.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(zu,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:y,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(wS,{target:_,src:x,framework:"static",remountKey:k})})]})}function ume(){const t=St($f),e=St(WE);return!t||!e?null:$m.createPortal(S.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${e.x+12}px, ${e.y+12}px, 0)`},children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}const cO=(t,e)=>{if(!t)return null;const n=t.getBoundingClientRect(),{x:r,y:s}=e;return r<n.left||r>n.right||s<n.top||s>n.bottom?null:r<(n.left+n.right)/2?"left":"right"};function dme(){const t=St($f),e=St(WE),n=St(mc),r=Nt($f),s=Nt(mc),i=Ii(),o=g.useRef(null),[l,c]=g.useState(null),[d,f]=g.useState("hidden");if(!t&&(d!=="hidden"||l!==null)&&(f("hidden"),c(null)),g.useEffect(()=>{if(!t||!e)return;const m=cO(o.current,e);c(v=>v===m?v:m),f(v=>{if(v==="exiting")return v;const y=m!==null?"visible":"hidden";return v===y?v:y})},[t,e]),g.useEffect(()=>{if(!t)return;const m=v=>{const y=cO(o.current,{x:v.clientX,y:v.clientY});if(y&&t.url){const _={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[y];b&&(b.sessionId!==_.sessionId||b.variantId!==_.variantId)&&Ff(b);const x={...n??{},[y]:_};s(x);const k=g1(n?"updated":"started",x);i==null||i.capture(k.event,k.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else Ff(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m),()=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}},[t,i,r,s,n]),!t)return null;const h=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:h,"aria-hidden":"true",children:[S.jsx(uO,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(uO,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function uO({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const hj=(t,e,n)=>{var i,o,l;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(c=>c.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 Cu({sessionId:e,variant:r,projectContext:t.projectContext});if(((l=r.refinement)==null?void 0:l.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},dO=(t,e)=>{if(!t)return;const n=hj(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},fme=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(cj,{trackGlobalLoaderCount:!1})})}),hme=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,retry:r,isLoading:s,error:i}=bpe();return s?S.jsx(fme,{}):i||!n?S.jsx(JE,{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()}}]}):S.jsx(pme,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function pme(t){const e=St(mc),n=St($f),r=St(Vm),s=St(m1),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=g.useMemo(()=>{var R,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(R=i??o)==null?void 0:R.variantId,b=r.variants.filter(I=>{var A;return I.status==="succeeded"&&((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&I.workItemId!==_}),x=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=b.find(I=>{var A;return((A=I.preview)==null?void 0:A.kind)==="static_artifact"&&(I.preview.url===x||Cu({sessionId:r.sessionId,variant:I,projectContext:r.projectContext})===s)})??b[0];if(((O=C==null?void 0:C.preview)==null?void 0:O.kind)!=="static_artifact")return;const P=hj(r,r.sessionId,C.workItemId);if(P)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:P,source:"live"}},[r,i,o,s]),c=dO(i,r)??(o?l:void 0),d=dO(o,r)??(i?l:void 0),f=!i&&!!c,h=!o&&!!d,m=!!(c||d),v=S.jsx(cme,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(lO,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:f},`left-${c.sessionId}:${c.variantId}:${c.url}`),S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",style:{display:c&&d?"none":void 0},"aria-hidden":!!(c&&d),children:v}),d&&S.jsx(lO,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:h},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(dme,{}),S.jsx(ume,{})]})})}function Da(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pj(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
201
- * GSAP 3.15.1
202
- * https://gsap.com
203
- *
204
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
205
- * Subject to the terms at https://gsap.com/standard-license
206
- * @author: Jack Doyle, jack@greensock.com
207
- */var Ci={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},pm={duration:.5,overwrite:!1,delay:0},e6,ns,Hn,Gi=1e8,wn=1/Gi,xS=Math.PI*2,mme=xS/4,gme=0,mj=Math.sqrt,vme=Math.cos,yme=Math.sin,Wr=function(e){return typeof e=="string"},ar=function(e){return typeof e=="function"},el=function(e){return typeof e=="number"},t6=function(e){return typeof e>"u"},fa=function(e){return typeof e=="object"},ei=function(e){return e!==!1},n6=function(){return typeof window<"u"},Ig=function(e){return ar(e)||Wr(e)},gj=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},bs=Array.isArray,_me=/random\([^)]+\)/g,wme=/,\s*/g,fO=/(?:-?\.?\d|\.)+/gi,vj=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Zd=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Vw=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,yj=/[+-]=-?[.\d]+/,bme=/[^,'"\[\]\s]+/gi,xme=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,qn,Bo,SS,r6,Ri={},y1={},_j,wj=function(e){return(y1=zf(e,Ri))&&si},s6=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},mm=function(e,n){return!n&&console.warn(e)},bj=function(e,n){return e&&(Ri[e]=n)&&y1&&(y1[e]=n)||Ri},gm=function(){return 0},Sme={suppressEvents:!0,isStart:!0,kill:!1},uv={suppressEvents:!0,kill:!1},kme={suppressEvents:!0},i6={},nc=[],kS={},xj,vi={},Hw={},hO=30,dv=[],o6="",a6=function(e){var n=e[0],r,s;if(fa(n)||ar(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=dv.length;s--&&!dv[s].targetTest(n););r=dv[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new Bj(e[s],r)))||e.splice(s,1);return e},Ru=function(e){return e._gsap||a6(Yi(e))[0]._gsap},Sj=function(e,n,r){return(r=e[n])&&ar(r)?e[n]():t6(r)&&e.getAttribute&&e.getAttribute(n)||r},ti=function(e,n){return(e=e.split(",")).forEach(n)||e},fr=function(e){return Math.round(e*1e5)/1e5||0},Kn=function(e){return Math.round(e*1e7)/1e7||0},tf=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},Eme=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},_1=function(){var e=nc.length,n=nc.slice(0),r,s;for(kS={},nc.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},l6=function(e){return!!(e._initted||e._startAt||e.add)},kj=function(e,n,r,s){nc.length&&!ns&&_1(),e.render(n,r,!!(ns&&n<0&&l6(e))),nc.length&&!ns&&_1()},Ej=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(bme).length<2?n:Wr(e)?e.trim():e},Cj=function(e){return e},Ai=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},Cme=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},zf=function(e,n){for(var r in n)e[r]=n[r];return e},pO=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=fa(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},w1=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Op=function(e){var n=e.parent||qn,r=e.keyframes?Cme(bs(e.keyframes)):Ai;if(ei(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Pme=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},Pj=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},my=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},gc=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Au=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},Tme=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},ES=function(e,n,r,s){return e._startAt&&(ns?e._startAt.revert(uv):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},Rme=function t(e){return!e||e._ts&&t(e.parent)},mO=function(e){return e._repeat?Vf(e._tTime,e=e.duration()+e._rDelay)*e:0},Vf=function(e,n){var r=Math.floor(e=Kn(e/n));return e&&r===e?r-1:r},b1=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},gy=function(e){return e._end=Kn(e._start+(e._tDur/Math.abs(e._ts||e._rts||wn)||0))},vy=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Kn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),gy(e),r._dirty||Au(r,e)),e},Tj=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=b1(e.rawTime(),n),(!n._dur||Um(0,n.totalDuration(),r)-n._tTime>wn)&&n.render(r,!0)),Au(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-wn}},Xo=function(e,n,r,s){return n.parent&&gc(n),n._start=Kn((el(r)?r:!r&&x1(n)&&(!e._last||e._last._start>=e._time)?e._last?e._last._start:e._time:r||e!==qn?Zi(e,r,n):e._time)+n._delay),n._end=Kn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),Pj(e,n,"_first","_last",e._sort?"_start":0),x1(n)||(e._recent=n),s||Tj(e,n),e._ts<0&&vy(e,e._tTime),e},Rj=function(e,n){return(Ri.ScrollTrigger||s6("scrollTrigger",n))&&Ri.ScrollTrigger.create(n,e)},Aj=function(e,n,r,s,i){if(u6(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!ns&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&xj!==bi.frame)return nc.push(e),e._lazy=[i,s],1},Ame=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},x1=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},Ime=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&Ame(e)&&!(!e._initted&&x1(e))||(e._ts<0||e._dp._ts<0)&&!x1(e))?0:1,l=e._rDelay,c=0,d,f,h;if(l&&e._repeat&&(c=Um(0,e._tDur,n),f=Vf(c,l),e._yoyo&&f&1&&(o=1-o),f!==Vf(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||ns||s||e._zTime===wn||!n&&e._zTime){if(!e._initted&&Aj(e,n,s,r,c))return;for(h=e._zTime,e._zTime=n||(r?wn:0),r||(r=n&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&ES(e,n,r,!0),e._onUpdate&&!r&&xi(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&xi(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&gc(e,1),!r&&!ns&&(xi(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},Ome=function(e,n,r){var s;if(r>n)for(s=e._first;s&&s._start<=r;){if(s.data==="isPause"&&s._start>n)return s;s=s._next}else for(s=e._last;s&&s._start>=r;){if(s.data==="isPause"&&s._start<n)return s;s=s._prev}},Hf=function(e,n,r,s){var i=e._repeat,o=Kn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:Kn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&vy(e,e._tTime=e._tDur*l),e.parent&&gy(e),r||Au(e.parent,e),e},gO=function(e){return e instanceof qs?Au(e):Hf(e,e._dur)},Mme={_start:0,endTime:gm,totalDuration:gm},Zi=function t(e,n,r){var s=e.labels,i=e._recent||Mme,o=e.duration()>=Gi?i.endTime(!1):e._dur,l,c,d;return Wr(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),c==="<"||c===">"?(l>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(c=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(c=c/100*(bs(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+c:o+c)):n==null?o:+n},Mp=function(e,n,r){var s=el(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,c;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,c=r;c&&!("immediateRender"in l);)l=c.vars.defaults||{},c=ei(c.vars.inherit)&&c.parent;o.immediateRender=ei(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new wr(n[0],o,n[i+1])},Ec=function(e,n){return e||e===0?n(e):n},Um=function(e,n,r){return r<e?e:r>n?n:r},ys=function(e,n){return!Wr(e)||!(n=xme.exec(e))?"":n[1]},Nme=function(e,n,r){return Ec(r,function(s){return Um(e,n,s)})},CS=[].slice,Ij=function(e,n){return e&&fa(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&fa(e[0]))&&!e.nodeType&&e!==Bo},Lme=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Wr(s)&&!n||Ij(s,1)?(i=r).push.apply(i,Yi(s)):r.push(s)})||r},Yi=function(e,n,r){return Hn&&!n&&Hn.selector?Hn.selector(e):Wr(e)&&!r&&(SS||!Uf())?CS.call((n||r6).querySelectorAll(e),0):bs(e)?Lme(e,r):Ij(e)?CS.call(e,0):e?[e]:[]},PS=function(e){return e=Yi(e)[0]||mm("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Yi(n,r.querySelectorAll?r:r===e?mm("Invalid scope")||r6.createElement("div"):e)}},Oj=function(e){return e.sort(function(){return .5-Math.random()})},Mj=function(e){if(ar(e))return e;var n=fa(e)?e:{each:e},r=Iu(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,c=isNaN(s)||l,d=n.axis,f=s,h=s;return Wr(s)?f=h={center:.5,edges:.5,end:1}[s]||0:!l&&c&&(f=s[0],h=s[1]),function(m,v,y){var _=(y||n).length,b=o[_],x,k,C,P,R,O,I,A,M;if(!b){if(M=n.grid==="auto"?0:(n.grid||[1,Gi])[1],!M){for(I=-Gi;I<(I=y[M++].getBoundingClientRect().left)&&M<_;);M<_&&M--}for(b=o[_]=[],x=c?Math.min(M,_)*f-.5:s%M,k=M===Gi?0:c?_*h/M-.5:s/M|0,I=0,A=Gi,O=0;O<_;O++)C=O%M-x,P=k-(O/M|0),b[O]=R=d?Math.abs(d==="y"?P:C):mj(C*C+P*P),R>I&&(I=R),R<A&&(A=R);s==="random"&&Oj(b),b.max=I-A,b.min=A,b.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(M>_?_-1:d?d==="y"?_/M:M:Math.max(M,_/M))||0)*(s==="edges"?-1:1),b.b=_<0?i-_:i,b.u=ys(n.amount||n.each)||0,r=r&&_<0?qme(r):r}return _=(b[m]-b.min)/b.max||0,Kn(b.b+(r?r(_):_)*b.v)+b.u}},TS=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Kn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(el(r)?0:ys(r))}},Nj=function(e,n){var r=bs(e),s,i;return!r&&fa(e)&&(s=r=e.radius||Gi,e.values?(e=Yi(e.values),(i=!el(e[0]))&&(s*=s)):e=TS(e.increment)),Ec(n,r?ar(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),c=parseFloat(i?o.y:0),d=Gi,f=0,h=e.length,m,v;h--;)i?(m=e[h].x-l,v=e[h].y-c,m=m*m+v*v):m=Math.abs(e[h]-l),m<d&&(d=m,f=h);return f=!s||d<=s?e[f]:o,i||f===o||el(o)?f:f+ys(o)}:TS(e))},Lj=function(e,n,r,s){return Ec(bs(e)?!n:r===!0?!!(r=0):!s,function(){return bs(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(s=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(n-e+r*.99))/r)*r*s)/s})},Dme=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},$me=function(e,n){return function(r){return e(parseFloat(r))+(n||ys(r))}},Fme=function(e,n,r){return $j(e,n,0,1,r)},Dj=function(e,n,r){return Ec(r,function(s){return e[~~n(s)]})},jme=function t(e,n,r){var s=n-e;return bs(e)?Dj(e,t(0,e.length),n):Ec(r,function(i){return(s+(i-e)%s)%s+e})},zme=function t(e,n,r){var s=n-e,i=s*2;return bs(e)?Dj(e,t(0,e.length-1),n):Ec(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},vm=function(e){return e.replace(_me,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(wme);return Lj(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},$j=function(e,n,r,s,i){var o=n-e,l=s-r;return Ec(i,function(c){return r+((c-e)/o*l||0)})},Vme=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=Wr(e),l={},c,d,f,h,m;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(bs(e)&&!bs(n)){for(f=[],h=e.length,m=h-2,d=1;d<h;d++)f.push(t(e[d-1],e[d]));h--,i=function(y){y*=h;var _=Math.min(m,~~y);return f[_](y-_)},r=n}else s||(e=zf(bs(e)?[]:{},e));if(!f){for(c in n)c6.call(l,e,c,"get",n[c]);i=function(y){return h6(y,l)||(o?e.p:e)}}}return Ec(r,i)},vO=function(e,n,r){var s=e.labels,i=Gi,o,l,c;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(c=o,i=l);return c},xi=function(e,n,r){var s=e.vars,i=s[n],o=Hn,l=e._ctx,c,d,f;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&nc.length&&_1(),l&&(Hn=l),f=c?i.apply(d,c):i.call(d),Hn=o,f},up=function(e){return gc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!ns),e.progress()<1&&xi(e,"onInterrupt"),e},Wd,Fj=[],jj=function(e){if(e)if(e=!e.name&&e.default||e,n6()||e.headless){var n=e.name,r=ar(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:gm,render:h6,add:c6,kill:s0e,modifier:r0e,rawVars:0},o={targetTest:0,get:0,getSetter:f6,aliases:{},register:0};if(Uf(),e!==s){if(vi[n])return;Ai(s,Ai(w1(e,i),o)),zf(s.prototype,zf(i,w1(e,o))),vi[s.prop=n]=s,e.targetTest&&(dv.push(s),i6[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}bj(n,s),e.register&&e.register(si,s,ni)}else Fj.push(e)},kn=255,dp={aqua:[0,kn,kn],lime:[0,kn,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,kn],navy:[0,0,128],white:[kn,kn,kn],olive:[128,128,0],yellow:[kn,kn,0],orange:[kn,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[kn,0,0],pink:[kn,192,203],cyan:[0,kn,kn],transparent:[kn,kn,kn,0]},Uw=function(e,n,r){return e+=e<0?1:e>1?-1:0,(e*6<1?n+(r-n)*e*6:e<.5?r:e*3<2?n+(r-n)*(2/3-e)*6:n)*kn+.5|0},zj=function(e,n,r){var s=e?el(e)?[e>>16,e>>8&kn,e&kn]:0:dp.black,i,o,l,c,d,f,h,m,v,y;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),dp[e])s=dp[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&kn,s&kn,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&kn,e&kn]}else if(e.substr(0,3)==="hsl"){if(s=y=e.match(fO),!n)c=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,o=f<=.5?f*(d+1):f+d-f*d,i=f*2-o,s.length>3&&(s[3]*=1),s[0]=Uw(c+1/3,i,o),s[1]=Uw(c,i,o),s[2]=Uw(c-1/3,i,o);else if(~e.indexOf("="))return s=e.match(vj),r&&s.length<4&&(s[3]=1),s}else s=e.match(fO)||dp.transparent;s=s.map(Number)}return n&&!y&&(i=s[0]/kn,o=s[1]/kn,l=s[2]/kn,h=Math.max(i,o,l),m=Math.min(i,o,l),f=(h+m)/2,h===m?c=d=0:(v=h-m,d=f>.5?v/(2-h-m):v/(h+m),c=h===i?(o-l)/v+(o<l?6:0):h===o?(l-i)/v+2:(i-o)/v+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},Vj=function(e){var n=[],r=[],s=-1;return e.split(rc).forEach(function(i){var o=i.match(Zd)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},yO=function(e,n,r){var s="",i=(e+s).match(rc),o=n?"hsla(":"rgba(",l=0,c,d,f,h;if(!i)return e;if(i=i.map(function(m){return(m=zj(m,n,1))&&o+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(f=Vj(e),c=r.c,c.join(s)!==f.c.join(s)))for(d=e.replace(rc,"1").split(Zd),h=d.length-1;l<h;l++)s+=d[l]+(~c.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(rc),h=d.length-1;l<h;l++)s+=d[l]+i[l];return s+d[h]},rc=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in dp)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),Hme=/hsl[a]?\(/,Hj=function(e){var n=e.join(" "),r;if(rc.lastIndex=0,rc.test(n))return r=Hme.test(n),e[1]=yO(e[1],r),e[0]=yO(e[0],r,Vj(e[1])),!0},ym,bi=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],c,d,f,h,m,v,y=function _(b){var x=t()-s,k=b===!0,C,P,R,O;if((x>e||x<0)&&(r+=x-n),s+=x,R=s-r,C=R-o,(C>0||k)&&(O=++h.frame,m=R-h.time*1e3,h.time=R=R/1e3,o+=C+(C>=i?0:i-C),P=1),k||(c=d(_)),P)for(v=0;v<l.length;v++)l[v](R,m,O,b)};return h={time:0,frame:0,tick:function(){y(!0)},deltaRatio:function(b){return m/(1e3/(b||60))},wake:function(){_j&&(!SS&&n6()&&(Bo=SS=window,r6=Bo.document||{},Ri.gsap=si,(Bo.gsapVersions||(Bo.gsapVersions=[])).push(si.version),wj(y1||Bo.GreenSockGlobals||!Bo.gsap&&Bo||{}),Fj.forEach(jj)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&h.sleep(),d=f||function(b){return setTimeout(b,o-h.time*1e3+1|0)},ym=1,y(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(c),ym=0,d=gm},lagSmoothing:function(b,x){e=b||1/0,n=Math.min(x||33,e)},fps:function(b){i=1e3/(b||240),o=h.time*1e3+i},add:function(b,x,k){var C=x?function(P,R,O,I){b(P,R,O,I),h.remove(C)}:b;return h.remove(b),l[k?"unshift":"push"](C),Uf(),C},remove:function(b,x){~(x=l.indexOf(b))&&l.splice(x,1)&&v>=x&&v--},_listeners:l},h})(),Uf=function(){return!ym&&bi.wake()},Ht={},Ume=/^[\d.\-M][\d.\-,\s]/,Bme=/["']/g,Zme=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,c,d;i<o;i++)c=r[i],l=i!==o-1?c.lastIndexOf(","):c.length,d=c.substr(0,l),n[s]=isNaN(d)?d.replace(Bme,"").trim():+d,s=c.substr(l+1).trim();return n},Wme=function(e){var n=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",n);return e.substring(n,~s&&s<r?e.indexOf(")",r+1):r)},Kme=function(e){var n=(e+"").split("("),r=Ht[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[Zme(n[1])]:Wme(e).split(",").map(Ej)):Ht._CE&&Ume.test(e)?Ht._CE("",e):r},qme=function(e){return function(n){return 1-e(1-n)}},Iu=function(e,n){return e&&(ar(e)?e:Ht[e]||Kme(e))||n},Hu=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return ti(e,function(l){Ht[l]=Ri[l]=i,Ht[o=l.toLowerCase()]=r;for(var c in i)Ht[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=Ht[l+"."+c]=i[c]}),i},Uj=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},Bw=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/xS*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*yme((f-o)*i)+1},c=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:Uj(l);return i=xS/i,c.config=function(d,f){return t(e,d,f)},c},Zw=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:Uj(r);return s.config=function(i){return t(e,i)},s};ti("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Hu(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});Ht.Linear.easeNone=Ht.none=Ht.Linear.easeIn;Hu("Elastic",Bw("in"),Bw("out"),Bw());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};Hu("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Hu("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Hu("Circ",function(t){return-(mj(1-t*t)-1)});Hu("Sine",function(t){return t===1?1:-vme(t*mme)+1});Hu("Back",Zw("in"),Zw("out"),Zw());Ht.SteppedEase=Ht.steps=Ri.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-wn;return function(l){return((s*Um(0,o,l)|0)+i)*r}}};pm.ease=Ht["quad.out"];ti("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return o6+=t+","+t+"Params,"});var Bj=function(e,n){this.id=gme++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:Sj,this.set=n?n.getSetter:f6},_m=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,Hf(this,+n.duration,1,1),this.data=n.data,Hn&&(this._ctx=Hn,Hn.data.push(this)),ym||bi.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,Hf(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Uf(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(vy(this,r),!i._dp||i.parent||Tj(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Xo(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===wn||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),kj(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+mO(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+mO(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?Vf(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-wn?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?b1(this.parent._time,this):this._tTime,o=this._rts<0;this._rts=+r||0,this._ts=this._ps||r===-wn?0:this._rts;var l=this.totalDuration();return(o!==this._rts<0||i>0&&i<l)&&this.totalTime(Um(-Math.abs(this._delay),l,i),s!==!1),gy(this),Tme(this)},e.paused=function(r){if(!arguments.length)return this._ps;if(this._ps!==r)if(this._ps=r,r)this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0;else{Uf(),this._ts=this._rts;var s=this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,i=this.progress()===1&&Math.abs(this._zTime)!==wn,o;if(i)for(this._tTime-=wn,o=this._first;o;){if(!o._dur&&o._zTime<0&&o._ts&&o._start<=s+wn){i=!1;break}o=o._next}this.totalTime(s,i)}return this},e.startTime=function(r){if(arguments.length){this._start=Kn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Xo(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(ei(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?b1(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=kme);var s=ns;return ns=r,l6(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),ns=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,gO(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,gO(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(Zi(this,r),ei(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,ei(s)),this._dur||(this._zTime=-wn),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-wn:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-wn,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-wn)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=ar(r)?r:Cj,c=function(){var f=s.then;s.then=null,i&&i(),ar(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=f),o(l),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){up(this)},t})();Ai(_m.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-wn,_prom:0,_ps:!1,_rts:1});var qs=(function(t){pj(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=ei(r.sortChildren),qn&&Xo(r.parent||qn,Da(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&Rj(Da(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return Mp(0,arguments,this),this},n.from=function(s,i,o){return Mp(1,arguments,this),this},n.fromTo=function(s,i,o,l){return Mp(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,Op(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new wr(s,i,Zi(this,o),1),this},n.call=function(s,i,o){return Xo(this,wr.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,c,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new wr(s,o,Zi(this,c)),this},n.staggerFrom=function(s,i,o,l,c,d,f){return o.runBackwards=1,Op(o).immediateRender=ei(o.immediateRender),this.staggerTo(s,i,o,l,c,d,f)},n.staggerFromTo=function(s,i,o,l,c,d,f,h){return l.startAt=o,Op(l).immediateRender=ei(l.immediateRender),this.staggerTo(s,i,l,c,d,f,h)},n.render=function(s,i,o){var l=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:Kn(s),h=this._zTime<0!=s<0&&(this._initted||!d),m,v,y,_,b,x,k,C,P,R,O,I;if(this!==qn&&f>c&&s>=0&&(f=c),f!==this._tTime||o||h){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),m=f,P=this._start,C=this._ts,x=!C,h&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,b=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(b*100+s,i,o);if(m=Kn(f%b),f===c?(_=this._repeat,m=d):(R=Kn(f/b),_=~~R,_&&_===R&&(m=d,_--),m>d&&(m=d)),R=Vf(this._tTime,b),!l&&this._tTime&&R!==_&&this._tTime-R*b-this._dur<=0&&(R=_),O&&_&1&&(m=d-m,I=1),_!==R&&!this._lock){var A=O&&R&1,M=A===(O&&_&1);if(_<R&&(A=!A),l=A?0:f%d?d:f,this._lock=1,this.render(l||(I?0:Kn(_*b)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&xi(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1,R=_),l&&l!==this._time||x!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,M&&(this._lock=2,l=A?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!x)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=Ome(this,Kn(l),Kn(m)),k&&(f-=m-(m=k._start))),this._tTime=f,this._time=m,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!R&&(xi(this,"onStart"),this._tTime!==f))return this;if(m>=l&&s>=0)for(v=this._first;v;){if(y=v._next,(v._act||m>=v._start)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(m-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(m-v._start)*v._ts,i,o),m!==this._time||!this._ts&&!x){k=0,y&&(f+=this._zTime=-wn);break}}v=y}else{v=this._last;for(var L=s<0?s:m;v;){if(y=v._prev,(v._act||L<=v._end)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(L-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(L-v._start)*v._ts,i,o||ns&&l6(v)),m!==this._time||!this._ts&&!x){k=0,y&&(f+=this._zTime=L?-wn:wn);break}}v=y}}if(k&&!i&&(this.pause(),k.render(m>=l?0:-wn)._zTime=m>=l?1:-1,this._ts))return this._start=P,gy(this),this.render(s,i,o);this._onUpdate&&!i&&xi(this,"onUpdate",!0),(f===c&&this._tTime>=this.totalDuration()||!f&&l)&&(P===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===c&&this._ts>0||!f&&this._ts<0)&&gc(this,1),!i&&!(s<0&&!l)&&(f||l||!c)&&(xi(this,f===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(el(i)||(i=Zi(this,i,s)),!(s instanceof _m)){if(bs(s))return s.forEach(function(l){return o.add(l,i)}),this;if(Wr(s))return this.addLabel(s,i);if(ar(s))s=wr.delayedCall(0,s);else return this}return this!==s?Xo(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-Gi);for(var c=[],d=this._first;d;)d._start>=l&&(d instanceof wr?i&&c.push(d):(o&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,o)))),d=d._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return Wr(s)?this.removeLabel(s):ar(s)?this.killTweensOf(s):(s.parent===this&&my(this,s),s===this._recent&&(this._recent=this._last),Au(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Kn(bi.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=Zi(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=wr.delayedCall(0,i||gm,o);return l.data="isPause",this._hasPause=1,Xo(this,l,Zi(this,s))},n.removePause=function(s){var i=this._first;for(s=Zi(this,s);i;)i._start===s&&i.data==="isPause"&&gc(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),c=l.length;c--;)ql!==l[c]&&l[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Yi(s),c=this._first,d=el(i),f;c;)c instanceof wr?Eme(c._targets,l)&&(d?(!ql||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&o.push(c):(f=c.getTweensOf(l,i)).length&&o.push.apply(o,f),c=c._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Zi(o,s),c=i,d=c.startAt,f=c.onStart,h=c.onStartParams,m=c.immediateRender,v,y=wr.to(o,Ai({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||wn,onStart:function(){if(o.pause(),!v){var b=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());y._dur!==b&&Hf(y,b,0,1).render(y._time,!0,!0),v=1}f&&f.apply(y,h||[])}},i));return m?y.render(0):y},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Ai({startAt:{time:Zi(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),vO(this,Zi(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),vO(this,Zi(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+wn)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,c=this.labels,d;for(s=Kn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in c)c[d]>=o&&(c[d]+=s);return Au(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),Au(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,c=Gi,d,f,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(h=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>c&&o._sort&&l._ts&&!o._lock?(o._lock=1,Xo(o,l,f-l._delay,1)._lock=0):c=f,f<0&&l._ts&&(i-=f,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=Kn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),c=0),l._end>i&&l._ts&&(i=l._end),l=d;Hf(o,o===qn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(qn._ts&&(kj(qn,b1(s,qn)),xj=bi.frame),bi.frame>=hO){hO+=Ci.autoSleep||120;var i=qn._first;if((!i||!i._ts)&&Ci.autoSleep&&bi._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||bi.sleep()}}},e})(_m);Ai(qs.prototype,{_lock:0,_hasPause:0,_forcing:0});var Gme=function(e,n,r,s,i,o,l){var c=new ni(this._pt,e,n,0,1,Gj,null,i),d=0,f=0,h,m,v,y,_,b,x,k;for(c.b=r,c.e=s,r+="",s+="",(x=~s.indexOf("random("))&&(s=vm(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),m=r.match(Vw)||[];h=Vw.exec(s);)y=h[0],_=s.substring(d,h.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),y!==m[f++]&&(b=parseFloat(m[f-1])||0,c._pt={_next:c._pt,p:_||f===1?_:",",s:b,c:y.charAt(1)==="="?tf(b,y)-b:parseFloat(y)-b,m:v&&v<4?Math.round:0},d=Vw.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=l,(yj.test(s)||x)&&(c.e=0),this._pt=c,c},c6=function(e,n,r,s,i,o,l,c,d,f){ar(s)&&(s=s(i||0,e,o));var h=e[n],m=r!=="get"?r:ar(h)?d?e[n.indexOf("set")||!ar(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():h,v=ar(h)?d?e0e:Kj:d6,y;if(Wr(s)&&(~s.indexOf("random(")&&(s=vm(s)),s.charAt(1)==="="&&(y=tf(m,s)+(ys(m)||0),(y||y===0)&&(s=y))),!f||m!==s||RS)return!isNaN(m*s)&&s!==""?(y=new ni(this._pt,e,n,+m||0,s-(m||0),typeof h=="boolean"?n0e:qj,0,v),d&&(y.fp=d),l&&y.modifier(l,this,e),this._pt=y):(!h&&!(n in e)&&s6(n,s),Gme.call(this,e,n,m,s,v,c||Ci.stringFilter,d))},Yme=function(e,n,r,s,i){if(ar(e)&&(e=Np(e,i,n,r,s)),!fa(e)||e.style&&e.nodeType||bs(e)||gj(e))return Wr(e)?Np(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=Np(e[l],i,n,r,s);return o},Zj=function(e,n,r,s,i,o){var l,c,d,f;if(vi[e]&&(l=new vi[e]).init(i,l.rawVars?n[e]:Yme(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=c=new ni(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Wd))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=c;return l},ql,RS,u6=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,c=s.lazy,d=s.onUpdate,f=s.runBackwards,h=s.yoyoEase,m=s.keyframes,v=s.autoRevert,y=e._dur,_=e._startAt,b=e._targets,x=e.parent,k=x&&x.data==="nested"?x.vars.targets:b,C=e._overwrite==="auto"&&!e6,P=e.timeline,R=s.easeReverse||h,O,I,A,M,L,z,$,q,X,j,K,ee,H;if(P&&(!m||!i)&&(i="none"),e._ease=Iu(i,pm.ease),e._rEase=R&&(Iu(R)||e._ease),e._from=!P&&!!s.runBackwards,e._from&&(e.ratio=1),!P||m&&!s.stagger){if(q=b[0]?Ru(b[0]).harness:0,ee=q&&s[q.prop],O=w1(s,i6),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&y?uv:Sme),_._lazy=0),o){if(gc(e._startAt=wr.set(b,Ai({data:"isStart",overwrite:!1,parent:x,immediateRender:!0,lazy:!_&&ei(c),startAt:null,delay:0,onUpdate:d&&function(){return xi(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(ns||!l&&!v)&&e._startAt.revert(uv),l&&y&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&y&&!_){if(n&&(l=!1),A=Ai({overwrite:!1,data:"isFromStart",lazy:l&&!_&&ei(c),immediateRender:l,stagger:0,parent:x},O),ee&&(A[q.prop]=ee),gc(e._startAt=wr.set(b,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(ns?e._startAt.revert(uv):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,wn,wn);else if(!n)return}for(e._pt=e._ptCache=0,c=y&&ei(c)||c&&!y,I=0;I<b.length;I++){if(L=b[I],$=L._gsap||a6(b)[I]._gsap,e._ptLookup[I]=j={},kS[$.id]&&nc.length&&_1(),K=k===b?I:k.indexOf(L),q&&(X=new q).init(L,ee||O,e,K,k)!==!1&&(e._pt=M=new ni(e._pt,L,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(Q){j[Q]=M}),X.priority&&(z=1)),!q||ee)for(A in O)vi[A]&&(X=Zj(A,O,e,K,L,k))?X.priority&&(z=1):j[A]=M=c6.call(e,L,A,"get",O[A],K,k,0,s.stringFilter);e._op&&e._op[I]&&e.kill(L,e._op[I]),C&&e._pt&&(ql=e,qn.killTweensOf(L,j,e.globalTime(n)),H=!e.parent,ql=0),e._pt&&c&&(kS[$.id]=1)}z&&Yj(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!H,m&&n<=0&&P.render(Gi,!0,!0)},Xme=function(e,n,r,s,i,o,l,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,h,m,v;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,v=e._targets.length;v--;){if(f=m[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return RS=1,e.vars[n]="+=0",u6(e,l),RS=0,c?mm(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)h=d[v],f=h._pt||h,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,h.e&&(h.e=fr(r)+ys(h.e)),h.b&&(h.b=f.s+ys(h.b))},Qme=function(e,n){var r=e[0]?Ru(e[0]).harness:0,s=r&&r.aliases,i,o,l,c;if(!s)return n;i=zf({},n);for(o in s)if(o in i)for(c=s[o].split(","),l=c.length;l--;)i[c[l]]=i[o];return i},Jme=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(bs(n))l=r[e]||(r[e]=[]),n.forEach(function(c,d){return l.push({t:d/(n.length-1)*100,v:c,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},Np=function(e,n,r,s,i){return ar(e)?e.call(n,r,s,i):Wr(e)&&~e.indexOf("random(")?vm(e):e},S1=o6+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Wj={};ti(S1+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return Wj[t]=1});S1=S1.split(",");var wr=(function(t){pj(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:Op(s))||this;var c=l.vars,d=c.duration,f=c.delay,h=c.immediateRender,m=c.stagger,v=c.overwrite,y=c.keyframes,_=c.defaults,b=c.scrollTrigger,x=s.parent||qn,k=(bs(r)||gj(r)?el(r[0]):"length"in s)?[r]:Yi(r),C,P,R,O,I,A,M,L;if(l._targets=k.length?a6(k):mm("GSAP target "+r+" not found. https://gsap.com",!Ci.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,y||m||Ig(d)||Ig(f)){s=l.vars;var z=s.easeReverse||s.yoyoEase;if(C=l.timeline=new qs({data:"nested",defaults:_||{},targets:x&&x.data==="nested"?x.vars.targets:k}),C.kill(),C.parent=C._dp=Da(l),C._start=0,m||Ig(d)||Ig(f)){if(O=k.length,M=m&&Mj(m),fa(m))for(I in m)~S1.indexOf(I)&&(L||(L={}),L[I]=m[I]);for(P=0;P<O;P++)R=w1(s,Wj),R.stagger=0,z&&(R.easeReverse=z),L&&zf(R,L),A=k[P],R.duration=+Np(d,Da(l),P,A,k),R.delay=(+Np(f,Da(l),P,A,k)||0)-l._delay,!m&&O===1&&R.delay&&(l._delay=f=R.delay,l._start+=f,R.delay=0),C.to(A,R,M?M(P,A,k):0),C._ease=Ht.none;C.duration()?d=f=0:l.timeline=0}else if(y){Op(Ai(C.vars.defaults,{ease:"none"})),C._ease=Iu(y.ease||s.ease||"none");var $=0,q,X,j;if(bs(y))y.forEach(function(K){return C.to(k,K,">")}),C.duration();else{R={};for(I in y)I==="ease"||I==="easeEach"||Jme(I,y[I],R,y.easeEach);for(I in R)for(q=R[I].sort(function(K,ee){return K.t-ee.t}),$=0,P=0;P<q.length;P++)X=q[P],j={ease:X.e,duration:(X.t-(P?q[P-1].t:0))/100*d},j[I]=X.v,C.to(k,j,$),$+=j.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!e6&&(ql=Da(l),qn.killTweensOf(k),ql=0),Xo(x,Da(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(h||!d&&!y&&l._start===Kn(x._time)&&ei(h)&&Rme(Da(l))&&x.data!=="nested")&&(l._tTime=-wn,l.render(Math.max(0,-f)||0)),b&&Rj(Da(l),b),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,c=this._tDur,d=this._dur,f=s<0,h=s>c-wn&&!f?c:s<wn?0:s,m,v,y,_,b,x,k,C;if(!d)Ime(this,s,i,o);else if(h!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(m=h,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(m=Kn(h%_),h===c?(y=this._repeat,m=d):(b=Kn(h/_),y=~~b,y&&y===b?(m=d,y--):m>d&&(m=d)),x=this._yoyo&&y&1,x&&(m=d-m),b=Vf(this._tTime,_),m===l&&!o&&this._initted&&y===b)return this._tTime=h,this;y!==b&&this.vars.repeatRefresh&&!x&&!this._lock&&m!==_&&this._initted&&(this._lock=o=1,this.render(Kn(_*y),!0).invalidate()._lock=0)}if(!this._initted){if(Aj(this,f?s:m,o,i,h))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&y!==b))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var P=m<l;if(P!==this._inv){var R=P?l:d-l;this._inv=P,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=R?(P?-1:1)/R:0,this._invScale=P?-this.ratio:1-this.ratio,this._invEase=P?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(m/d);if(this._from&&(this.ratio=k=1-k),this._tTime=h,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&h&&!i&&!b&&(xi(this,"onStart"),this._tTime!==h))return this;for(v=this._pt;v;)v.r(k,v.d),v=v._next;C&&C.render(s<0?s:C._dur*C._ease(m/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&ES(this,s,i,o),xi(this,"onUpdate")),this._repeat&&y!==b&&this.vars.onRepeat&&!i&&this.parent&&xi(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(f&&!this._onUpdate&&ES(this,s,!0,!0),(s||!d)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&gc(this,1),!i&&!(f&&!l)&&(h||l||x)&&(xi(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,c){ym||bi.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||u6(this,d),f=this._ease(d/this._dur),Xme(this,s,i,o,l,f,d,c)?this.resetTo(s,i,o,l,1):(vy(this,0),this.parent||Pj(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?up(this):this.scrollTrigger&&this.scrollTrigger.kill(!!ns),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,ql&&ql.vars.overwrite!==!0)._first||up(this),this.parent&&o!==this.timeline.totalDuration()&&Hf(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,c=s?Yi(s):l,d=this._ptLookup,f=this._pt,h,m,v,y,_,b,x;if((!i||i==="all")&&Pme(l,c))return i==="all"&&(this._pt=0),up(this);for(h=this._op=this._op||[],i!=="all"&&(Wr(i)&&(_={},ti(i,function(k){return _[k]=1}),i=_),i=Qme(l,i)),x=l.length;x--;)if(~c.indexOf(l[x])){m=d[x],i==="all"?(h[x]=i,y=m,v={}):(v=h[x]=h[x]||{},y=i);for(_ in y)b=m&&m[_],b&&((!("kill"in b.d)||b.d.kill(_)===!0)&&my(this,b,"_pt"),delete m[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&up(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Mp(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return Mp(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return qn.killTweensOf(s,i,o)},e})(_m);Ai(wr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});ti("staggerTo,staggerFrom,staggerFromTo",function(t){wr[t]=function(){var e=new qs,n=CS.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var d6=function(e,n,r){return e[n]=r},Kj=function(e,n,r){return e[n](r)},e0e=function(e,n,r,s){return e[n](s.fp,r)},t0e=function(e,n,r){return e.setAttribute(n,r)},f6=function(e,n){return ar(e[n])?Kj:t6(e[n])&&e.setAttribute?t0e:d6},qj=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},n0e=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},Gj=function(e,n){var r=n._pt,s="";if(!e&&n.b)s=n.b;else if(e===1&&n.e)s=n.e;else{for(;r;)s=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+s,r=r._next;s+=n.c}n.set(n.t,n.p,s,n)},h6=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},r0e=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},s0e=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?my(this,n,"_pt"):n.dep||(r=1),n=s;return!r},i0e=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},Yj=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},ni=(function(){function t(n,r,s,i,o,l,c,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||qj,this.d=c||this,this.set=d||d6,this.pr=f||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=i0e,this.m=r,this.mt=i,this.tween=s},t})();ti(o6+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return i6[t]=1});Ri.TweenMax=Ri.TweenLite=wr;Ri.TimelineLite=Ri.TimelineMax=qs;qn=new qs({sortChildren:!1,defaults:pm,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ci.stringFilter=Hj;var Ou=[],fv={},o0e=[],_O=0,a0e=0,Ww=function(e){return(fv[e]||o0e).map(function(n){return n()})},wm=function(){var e=Date.now(),n=[];e-_O>2&&(Ww("matchMediaInit"),Ou.forEach(function(r){var s=r.queries,i=r.conditions,o,l,c,d;for(l in s)o=Bo.matchMedia(s[l]).matches,o&&(c=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),c&&n.push(r))}),Ww("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),_O=e,Ww("matchMedia"))},Xj=(function(){function t(n,r){this.selector=r&&PS(r),this.data=[],this._r=[],this.isReverted=!1,this.id=a0e++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){ar(r)&&(i=s,s=r,r=ar);var o=this,l=function(){var d=Hn,f=o.selector,h;return d&&d!==o&&d.data.push(o),i&&(o.selector=PS(i)),Hn=o,h=s.apply(o,arguments),ar(h)&&o._r.push(h),Hn=d,o.selector=f,o.isReverted=!1,h};return o.last=l,r===ar?l(o,function(c){return o.add(null,c)}):r?o[r]=l:l},e.ignore=function(r){var s=Hn;Hn=null,r(this),Hn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof wr&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),c=i.data.length,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,h){return h.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),c=i.data.length;c--;)d=i.data[c],d instanceof qs?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof wr)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s){for(var o=Ou.length;o--;)Ou[o].id===this.id&&Ou.splice(o,1);this._mqs&&this._mqs.forEach(function(l){return l.removeListener?l.removeListener(wm):l.removeEventListener("change",wm)}),this._mqs=null}},e.revert=function(r){this.kill(r||{})},t})(),l0e=(function(){function t(n){this.contexts=[],this.scope=n,Hn&&Hn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){fa(r)||(r={matches:r});var o=new Xj(0,i||this.scope),l=o.conditions={},c,d,f;Hn&&!o.selector&&(o.selector=Hn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(c=Bo.matchMedia(r[d]),c&&(Ou.indexOf(o)<0&&Ou.push(o),(l[d]=c.matches)&&(f=1),c.addListener?c.addListener(wm):c.addEventListener("change",wm),(o._mqs||(o._mqs=[])).push(c)));return f&&s(o,function(h){return o.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),k1={registerPlugin:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(s){return jj(s)})},timeline:function(e){return new qs(e)},getTweensOf:function(e,n){return qn.getTweensOf(e,n)},getProperty:function(e,n,r,s){Wr(e)&&(e=Yi(e)[0]);var i=Ru(e||{}).get,o=r?Cj:Ej;return r==="native"&&(r=""),e&&(n?o((vi[n]&&vi[n].get||i)(e,n,r,s)):function(l,c,d){return o((vi[l]&&vi[l].get||i)(e,l,c,d))})},quickSetter:function(e,n,r){if(e=Yi(e),e.length>1){var s=e.map(function(f){return si.quickSetter(f,n,r)}),i=s.length;return function(f){for(var h=i;h--;)s[h](f)}}e=e[0]||{};var o=vi[n],l=Ru(e),c=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var h=new o;Wd._pt=0,h.init(e,r?f+r:f,Wd,0,[e]),h.render(1,h),Wd._pt&&h6(1,Wd)}:l.set(e,c);return o?d:function(f){return d(e,c,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=si.to(e,Ai((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(c,d,f){return i.resetTo(n,c,d,f)};return o.tween=i,o},isTweening:function(e){return qn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Iu(e.ease,pm.ease)),pO(pm,e||{})},config:function(e){return pO(Ci,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!vi[l]&&!Ri[l]&&mm(n+" effect requires "+l+" plugin.")}),Hw[n]=function(l,c,d){return r(Yi(l),Ai(c||{},i),d)},o&&(qs.prototype[n]=function(l,c,d){return this.add(Hw[n](l,fa(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){Ht[e]=Iu(n)},parseEase:function(e,n){return arguments.length?Iu(e,n):Ht},getById:function(e){return qn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new qs(e),s,i;for(r.smoothChildTiming=ei(e.smoothChildTiming),qn.remove(r),r._dp=0,r._time=r._tTime=qn._time,s=qn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof wr&&s.vars.onComplete===s._targets[0]))&&Xo(r,s,s._start-s._delay),s=i;return Xo(qn,r,0),r},context:function(e,n){return e?new Xj(e,n):Hn},matchMedia:function(e){return new l0e(e)},matchMediaRefresh:function(){return Ou.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||wm()},addEventListener:function(e,n){var r=fv[e]||(fv[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=fv[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:jme,wrapYoyo:zme,distribute:Mj,random:Lj,snap:Nj,normalize:Fme,getUnit:ys,clamp:Nme,splitColor:zj,toArray:Yi,selector:PS,mapRange:$j,pipe:Dme,unitize:$me,interpolate:Vme,shuffle:Oj},install:wj,effects:Hw,ticker:bi,updateRoot:qs.updateRoot,plugins:vi,globalTimeline:qn,core:{PropTween:ni,globals:bj,Tween:wr,Timeline:qs,Animation:_m,getCache:Ru,_removeLinkedListItem:my,reverting:function(){return ns},context:function(e){return e&&Hn&&(Hn.data.push(e),e._ctx=Hn),Hn},suppressOverwrites:function(e){return e6=e}}};ti("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return k1[t]=wr[t]});bi.add(qs.updateRoot);Wd=k1.to({},{duration:0});var c0e=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},u0e=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=c0e(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},Kw=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var c,d;if(Wr(i)&&(c={},ti(i,function(f){return c[f]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}u0e(l,i)}}}},si=k1.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,c;this.tween=r;for(o in n)c=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(c||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=c,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)ns?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},Kw("roundProps",TS),Kw("modifiers"),Kw("snap",Nj))||k1;wr.version=qs.version=si.version="3.15.1";_j=1;n6()&&Uf();Ht.Power0;Ht.Power1;Ht.Power2;Ht.Power3;Ht.Power4;Ht.Linear;Ht.Quad;Ht.Cubic;Ht.Quart;Ht.Quint;Ht.Strong;Ht.Elastic;Ht.Back;Ht.SteppedEase;Ht.Bounce;Ht.Sine;Ht.Expo;Ht.Circ;/*!
208
- * CSSPlugin 3.15.1
209
- * https://gsap.com
210
- *
211
- * Copyright 2008-2026, GreenSock. All rights reserved.
212
- * Subject to the terms at https://gsap.com/standard-license
213
- * @author: Jack Doyle, jack@greensock.com
214
- */var wO,Gl,nf,p6,cu,bO,m6,d0e=function(){return typeof window<"u"},tl={},iu=180/Math.PI,rf=Math.PI/180,Ad=Math.atan2,xO=1e8,g6=/([A-Z])/g,f0e=/(left|right|width|margin|padding|x)/i,h0e=/[\s,\(]\S/,ea={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},AS=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},p0e=function(e,n){return n.set(n.t,n.p,e===1?n.e:Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},m0e=function(e,n){return n.set(n.t,n.p,e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},g0e=function(e,n){return n.set(n.t,n.p,e===1?n.e:e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},v0e=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},Qj=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},Jj=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},y0e=function(e,n,r){return e.style[n]=r},_0e=function(e,n,r){return e.style.setProperty(n,r)},w0e=function(e,n,r){return e._gsap[n]=r},b0e=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},x0e=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},S0e=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Gn="transform",ri=Gn+"Origin",k0e=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in tl&&i){if(this.tfm=this.tfm||{},e!=="transform")e=ea[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=$a(s,l)}):this.tfm[e]=o.x?o[e]:$a(s,e),e===ri&&(this.tfm.zOrigin=o.zOrigin);else return ea.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(Gn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(ri,n,"")),e=Gn}(i||n)&&this.props.push(e,n,i[e])},e7=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},E0e=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(g6,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=m6(),(!i||!i.isStart)&&!r[Gn]&&(e7(r),s.zOrigin&&r[ri]&&(r[ri]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},t7=function(e,n){var r={target:e,props:[],revert:E0e,save:k0e};return e._gsap||si.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},n7,IS=function(e,n){var r=Gl.createElementNS?Gl.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Gl.createElement(e);return r&&r.style?r:Gl.createElement(e)},Si=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(g6,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Bf(n)||n,1)||""},SO="O,Moz,ms,Ms,Webkit".split(","),Bf=function(e,n,r){var s=n||cu,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(SO[o]+e in i););return o<0?null:(o===3?"ms":o>=0?SO[o]:"")+e},OS=function(){d0e()&&window.document&&(wO=window,Gl=wO.document,nf=Gl.documentElement,cu=IS("div")||{style:{}},IS("div"),Gn=Bf(Gn),ri=Gn+"Origin",cu.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",n7=!!Bf("perspective"),m6=si.core.reverting,p6=1)},kO=function(e){var n=e.ownerSVGElement,r=IS("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),nf.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),nf.removeChild(r),i},EO=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},r7=function(e){var n,r;try{n=e.getBBox()}catch{n=kO(e),r=1}return n&&(n.width||n.height)||r||(n=kO(e)),n&&!n.width&&!n.x&&!n.y?{x:+EO(e,["x","cx","x1"])||0,y:+EO(e,["y","cy","y1"])||0,width:0,height:0}:n},s7=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&r7(e))},vc=function(e,n){if(n){var r=e.style,s;n in tl&&n!==ri&&(n=Gn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(g6,"-$1").toLowerCase())):r.removeAttribute(n)}},Yl=function(e,n,r,s,i,o){var l=new ni(e._pt,n,r,0,1,o?Jj:Qj);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},CO={deg:1,rad:1,turn:1},C0e={grid:1,flex:1},yc=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=cu.style,c=f0e.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(c?"Width":"Height"),h=100,m=s==="px",v=s==="%",y,_,b,x;if(s===o||!i||CO[s]||CO[o])return i;if(o!=="px"&&!m&&(i=t(e,n,r,"px")),x=e.getCTM&&s7(e),(v||o==="%")&&(tl[n]||~n.indexOf("adius")))return y=x?e.getBBox()[c?"width":"height"]:e[f],fr(v?i/y*h:i/100*y);if(l[c?"width":"height"]=h+(m?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,x&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Gl||!_.appendChild)&&(_=Gl.body),b=_._gsap,b&&v&&b.width&&c&&b.time===bi.time&&!b.uncache)return fr(i/b.width*h);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=h+s,y=e[f],k?e.style[n]=k:vc(e,n)}else(v||o==="%")&&!C0e[Si(_,"display")]&&(l.position=Si(e,"position")),_===e&&(l.position="static"),_.appendChild(cu),y=cu[f],_.removeChild(cu),l.position="absolute";return c&&v&&(b=Ru(_),b.time=bi.time,b.width=_[f]),fr(m?y*i/h:y&&i?h/y*i:0)},$a=function(e,n,r,s){var i;return p6||OS(),n in ea&&n!=="transform"&&(n=ea[n],~n.indexOf(",")&&(n=n.split(",")[0])),tl[n]&&n!=="transform"?(i=xm(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:C1(Si(e,ri))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=E1[n]&&E1[n](e,n,r)||Si(e,n)||Sj(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?yc(e,n,i,r)+r:i},P0e=function(e,n,r,s){if(!r||r==="none"){var i=Bf(n,e,1),o=i&&Si(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=Si(e,"borderTopColor"))}var l=new ni(this._pt,e.style,n,0,1,Gj),c=0,d=0,f,h,m,v,y,_,b,x,k,C,P,R;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Si(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=Si(e,n)||s,_?e.style[n]=_:vc(e,n)),f=[r,s],Hj(f),r=f[0],s=f[1],m=r.match(Zd)||[],R=s.match(Zd)||[],R.length){for(;h=Zd.exec(s);)b=h[0],k=s.substring(c,h.index),y?y=(y+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(y=1),b!==(_=m[d++]||"")&&(v=parseFloat(_)||0,P=_.substr((v+"").length),b.charAt(1)==="="&&(b=tf(v,b)+P),x=parseFloat(b),C=b.substr((x+"").length),c=Zd.lastIndex-C.length,C||(C=C||Ci.units[n]||P,c===s.length&&(s+=C,l.e+=C)),P!==C&&(v=yc(e,n,_,C)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:v,c:x-v,m:y&&y<4||n==="zIndex"?Math.round:0});l.c=c<s.length?s.substring(c,s.length):""}else l.r=n==="display"&&s==="none"?Jj:Qj;return yj.test(s)&&(l.e=0),this._pt=l,l},PO={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},T0e=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=PO[r]||r,n[1]=PO[s]||s,n.join(" ")},R0e=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,c,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],tl[l]&&(c=1,l=l==="transformOrigin"?ri:Gn),vc(r,l);c&&(vc(r,Gn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",xm(r,1),o.uncache=1,e7(s)))}},E1={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new ni(e._pt,n,r,0,0,R0e);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},bm=[1,0,0,1,0,0],i7={},o7=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},TO=function(e){var n=Si(e,Gn);return o7(n)?bm:n.substr(7).match(vj).map(fr)},v6=function(e,n){var r=e._gsap||Ru(e),s=e.style,i=TO(e),o,l,c,d;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?bm:i):(i===bm&&!e.offsetParent&&e!==nf&&!r.svg&&(c=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,nf.appendChild(e)),i=TO(e),c?s.display=c:vc(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):nf.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},MS=function(e,n,r,s,i,o){var l=e._gsap,c=i||v6(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,h=l.xOffset||0,m=l.yOffset||0,v=c[0],y=c[1],_=c[2],b=c[3],x=c[4],k=c[5],C=n.split(" "),P=parseFloat(C[0])||0,R=parseFloat(C[1])||0,O,I,A,M;r?c!==bm&&(I=v*b-y*_)&&(A=P*(b/I)+R*(-_/I)+(_*k-b*x)/I,M=P*(-y/I)+R*(v/I)-(v*k-y*x)/I,P=A,R=M):(O=r7(e),P=O.x+(~C[0].indexOf("%")?P/100*O.width:P),R=O.y+(~(C[1]||C[0]).indexOf("%")?R/100*O.height:R)),s||s!==!1&&l.smooth?(x=P-d,k=R-f,l.xOffset=h+(x*v+k*_)-x,l.yOffset=m+(x*y+k*b)-k):l.xOffset=l.yOffset=0,l.xOrigin=P,l.yOrigin=R,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[ri]="0px 0px",o&&(Yl(o,l,"xOrigin",d,P),Yl(o,l,"yOrigin",f,R),Yl(o,l,"xOffset",h,l.xOffset),Yl(o,l,"yOffset",m,l.yOffset)),e.setAttribute("data-svg-origin",P+" "+R)},xm=function(e,n){var r=e._gsap||new Bj(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",c=getComputedStyle(e),d=Si(e,ri)||"0",f,h,m,v,y,_,b,x,k,C,P,R,O,I,A,M,L,z,$,q,X,j,K,ee,H,Q,B,D,G,fe,ie,ue;return f=h=m=_=b=x=k=C=P=0,v=y=1,r.svg=!!(e.getCTM&&s7(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Gn]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Gn]!=="none"?c[Gn]:"")),s.scale=s.rotate=s.translate="none"),I=v6(e,r.svg),r.svg&&(r.uncache?(H=e.getBBox(),d=r.xOrigin-H.x+"px "+(r.yOrigin-H.y)+"px",ee=""):ee=!n&&e.getAttribute("data-svg-origin"),MS(e,ee||d,!!ee||r.originIsAbsolute,r.smooth!==!1,I)),R=r.xOrigin||0,O=r.yOrigin||0,I!==bm&&(z=I[0],$=I[1],q=I[2],X=I[3],f=j=I[4],h=K=I[5],I.length===6?(v=Math.sqrt(z*z+$*$),y=Math.sqrt(X*X+q*q),_=z||$?Ad($,z)*iu:0,k=q||X?Ad(q,X)*iu+_:0,k&&(y*=Math.abs(Math.cos(k*rf))),r.svg&&(f-=R-(R*z+O*q),h-=O-(R*$+O*X))):(ue=I[6],fe=I[7],B=I[8],D=I[9],G=I[10],ie=I[11],f=I[12],h=I[13],m=I[14],A=Ad(ue,G),b=A*iu,A&&(M=Math.cos(-A),L=Math.sin(-A),ee=j*M+B*L,H=K*M+D*L,Q=ue*M+G*L,B=j*-L+B*M,D=K*-L+D*M,G=ue*-L+G*M,ie=fe*-L+ie*M,j=ee,K=H,ue=Q),A=Ad(-q,G),x=A*iu,A&&(M=Math.cos(-A),L=Math.sin(-A),ee=z*M-B*L,H=$*M-D*L,Q=q*M-G*L,ie=X*L+ie*M,z=ee,$=H,q=Q),A=Ad($,z),_=A*iu,A&&(M=Math.cos(A),L=Math.sin(A),ee=z*M+$*L,H=j*M+K*L,$=$*M-z*L,K=K*M-j*L,z=ee,j=H),b&&Math.abs(b)+Math.abs(_)>359.9&&(b=_=0,x=180-x),v=fr(Math.sqrt(z*z+$*$+q*q)),y=fr(Math.sqrt(K*K+ue*ue)),A=Ad(j,K),k=Math.abs(A)>2e-4?A*iu:0,P=ie?1/(ie<0?-ie:ie):0),r.svg&&(ee=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!o7(Si(e,Gn)),ee&&e.setAttribute("transform",ee))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(v*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(y*=-1,k+=k<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=h-((r.yPercent=h&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=m+o,r.scaleX=fr(v),r.scaleY=fr(y),r.rotation=fr(_)+l,r.rotationX=fr(b)+l,r.rotationY=fr(x)+l,r.skewX=k+l,r.skewY=C+l,r.transformPerspective=P+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[ri]=C1(d)),r.xOffset=r.yOffset=0,r.force3D=Ci.force3D,r.renderTransform=r.svg?I0e:n7?a7:A0e,r.uncache=0,r},C1=function(e){return(e=e.split(" "))[0]+" "+e[1]},qw=function(e,n,r){var s=ys(n);return fr(parseFloat(n)+parseFloat(yc(e,"x",r+"px",s)))+s},A0e=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,a7(e,n)},Jc="0deg",Gh="0px",eu=") ",a7=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,c=r.z,d=r.rotation,f=r.rotationY,h=r.rotationX,m=r.skewX,v=r.skewY,y=r.scaleX,_=r.scaleY,b=r.transformPerspective,x=r.force3D,k=r.target,C=r.zOrigin,P="",R=x==="auto"&&e&&e!==1||x===!0;if(C&&(h!==Jc||f!==Jc)){var O=parseFloat(f)*rf,I=Math.sin(O),A=Math.cos(O),M;O=parseFloat(h)*rf,M=Math.cos(O),o=qw(k,o,I*M*-C),l=qw(k,l,-Math.sin(O)*-C),c=qw(k,c,A*M*-C+C)}b!==Gh&&(P+="perspective("+b+eu),(s||i)&&(P+="translate("+s+"%, "+i+"%) "),(R||o!==Gh||l!==Gh||c!==Gh)&&(P+=c!==Gh||R?"translate3d("+o+", "+l+", "+c+") ":"translate("+o+", "+l+eu),d!==Jc&&(P+="rotate("+d+eu),f!==Jc&&(P+="rotateY("+f+eu),h!==Jc&&(P+="rotateX("+h+eu),(m!==Jc||v!==Jc)&&(P+="skew("+m+", "+v+eu),(y!==1||_!==1)&&(P+="scale("+y+", "+_+eu),k.style[Gn]=P||"translate(0, 0)"},I0e=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,c=r.rotation,d=r.skewX,f=r.skewY,h=r.scaleX,m=r.scaleY,v=r.target,y=r.xOrigin,_=r.yOrigin,b=r.xOffset,x=r.yOffset,k=r.forceCSS,C=parseFloat(o),P=parseFloat(l),R,O,I,A,M;c=parseFloat(c),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,c+=f),c||d?(c*=rf,d*=rf,R=Math.cos(c)*h,O=Math.sin(c)*h,I=Math.sin(c-d)*-m,A=Math.cos(c-d)*m,d&&(f*=rf,M=Math.tan(d-f),M=Math.sqrt(1+M*M),I*=M,A*=M,f&&(M=Math.tan(f),M=Math.sqrt(1+M*M),R*=M,O*=M)),R=fr(R),O=fr(O),I=fr(I),A=fr(A)):(R=h,A=m,O=I=0),(C&&!~(o+"").indexOf("px")||P&&!~(l+"").indexOf("px"))&&(C=yc(v,"x",o,"px"),P=yc(v,"y",l,"px")),(y||_||b||x)&&(C=fr(C+y-(y*R+_*I)+b),P=fr(P+_-(y*O+_*A)+x)),(s||i)&&(M=v.getBBox(),C=fr(C+s/100*M.width),P=fr(P+i/100*M.height)),M="matrix("+R+","+O+","+I+","+A+","+C+","+P+")",v.setAttribute("transform",M),k&&(v.style[Gn]=M)},O0e=function(e,n,r,s,i){var o=360,l=Wr(i),c=parseFloat(i)*(l&&~i.indexOf("rad")?iu:1),d=c-s,f=s+d+"deg",h,m;return l&&(h=i.split("_")[1],h==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),h==="cw"&&d<0?d=(d+o*xO)%o-~~(d/o)*o:h==="ccw"&&d>0&&(d=(d-o*xO)%o-~~(d/o)*o)),e._pt=m=new ni(e._pt,n,r,s,d,p0e),m.e=f,m.u="deg",e._props.push(r),m},RO=function(e,n){for(var r in n)e[r]=n[r];return e},M0e=function(e,n,r){var s=RO({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,c,d,f,h,m,v,y;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Gn]=n,l=xm(r,1),vc(r,Gn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Gn],o[Gn]=n,l=xm(r,1),o[Gn]=d);for(c in tl)d=s[c],f=l[c],d!==f&&i.indexOf(c)<0&&(v=ys(d),y=ys(f),h=v!==y?yc(r,c,d,y):parseFloat(d),m=parseFloat(f),e._pt=new ni(e._pt,l,c,h,m-h,AS),e._pt.u=y||0,e._props.push(c));RO(l,s)};ti("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});E1[e>1?"border"+t:t]=function(l,c,d,f,h){var m,v;if(arguments.length<4)return m=o.map(function(y){return $a(l,y,d)}),v=m.join(" "),v.split(m[0]).length===5?m[0]:v;m=(f+"").split(" "),v={},o.forEach(function(y,_){return v[y]=m[_]=m[_]||m[(_-1)/2|0]}),l.init(c,v,h)}});var l7={name:"css",register:OS,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,c=r.vars.startAt,d,f,h,m,v,y,_,b,x,k,C,P,R,O,I,A,M;p6||OS(),this.styles=this.styles||t7(e),A=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(vi[_]&&Zj(_,n,r,s,e,i)))){if(v=typeof f,y=E1[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=vm(f)),y)y(this,e,_,f,r)&&(I=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",rc.lastIndex=0,rc.test(d)||(b=ys(d),x=ys(f),x?b!==x&&(d=yc(e,_,d,x)+x):b&&(f+=b)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),A.push(_,0,l[_]);else if(v!=="undefined"){if(c&&_ in c?(d=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],Wr(d)&&~d.indexOf("random(")&&(d=vm(d)),ys(d+"")||d==="auto"||(d+=Ci.units[_]||ys($a(e,_))||""),(d+"").charAt(1)==="="&&(d=$a(e,_))):d=$a(e,_),m=parseFloat(d),k=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),h=parseFloat(f),_ in ea&&(_==="autoAlpha"&&(m===1&&$a(e,"visibility")==="hidden"&&h&&(m=0),A.push("visibility",0,l.visibility),Yl(this,l,"visibility",m?"inherit":"hidden",h?"inherit":"hidden",!h)),_!=="scale"&&_!=="transform"&&(_=ea[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in tl,C){if(this.styles.save(_),M=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=Si(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var L=e.style.perspective;e.style.perspective=f,f=Si(e,"perspective"),L?e.style.perspective=L:vc(e,"perspective")}h=parseFloat(f)}if(P||(R=e._gsap,R.renderTransform&&!n.parseTransform||xm(e,n.parseTransform),O=n.smoothOrigin!==!1&&R.smooth,P=this._pt=new ni(this._pt,l,Gn,0,1,R.renderTransform,R,0,-1),P.dep=1),_==="scale")this._pt=new ni(this._pt,R,"scaleY",R.scaleY,(k?tf(R.scaleY,k+h):h)-R.scaleY||0,AS),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){A.push(ri,0,l[ri]),f=T0e(f),R.svg?MS(e,f,0,O,0,this):(x=parseFloat(f.split(" ")[2])||0,x!==R.zOrigin&&Yl(this,R,"zOrigin",R.zOrigin,x),Yl(this,l,_,C1(d),C1(f)));continue}else if(_==="svgOrigin"){MS(e,f,1,O,0,this);continue}else if(_ in i7){O0e(this,R,_,m,k?tf(m,k+f):f);continue}else if(_==="smoothOrigin"){Yl(this,R,"smooth",R.smooth,f);continue}else if(_==="force3D"){R[_]=f;continue}else if(_==="transform"){M0e(this,f,e);continue}}else _ in l||(_=Bf(_)||_);if(C||(h||h===0)&&(m||m===0)&&!h0e.test(f)&&_ in l)b=(d+"").substr((m+"").length),h||(h=0),x=ys(f)||(_ in Ci.units?Ci.units[_]:b),b!==x&&(m=yc(e,_,d,x)),this._pt=new ni(this._pt,C?R:l,_,m,(k?tf(m,k+h):h)-m,!C&&(x==="px"||_==="zIndex")&&n.autoRound!==!1?v0e:AS),this._pt.u=x||0,C&&M!==f?(this._pt.b=d,this._pt.e=M,this._pt.r=g0e):b!==x&&x!=="%"&&(this._pt.b=d,this._pt.r=m0e);else if(_ in l)P0e.call(this,e,_,d,k?k+f:f);else if(_ in e)this.add(e,_,d||e[_],k?k+f:f,s,i);else if(_!=="parseTransform"){s6(_,f);continue}C||(_ in l?A.push(_,0,l[_]):typeof e[_]=="function"?A.push(_,2,e[_]()):A.push(_,1,d||e[_])),o.push(_)}}I&&Yj(this)},render:function(e,n){if(n.tween._time||!m6())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:$a,aliases:ea,getSetter:function(e,n,r){var s=ea[n];return s&&s.indexOf(",")<0&&(n=s),n in tl&&n!==ri&&(e._gsap.x||$a(e,"x"))?r&&bO===r?n==="scale"?b0e:w0e:(bO=r||{})&&(n==="scale"?x0e:S0e):e.style&&!t6(e.style[n])?y0e:~n.indexOf("-")?_0e:f6(e,n)},core:{_removeProperty:vc,_getMatrix:v6}};si.utils.checkPrefix=Bf;si.core.getStyleSaver=t7;(function(t,e,n,r){var s=ti(t+","+e+","+n,function(i){tl[i]=1});ti(e,function(i){Ci.units[i]="deg",i7[i]=1}),ea[s[13]]=t+","+e,ti(r,function(i){var o=i.split(":");ea[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");ti("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Ci.units[t]="px"});si.registerPlugin(l7);var po=si.registerPlugin(l7)||si;po.core.Tween;const hv="/assets/logo-animation",Gw=1280,N0e=[{id:"eraser",src:`${hv}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${hv}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${hv}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],L0e=[{k:"pot",x:.075,y:.2,r:-12,w:152},{k:"chair",x:.1,y:.52,r:8,w:150},{k:"mug",x:.11,y:.84,r:-6,w:140},{k:"cart",x:.3,y:.13,r:10,w:178},{k:"terracotta-1",x:.345,y:.45,r:-18,w:122},{k:"pitcher",x:.285,y:.71,r:14,w:128},{k:"desk",x:.46,y:.25,r:-8,w:198},{k:"startac",x:.475,y:.55,r:16,w:140},{k:"vhsplant",x:.4,y:.9,r:-6,w:188},{k:"bubblephone",x:.63,y:.12,r:12,w:150},{k:"terracotta-2",x:.61,y:.43,r:20,w:122},{k:"pot",x:.675,y:.68,r:14,w:140},{k:"chair",x:.71,y:.91,r:-12,w:140},{k:"mug",x:.91,y:.15,r:8,w:136},{k:"cart",x:.905,y:.47,r:-10,w:166},{k:"startac",x:.88,y:.76,r:18,w:136}],NS=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(x,k)=>x+Math.random()*(k-x);let d=null,f,h=1;const m=N0e.map(x=>({...x})),v=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const x=s.getBoundingClientRect(),k=x.width||Gw,C=x.height||Gw*.64;h=k/Gw,i.style.width=`${242*h}px`,i.style.height=`${250*h}px`;const R=250*h/337,O=[],I=(A,M,L)=>{const z=document.createElement("div");return z.className="la-obj",z.style.width=`${M}px`,z.innerHTML=`<img src="${A}" alt="" style="${L?"transform:scaleX(-1)":""}">`,s.appendChild(z),z};return L0e.forEach((A,M)=>{const L=A.w*h,z=I(`${hv}/sea/${A.k}.png`,L,M%2===0);po.set(z,{x:A.x*k-L/2,y:A.y*C-L/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:z,hero:!1,rest:1})}),m.forEach(A=>{const M=A.cssW*h;A.el=I(A.src,M,!!A.flip),A.finalScale=A.fit*R/(A.cssW*h),po.set(A.el,{x:A.seaX*k-M/2,y:A.seaY*C-A.cssH*h/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:A.el,hero:!0,rest:150/A.cssW})}),O},y=(x,k)=>{const C=s.getBoundingClientRect(),P=o.getBoundingClientRect();return{x:P.left-C.left+x/326*P.width,y:P.top-C.top+k/337*P.height}},_=()=>{d&&d.revert();const x=v();if(l){d=po.context(()=>{x.filter(P=>!P.hero).forEach(P=>po.set(P.el,{scale:0})),m.forEach(P=>{if(!P.el)return;const R=y(P.localX,P.localY);po.set(P.el,{x:R.x-P.cssW*h/2,y:R.y-P.cssH*h/2,rotation:P.rot,scale:P.finalScale})})},s);return}const k=[],C=[];d=po.context(()=>{const P=po.timeline();P.to(x.map(R=>R.el),{scale:R=>x[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),P.add(()=>{x.forEach(({el:R,hero:O},I)=>{const A=O?k:C,M=I%2?1:-1;A.push(po.to(R,{rotation:"+="+c(2.5,6)*M,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),po.to(R,{y:"+="+c(5,11)*M,x:"+="+c(4,9)*-M,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),P.to({},{duration:1.1}),P.add("pick"),m.forEach((R,O)=>{R.el&&P.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),P.add("clear","pick+=0.7"),P.add(()=>C.forEach(R=>R.kill()),"clear"),P.to(x.filter(R=>!R.hero).map(R=>R.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),P.add("assemble","clear+=0.25"),P.add(()=>k.forEach(R=>R.kill()),"assemble"),m.forEach((R,O)=>{if(!R.el||R.finalScale===void 0)return;const I=y(R.localX,R.localY);P.to(R.el,{x:I.x-R.cssW*h/2,y:I.y-R.cssH*h/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),m.forEach(R=>{!R.el||R.finalScale===void 0||P.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};po.ticker.fps(12),_();const b=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(x=>x.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},D0e=Object.freeze(Object.defineProperty({__proto__:null,default:NS},Symbol.toStringTag,{value:"Module"})),AO=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),$0e=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(NS,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(AO,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[S.jsx(NS,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(AO,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),F0e="/assets/rivet-wordmark-orange-CYKVQDmG.svg",j0e=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:F0e,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(q1,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),z0e="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",P1=44,Yh=8,Og=16,V0e=4,IO=-18,H0e=.18,U0e=[.22,1,.36,1],OO=.92,B0e=1,Z0e=.95,W0e=.4,K0e=[.19,1,.22,1],Yw=0,q0e=1,G0e=0,Y0e=0,X0e=0,c7=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Yh,s=Math.max(r,e.width-P1-Yh),i=Math.max(Yh,e.height-P1-Yh);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Yh,t.y))}},y6=()=>({width:window.innerWidth,height:window.innerHeight}),Q0e=({position:t,boundsLeftPx:e=0})=>c7({position:t,viewport:y6(),boundsLeft:e}),J0e=()=>{if(typeof window>"u")return{x:Og,y:Og};const t=y6();return{x:t.width-P1-Og,y:t.height-P1-Og}},ege=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=V0e,tge=t=>t.button===void 0||t.button<=X0e,MO=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},nge=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=g.useRef(null),c=g.useRef(!1),[d,f]=g.useState(!1),[h,m]=g.useState(!1),[v,y]=g.useState(!1),_=n?!1:{opacity:Yw,scale:OO,x:IO},b=n?{opacity:Yw}:{opacity:Yw,scale:OO,x:IO},x=n?{duration:Y0e}:{duration:H0e,ease:U0e,scale:{duration:W0e,ease:K0e}},k=g.useCallback(()=>{const M=l.current;M&&(c.current=M.hasMoved),l.current=null,f(!1)},[]),C=g.useCallback(M=>{const L=l.current;if(!L)return;const z=MO(M),$=z.x-L.startPointer.x,q=z.y-L.startPointer.y,X=L.hasMoved||ege({deltaX:$,deltaY:q});l.current={...L,hasMoved:X},X&&o(c7({position:{x:L.startPosition.x+$,y:L.startPosition.y+q},viewport:y6(),boundsLeft:s}))},[o,s]),P=g.useCallback(M=>{if(l.current||!tge(M))return;const L=MO(M);l.current={startPointer:L,startPosition:r,hasMoved:!1},f(!0)},[r]),R=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),O=e?gS:lhe,I=GE(),A=!d&&(h||v);return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:C,onPointerUp:k,onPointerCancel:k,onMouseMove:C,onMouseUp:k}):null,S.jsx(Ei,{children:t?S.jsx(zu,{label:O,side:"top",forceOpen:A?void 0:!1,children:S.jsx(Nr.button,{type:"button","aria-label":O,"aria-keyshortcuts":I.ariaKeyShortcuts,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocus:M=>y(M.currentTarget.matches(":focus-visible")),onBlur:()=>y(!1),initial:_,animate:{opacity:q0e,scale:B0e,x:G0e},whileTap:{scale:Z0e},exit:b,transition:x,onPointerDown:P,onMouseDown:P,onPointerMove:C,onPointerUp:k,onPointerCancel:k,onMouseMove:C,onMouseUp:k,onClick:R,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:z0e,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},Xw=ai("useConfig"),rge=300*1e3,sge=1800*1e3,ige=60*1e3,oge=300*1e3,age=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},lge=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},cge=ze({featureFlags:Ek(re(),ze({isEnabled:Xs()})).optional()}),uge=async()=>{const t=await Ft("/api/feature-flags");if(!t.ok)throw new Error(`Failed to fetch feature flags: ${t.statusText}`);return cge.parse(await t.json())},dge=t=>({...SF,...t??{}}),fge=()=>{const t=St(fS),e=Nt(fS),n=Nt(IF),r=Nt(OF),s=Nt(hy),i=Nt(Rfe),o=Nt(Pfe),l=Nt(Efe),c=Nt(fy),d=Nt(kfe),f=Nt(Cfe),h=g.useCallback(x=>{o(x.agentModeAvailable),f(x.projectId??null),d({name:x.name??null,email:x.email??null}),x.isMCPSession&&n(!0),x.mcpEditor&&r(x.mcpEditor),s(x.agentApplyMode??lge()??null),i(x.queueAccessToken??age())},[s,o,n,r,i,f,d]),m=la({queryKey:Js.rivetConfig,queryFn:QF,staleTime:rge,gcTime:sge}),v=la({queryKey:Js.featureFlags,queryFn:uge,staleTime:ige,gcTime:oge}),{refetch:y}=m,{refetch:_}=v;g.useLayoutEffect(()=>{m.data&&(h(m.data),c(!1),Xw.info("Config loaded:",m.data)),v.data&&(e(dge(v.data.featureFlags)),l(!0)),m.error&&(l(!0),c(!1),Xw.warn("Failed to load config:",m.error.message)),v.error&&(l(!0),Xw.warn("Failed to load feature flags:",v.error.message))},[m.data,m.error,v.data,v.error,h,c,e,l]);const b=g.useCallback(async()=>{const[x]=await Promise.all([y(),_()]);return x.data?x.data:null},[y,_]);return{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&v.isPending,error:m.error?m.error.message:null,refetchConfig:b}},Id=ai("useOAuthCallback"),hge=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,c,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{Id.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),h=f.get("access_token"),m=f.get("refresh_token"),y=new URLSearchParams(o).get("session");if(!h)throw new Error("No access token found in URL");if(!y)throw new Error("No session ID found in URL");Id.info(`Completing OAuth with session: ${y}`);const _=await fetch(`${vS}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:y,accessToken:h,refreshToken:m}),signal:n.signal}),b=await _.json();if(!_.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(Id.info("OAuth authentication completed successfully"),r)return;if(KN({userId:(l=b.user)==null?void 0:l.id,email:(c=b.user)==null?void 0:c.email}),(d=b.user)!=null&&d.email&&h)try{const k=await Ft("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:h,refreshToken:m,userId:b.user.id}),signal:n.signal});k.ok||Id.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;Id.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(v1,"1");const x=window.location.pathname;window.history.replaceState({},document.title,x),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;Id.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:Ys(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),t},pge=3e3,mge=(t,e=Ft)=>{const n=new AbortController;let r;const s={onmessage:null,onerror:null,close:()=>{n.abort(),clearTimeout(r)}},i=async()=>{var l,c,d;let o=!1;try{const f=await e(t,{signal:n.signal,headers:{Accept:"text/event-stream"}});if(o=f.status===401||f.status===403,!f.ok||!f.body)throw await((l=f.body)==null?void 0:l.cancel()),new Error(`Event stream request failed (${f.status}).`);const h=f.body.getReader(),m=new TextDecoder;let v="",y=[];try{for(;!n.signal.aborted;){const _=await h.read();if(_.done)break;v+=m.decode(_.value,{stream:!0});let b=v.indexOf(`
215
- `);for(;b!==-1;){const x=v.slice(0,b).replace(/\r$/,"");v=v.slice(b+1),x===""?(y.length>0&&!n.signal.aborted&&((c=s.onmessage)==null||c.call(s,{data:y.join(`
216
- `)})),y=[]):x.startsWith("data:")&&y.push(x.slice(5).replace(/^ /,"")),b=v.indexOf(`
217
- `)}}}finally{await h.cancel().catch(()=>{}),h.releaseLock()}}catch(f){n.signal.aborted||(d=s.onerror)==null||d.call(s,f)}!n.signal.aborted&&!o&&(r=setTimeout(()=>void i(),pge))};return i(),s},Qw=ai("useAgentVariantsSession"),gge=({enabled:t=!0}={})=>{const e=Nt(Vm),n=Nt(RF),r=Nt(kF),s=Nt(AF),i=g.useRef(null);g.useEffect(()=>{if(n(!1),!t)return;const o=mge("/api/variants/events");return o.onmessage=l=>{try{const c=JSON.parse(l.data),d=i.current;if(c.active){const h=new Set(c.variants.map(m=>m.requestId).filter(m=>!!m));s(m=>m.filter(y=>!h.has(y.requestId))),c.sessionId!==i.current&&(i.current=c.sessionId,r(!0))}else i.current=null;e(c),n(!0),c.active&&c.sessionId!==d&&Ft(`/api/variants/${c.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(h=>Qw.warn("failed to reset preview-port on session switch",h))}catch(c){Qw.warn("failed to parse SSE event payload",c)}},o.onerror=l=>{Qw.warn("SSE error (auto-reconnects)",l)},()=>{o.close()}},[t,e,n,r,s])};var vge=Object.defineProperty,Or=(t,e)=>vge(t,"name",{value:e,configurable:!0});function u7(t){const e=t+"CollectionProvider",[n,r]=ha(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=Or(_=>{const{scope:b,children:x}=_,k=g.useRef(null),C=g.useRef(new Map).current;return S.jsx(s,{scope:b,itemMap:C,collectionRef:k,children:x})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",c=dc(l),d=g.forwardRef((_,b)=>{const{scope:x,children:k}=_,C=i(l,x),P=xn(b,C.collectionRef);return S.jsx(c,{ref:P,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",h="data-radix-collection-item",m=dc(f),v=g.forwardRef((_,b)=>{const{scope:x,children:k,...C}=_,P=g.useRef(null),R=xn(b,P),O=i(f,x);return g.useEffect(()=>(O.itemMap.set(P,{ref:P,...C}),()=>void O.itemMap.delete(P))),S.jsx(m,{[h]:"",ref:R,children:k})});v.displayName=f;function y(_){const b=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((O,I)=>C.indexOf(O.ref.current)-C.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return Or(y,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},y,r]}Or(u7,"createCollection");var NO=new WeakMap,dr,gi,Mg=(gi=class extends Map{constructor(n){super(n);nt(this,dr);Ne(this,dr,[...super.keys()]),NO.set(this,!0)}set(n,r){return NO.get(this)&&!this.has(n)&&W(this,dr).push(n),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=i?this.size:this.size+1,l=_6(n),c=l>=0?Math.min(l,o-1):Math.max(o+l,0);if(i?W(this,dr).indexOf(r)===c:c===this.size)return this.set(r,s),this;const d=W(this,dr).filter(h=>h!==r);d.splice(c,0,r);const f=d.map(h=>[h,h===r?s:this.get(h)]);this.clear();for(const[h,m]of f)this.set(h,m);return this}with(n,r,s){const i=new gi(this);return i.insert(n,r,s),i}before(n){const r=W(this,dr).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=W(this,dr).indexOf(n);if(i===-1)return this;const o=W(this,dr).indexOf(r),l=o!==-1&&o<i?i-1:i;return this.insert(l,r,s)}after(n){let r=W(this,dr).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=W(this,dr).indexOf(n);if(i===-1)return this;const o=W(this,dr).indexOf(r),l=o!==-1&&o<=i?i:i+1;return this.insert(l,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ne(this,dr,[]),super.clear()}delete(n){const r=super.delete(n);return r&&W(this,dr).splice(W(this,dr).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=pv(W(this,dr),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=pv(W(this,dr),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return W(this,dr).indexOf(n)}keyAt(n){return pv(W(this,dr),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new gi(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new gi(s)}reduce(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=0,l=s;for(const c of this)o===0&&!i?l=c:l=Reflect.apply(r,this,[l,c,o,this]),o++;return l}reduceRight(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=s;for(let l=this.size-1;l>=0;l--){const c=this.entryAt(l);l===this.size-1&&!i?o=c:o=Reflect.apply(r,this,[o,c,l,this])}return o}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[s,i]of r)this.set(s,i);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new gi(r)}toReversed(){const n=new gi;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new gi(r)}slice(n,r){const s=new gi;for(const i of W(this,dr).slice(n,r))s.set(i,this.get(i));return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},dr=new WeakMap,Or(gi,"OrderedDict"),gi);function pv(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=d7(t,e);return n===-1?void 0:t[n]}Or(pv,"at");function d7(t,e){const n=t.length,r=_6(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Or(d7,"toSafeIndex");function _6(t){return t!==t||t===0?0:Math.trunc(t)}Or(_6,"toSafeInteger");function f7(t){const e=t+"CollectionProvider",[n,r]=ha(e),[s,i]=n(e);s.displayName=t+"CollectionStableContextProvider";const[o,l]=n(e);o.displayName=t+"CollectionStatefulContextProvider";const c=Or(({state:O,...I})=>O?S.jsx(f,{...I,state:O}):S.jsx(d,{...I}),"CollectionProvider");c.displayName=e;const d=Or(O=>{const I=k();return S.jsx(f,{...O,state:I})},"CollectionInit");d.displayName=t+"CollectionInit";const f=Or(O=>{const{scope:I,children:A,state:M}=O,L=g.useRef(null),[z,$]=g.useState(null),q=xn(L,$),[X,j]=M,K=g.useRef(new Mg),ee=g.useCallback(()=>{const H=K.current;return m7(H)||H.sort(mv),H},[]);return g.useEffect(()=>{if(!z)return;const H=g7(()=>{j(Q=>{const B=Q.toSorted(mv);return B.some(([G],fe)=>Q.keyAt(fe)!==G)?B:Q})});return H.observe(z,{childList:!0,subtree:!0}),()=>{H.disconnect()}},[z,j]),S.jsx(s,{scope:I,collectionElementRef:q,collectionElementRefObject:L,getCollection:ee,setCollection:j,registryRef:K,children:S.jsx(o,{scope:I,collectionElement:z,collection:X,children:A})})},"CollectionProviderImpl");f.displayName=t+"CollectionProviderImpl";const h=t+"CollectionSlot",m=dc(h),v=g.forwardRef((O,I)=>{const{scope:A,children:M}=O,L=i(h,A),z=xn(I,L.collectionElementRef);return S.jsx(m,{ref:z,children:M})});v.displayName=h;const y=t+"CollectionItemSlot",_="data-radix-collection-item",b=dc(y),x=g.forwardRef((O,I)=>{const{scope:A,children:M,...L}=O,z=g.useRef(null),$=i(y,A),{setCollection:q,registryRef:X}=$,j=g.useRef(L);h7(j.current,L)||(j.current=L);const K=j.current,ee=g.useCallback(B=>{const D=X.current;B?D.set(B,{...j.current,element:B}):z.current&&D.delete(z.current)},[X]),H=xn(I,ee,z);ws(()=>{const B=z.current,D=X.current;B&&D.has(B)&&D.set(B,{...K,element:B})},[K,X]);const Q=g.useRef(null);return g.useEffect(()=>{const B=z.current,D=Q.current;((D==null?void 0:D.element)??null)===B&&(!B||(D==null?void 0:D.itemData)===K)||(Q.current=B?{element:B,itemData:K}:null,q(G=>{const fe=new Mg(G);return D&&D.element!==B&&fe.delete(D.element),B&&fe.set(B,{...K,element:B}),fe.sort(mv)}))}),g.useEffect(()=>()=>{const B=Q.current;Q.current=null,B&&q(D=>{if(!D.has(B.element))return D;const G=new Mg(D);return G.delete(B.element),G})},[q]),S.jsx(b,{[_]:"",ref:H,children:M})});x.displayName=y;function k(){return g.useState(new Mg)}Or(k,"useInitCollection");function C(O){const{collection:I}=l(t+"CollectionConsumer",O);return I}Or(C,"useCollection");function P(O){const{getCollection:I}=i(t+"CollectionConsumer",O);return I}return Or(P,"useGetCollection"),[{Provider:c,Slot:v,ItemSlot:x},{createCollectionScope:r,useCollection:C,useGetCollection:P,useInitCollection:k}]}Or(f7,"createCollection");function h7(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}Or(h7,"shallowEqual");function p7(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Or(p7,"isElementPreceding");function m7(t){let e;for(const n of t.keys()){if(e){const r=e.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}e=n}return!0}Or(m7,"isInDocumentOrder");function mv(t,e){return!t[1].element||!e[1].element?0:p7(t[1].element,e[1].element)?-1:1}Or(mv,"sortByDocumentPosition");function g7(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Or(g7,"getChildListObserver");var yge=Object.defineProperty,Bm=(t,e)=>yge(t,"name",{value:e,configurable:!0}),w6="Collapsible",[_ge,v7]=ha(w6),[wge,b6]=_ge(w6),bge=g.forwardRef(Bm(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...c}=e,[d,f]=kc({prop:s,defaultProp:i??!1,onChange:l,caller:w6});return S.jsx(wge,{scope:r,disabled:o,contentId:sa(),open:d,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),children:S.jsx(er.div,{"data-state":yy(d),"data-disabled":o?"":void 0,...c,ref:n})})},"Collapsible")),xge="CollapsibleTrigger",Sge=g.forwardRef(Bm(function(e,n){const{__scopeCollapsible:r,...s}=e,i=b6(xge,r);return S.jsx(er.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":yy(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:bn(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),y7="CollapsibleContent",kge=g.forwardRef(Bm(function(e,n){const{forceMount:r,...s}=e,i=b6(y7,e.__scopeCollapsible);return S.jsx(Sc,{present:r||i.open,children:({present:o})=>S.jsx(Ege,{...s,ref:n,present:o})})},"CollapsibleContent")),Ege=g.forwardRef(Bm(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=b6(y7,r),[c,d]=g.useState(s),f=g.useRef(null),h=xn(n,f),m=g.useRef(0),v=m.current,y=g.useRef(0),_=y.current,b=l.open||c,x=g.useRef(b),k=g.useRef(void 0);return g.useEffect(()=>{const C=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(C)},[]),ws(()=>{const C=f.current;if(C){k.current=k.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const P=C.getBoundingClientRect();m.current=P.height,y.current=P.width,x.current||(C.style.transitionDuration=k.current.transitionDuration,C.style.animationName=k.current.animationName),d(s)}},[l.open,s]),S.jsx(er.div,{"data-state":yy(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!b,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:b&&i})},"CollapsibleContentImpl"));function yy(t){return t?"open":"closed"}Bm(yy,"getState");var Cge=Object.defineProperty,Pge=(t,e)=>Cge(t,"name",{value:e,configurable:!0}),Tge={LTR:"ltr"},Rge=g.createContext(void 0);function x6(t){const e=g.useContext(Rge);return t||e||Tge.LTR}Pge(x6,"useDirection");var Age=Object.defineProperty,Pi=(t,e)=>Age(t,"name",{value:e,configurable:!0}),Ige={Multiple:"multiple"},Xh={Vertical:"vertical",Horizontal:"horizontal"},Oge={LTR:"ltr"},pa="Accordion",Mge=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[S6,{useGetCollection:Nge,createCollectionScope:Lge}]=f7(pa),[_y,_ye]=ha(pa,[Lge,v7]),k6=v7(),_7=g.forwardRef(Pi(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(S6.Provider,{scope:e.__scopeAccordion,children:r===Ige.Multiple?S.jsx(jge,{...o,ref:n}):S.jsx(Fge,{...i,ref:n})})},"Accordion")),[w7,Dge]=_y(pa),[b7,$ge]=_y(pa,{collapsible:!1}),Fge=g.forwardRef(Pi(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Pi(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[c,d]=kc({prop:r,defaultProp:s??"",onChange:i,caller:pa});return S.jsx(w7,{scope:e.__scopeAccordion,value:g.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:g.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(b7,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(x7,{...l,ref:n})})})},"AccordionImplSingle")),jge=g.forwardRef(Pi(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Pi(()=>{},"onValueChange"),...o}=e,[l,c]=kc({prop:r,defaultProp:s??[],onChange:i,caller:pa}),d=g.useCallback(h=>c((m=[])=>[...m,h]),[c]),f=g.useCallback(h=>c((m=[])=>m.filter(v=>v!==h)),[c]);return S.jsx(w7,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx(b7,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(x7,{...o,ref:n})})})},"AccordionImplMultiple")),[zge,wy]=_y(pa),x7=g.forwardRef(Pi(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o=Xh.Vertical,...l}=e,c=g.useRef(null),d=xn(c,n),f=Nge(r),m=x6(i)===Oge.LTR,v=bn(e.onKeyDown,y=>{var L;if(!Mge.includes(y.key))return;const _=f(),b=y.target,x=_.filter(([,z])=>!z.element.disabled),k=x.findIndex(([,z])=>z.element===b),C=x.size;if(k===-1)return;y.preventDefault();let P=k;const R=0,O=C-1,I=Pi(()=>{P=k+1,P>O&&(P=R)},"moveNext"),A=Pi(()=>{P=k-1,P<R&&(P=O)},"movePrev");switch(y.key){case"Home":P=R;break;case"End":P=O;break;case"ArrowRight":o===Xh.Horizontal&&(m?I():A());break;case"ArrowDown":o===Xh.Vertical&&I();break;case"ArrowLeft":o===Xh.Horizontal&&(m?A():I());break;case"ArrowUp":o===Xh.Vertical&&A();break}const M=P%C;(L=x.at(M))==null||L.element.focus()});return S.jsx(zge,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(S6.Slot,{scope:r,children:S.jsx(er.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),LS="AccordionItem",[Vge,E6]=_y(LS),Hge=g.forwardRef(Pi(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=wy(LS,r),l=Dge(LS,r),c=k6(r),d=sa(),f=s&&l.value.includes(s)||!1,h=o.disabled||e.disabled;return S.jsx(Vge,{scope:r,open:f,disabled:h,triggerId:d,children:S.jsx(bge,{"data-orientation":o.orientation,"data-state":C6(f),...c,...i,ref:n,disabled:h,open:f,onOpenChange:m=>{m?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),Uge="AccordionHeader",Bge=g.forwardRef(Pi(function(e,n){const{__scopeAccordion:r,...s}=e,i=wy(pa,r),o=E6(Uge,r);return S.jsx(er.h3,{"data-orientation":i.orientation,"data-state":C6(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),LO="AccordionTrigger",Zge=g.forwardRef(Pi(function(e,n){const{__scopeAccordion:r,...s}=e,i=wy(pa,r),o=E6(LO,r),l=$ge(LO,r),c=k6(r);return S.jsx(S6.ItemSlot,{scope:r,children:S.jsx(Sge,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),Wge="AccordionContent",Kge=g.forwardRef(Pi(function(e,n){const{__scopeAccordion:r,...s}=e,i=wy(pa,r),o=E6(Wge,r),l=k6(r);return S.jsx(kge,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function C6(t){return t?"open":"closed"}Pi(C6,"getState");/**
218
- * @license lucide-react v1.70.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const qge=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
223
- * @license lucide-react v1.70.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */function Gge(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:qge(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
228
- * @license lucide-react v1.70.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const Yge=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
233
- * @license lucide-react v1.70.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const Xge=t=>{const e=Yge(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
238
- * @license lucide-react v1.70.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const DS=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
243
- * @license lucide-react v1.70.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const tu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
248
- * @license lucide-react v1.70.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */function Jw(t){return t!=null}function Qge(t,e={}){var m,v;const n=e.attributeNames??{},r=y=>n[y]??y,s=t.size??t.width??tu.width,i=t.size??t.height??tu.height,o=((m=t.aliases)==null?void 0:m.filter(y=>typeof y=="string"&&y.trim()!=="").map(y=>`lucide-${y}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],c=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?DS(...c):DS("lucide",...l,...c),f=e.absoluteStrokeWidth?Number(e.strokeWidth??tu["stroke-width"])*Number(t.size??t.width??tu.width)/Number(e.size??e.width??tu.width):e.strokeWidth??tu["stroke-width"];return["svg",{...Object.entries(tu).reduce((y,[_,b])=>(y[r(_)]=b,y),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&Jw(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&Jw(e.width)&&{[r("width")]:e.width},..."height"in e&&Jw(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:f,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(y=>{const[_,b,x]=y,k=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...b}:b;return x?[_,k,x]:[_,k]})]}/**
253
- * @license lucide-react v1.70.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */function Jge(t,e={}){return Qge(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
258
- * @license lucide-react v1.70.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const eve=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},tve=g.createContext({}),nve=()=>g.useContext(tve),rve=g.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:c,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},m)=>{const{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:_=!1,nonScalingStroke:b=!1,color:x="currentColor",className:k=""}=nve()??{},C=!!c||eve(h),[P,R,O=[]]=Jge(f,{color:t??x,width:n??e??v,height:r??e??v,strokeWidth:s??y,absoluteStrokeWidth:i??_,nonScalingStroke:o??b,className:DS(k,l),hasA11yProp:C,attributes:h});return g.createElement(P,{ref:m,...R},[...O.map(([I,A])=>g.createElement(I,A)),...Array.isArray(c)?c:[c]])});/**
263
- * @license lucide-react v1.70.0 - ISC
264
- *
265
- * This source code is licensed under the ISC license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */function vt(t,e=[],n=[]){const r=typeof t=="string"?Gge(t,e,n):t,s=g.forwardRef(({className:i,...o},l)=>g.createElement(rve,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Xge(r.name)),s}/**
268
- * @license lucide-react v1.70.0 - ISC
269
- *
270
- * This source code is licensed under the ISC license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const S7={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};S7.node;const sve=vt(S7);/**
273
- * @license lucide-react v1.70.0 - ISC
274
- *
275
- * This source code is licensed under the ISC license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const k7={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};k7.node;const ive=vt(k7);/**
278
- * @license lucide-react v1.70.0 - ISC
279
- *
280
- * This source code is licensed under the ISC license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const E7={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};E7.node;const ove=vt(E7);/**
283
- * @license lucide-react v1.70.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const C7={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};C7.node;const ave=vt(C7);/**
288
- * @license lucide-react v1.70.0 - ISC
289
- *
290
- * This source code is licensed under the ISC license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const P7={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4",key:"5nuw1p"}],["path",{d:"M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294",key:"18ldcf"}],["path",{d:"M17.996 5.125a4 4 0 012.526 5.77",key:"1sdu8q"}],["path",{d:"M18 18a4 4 0 002-7.465",key:"7xqqvr"}],["path",{d:"M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517",key:"t46ysz"}],["path",{d:"M6 18a4 4 0 01-2-7.465",key:"1y2m15"}],["path",{d:"M6.004 5.125a4 4 0 00-2.526 5.77",key:"3cw1ss"}]]};P7.node;const lve=vt(P7);/**
293
- * @license lucide-react v1.70.0 - ISC
294
- *
295
- * This source code is licensed under the ISC license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const T7={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};T7.node;const cve=vt(T7);/**
298
- * @license lucide-react v1.70.0 - ISC
299
- *
300
- * This source code is licensed under the ISC license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */const R7={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};R7.node;const uve=vt(R7);/**
303
- * @license lucide-react v1.70.0 - ISC
304
- *
305
- * This source code is licensed under the ISC license.
306
- * See the LICENSE file in the root directory of this source tree.
307
- */const A7={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};A7.node;const dve=vt(A7);/**
308
- * @license lucide-react v1.70.0 - ISC
309
- *
310
- * This source code is licensed under the ISC license.
311
- * See the LICENSE file in the root directory of this source tree.
312
- */const I7={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};I7.node;const fve=vt(I7);/**
313
- * @license lucide-react v1.70.0 - ISC
314
- *
315
- * This source code is licensed under the ISC license.
316
- * See the LICENSE file in the root directory of this source tree.
317
- */const O7={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};O7.node;const hve=vt(O7);/**
318
- * @license lucide-react v1.70.0 - ISC
319
- *
320
- * This source code is licensed under the ISC license.
321
- * See the LICENSE file in the root directory of this source tree.
322
- */const M7={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};M7.node;const pve=vt(M7);/**
323
- * @license lucide-react v1.70.0 - ISC
324
- *
325
- * This source code is licensed under the ISC license.
326
- * See the LICENSE file in the root directory of this source tree.
327
- */const N7={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};N7.node;const mve=vt(N7);/**
328
- * @license lucide-react v1.70.0 - ISC
329
- *
330
- * This source code is licensed under the ISC license.
331
- * See the LICENSE file in the root directory of this source tree.
332
- */const L7={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};L7.node;const gve=vt(L7);/**
333
- * @license lucide-react v1.70.0 - ISC
334
- *
335
- * This source code is licensed under the ISC license.
336
- * See the LICENSE file in the root directory of this source tree.
337
- */const D7={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};D7.node;const vve=vt(D7);/**
338
- * @license lucide-react v1.70.0 - ISC
339
- *
340
- * This source code is licensed under the ISC license.
341
- * See the LICENSE file in the root directory of this source tree.
342
- */const $7={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};$7.node;const yve=vt($7);/**
343
- * @license lucide-react v1.70.0 - ISC
344
- *
345
- * This source code is licensed under the ISC license.
346
- * See the LICENSE file in the root directory of this source tree.
347
- */const F7={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};F7.node;const _ve=vt(F7);/**
348
- * @license lucide-react v1.70.0 - ISC
349
- *
350
- * This source code is licensed under the ISC license.
351
- * See the LICENSE file in the root directory of this source tree.
352
- */const j7={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};j7.node;const wve=vt(j7);/**
353
- * @license lucide-react v1.70.0 - ISC
354
- *
355
- * This source code is licensed under the ISC license.
356
- * See the LICENSE file in the root directory of this source tree.
357
- */const z7={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};z7.node;const bve=vt(z7);/**
358
- * @license lucide-react v1.70.0 - ISC
359
- *
360
- * This source code is licensed under the ISC license.
361
- * See the LICENSE file in the root directory of this source tree.
362
- */const V7={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};V7.node;const xve=vt(V7);/**
363
- * @license lucide-react v1.70.0 - ISC
364
- *
365
- * This source code is licensed under the ISC license.
366
- * See the LICENSE file in the root directory of this source tree.
367
- */const H7={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};H7.node;const Sve=vt(H7);/**
368
- * @license lucide-react v1.70.0 - ISC
369
- *
370
- * This source code is licensed under the ISC license.
371
- * See the LICENSE file in the root directory of this source tree.
372
- */const U7={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};U7.node;const kve=vt(U7);/**
373
- * @license lucide-react v1.70.0 - ISC
374
- *
375
- * This source code is licensed under the ISC license.
376
- * See the LICENSE file in the root directory of this source tree.
377
- */const B7={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};B7.node;const Eve=vt(B7);/**
378
- * @license lucide-react v1.70.0 - ISC
379
- *
380
- * This source code is licensed under the ISC license.
381
- * See the LICENSE file in the root directory of this source tree.
382
- */const Z7={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};Z7.node;const Cve=vt(Z7);/**
383
- * @license lucide-react v1.70.0 - ISC
384
- *
385
- * This source code is licensed under the ISC license.
386
- * See the LICENSE file in the root directory of this source tree.
387
- */const W7={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};W7.node;const Pve=vt(W7);/**
388
- * @license lucide-react v1.70.0 - ISC
389
- *
390
- * This source code is licensed under the ISC license.
391
- * See the LICENSE file in the root directory of this source tree.
392
- */const K7={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};K7.node;const Tve=vt(K7);/**
393
- * @license lucide-react v1.70.0 - ISC
394
- *
395
- * This source code is licensed under the ISC license.
396
- * See the LICENSE file in the root directory of this source tree.
397
- */const q7={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};q7.node;const Rve=vt(q7);/**
398
- * @license lucide-react v1.70.0 - ISC
399
- *
400
- * This source code is licensed under the ISC license.
401
- * See the LICENSE file in the root directory of this source tree.
402
- */const G7={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};G7.node;const Ave=vt(G7);/**
403
- * @license lucide-react v1.70.0 - ISC
404
- *
405
- * This source code is licensed under the ISC license.
406
- * See the LICENSE file in the root directory of this source tree.
407
- */const Y7={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};Y7.node;const Ive=vt(Y7);/**
408
- * @license lucide-react v1.70.0 - ISC
409
- *
410
- * This source code is licensed under the ISC license.
411
- * See the LICENSE file in the root directory of this source tree.
412
- */const X7={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};X7.node;const Ove=vt(X7);/**
413
- * @license lucide-react v1.70.0 - ISC
414
- *
415
- * This source code is licensed under the ISC license.
416
- * See the LICENSE file in the root directory of this source tree.
417
- */const Q7={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Q7.node;const Mve=vt(Q7);/**
418
- * @license lucide-react v1.70.0 - ISC
419
- *
420
- * This source code is licensed under the ISC license.
421
- * See the LICENSE file in the root directory of this source tree.
422
- */const J7={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};J7.node;const Nve=vt(J7);/**
423
- * @license lucide-react v1.70.0 - ISC
424
- *
425
- * This source code is licensed under the ISC license.
426
- * See the LICENSE file in the root directory of this source tree.
427
- */const ez={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};ez.node;const Lve=vt(ez);/**
428
- * @license lucide-react v1.70.0 - ISC
429
- *
430
- * This source code is licensed under the ISC license.
431
- * See the LICENSE file in the root directory of this source tree.
432
- */const tz={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};tz.node;const Dve=vt(tz);/**
433
- * @license lucide-react v1.70.0 - ISC
434
- *
435
- * This source code is licensed under the ISC license.
436
- * See the LICENSE file in the root directory of this source tree.
437
- */const nz={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};nz.node;const $ve=vt(nz);/**
438
- * @license lucide-react v1.70.0 - ISC
439
- *
440
- * This source code is licensed under the ISC license.
441
- * See the LICENSE file in the root directory of this source tree.
442
- */const rz={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};rz.node;const Fve=vt(rz);/**
443
- * @license lucide-react v1.70.0 - ISC
444
- *
445
- * This source code is licensed under the ISC license.
446
- * See the LICENSE file in the root directory of this source tree.
447
- */const sz={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};sz.node;const jve=vt(sz);/**
448
- * @license lucide-react v1.70.0 - ISC
449
- *
450
- * This source code is licensed under the ISC license.
451
- * See the LICENSE file in the root directory of this source tree.
452
- */const iz={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};iz.node;const zve=vt(iz);/**
453
- * @license lucide-react v1.70.0 - ISC
454
- *
455
- * This source code is licensed under the ISC license.
456
- * See the LICENSE file in the root directory of this source tree.
457
- */const oz={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};oz.node;const Vve=vt(oz);/**
458
- * @license lucide-react v1.70.0 - ISC
459
- *
460
- * This source code is licensed under the ISC license.
461
- * See the LICENSE file in the root directory of this source tree.
462
- */const az={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};az.node;const Hve=vt(az);/**
463
- * @license lucide-react v1.70.0 - ISC
464
- *
465
- * This source code is licensed under the ISC license.
466
- * See the LICENSE file in the root directory of this source tree.
467
- */const lz={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};lz.node;const Uve=vt(lz);/**
468
- * @license lucide-react v1.70.0 - ISC
469
- *
470
- * This source code is licensed under the ISC license.
471
- * See the LICENSE file in the root directory of this source tree.
472
- */const cz={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};cz.node;const Bve=vt(cz);/**
473
- * @license lucide-react v1.70.0 - ISC
474
- *
475
- * This source code is licensed under the ISC license.
476
- * See the LICENSE file in the root directory of this source tree.
477
- */const uz={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};uz.node;const Zve=vt(uz);/**
478
- * @license lucide-react v1.70.0 - ISC
479
- *
480
- * This source code is licensed under the ISC license.
481
- * See the LICENSE file in the root directory of this source tree.
482
- */const dz={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};dz.node;const Wve=vt(dz);/**
483
- * @license lucide-react v1.70.0 - ISC
484
- *
485
- * This source code is licensed under the ISC license.
486
- * See the LICENSE file in the root directory of this source tree.
487
- */const fz={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};fz.node;const Kve=vt(fz);/**
488
- * @license lucide-react v1.70.0 - ISC
489
- *
490
- * This source code is licensed under the ISC license.
491
- * See the LICENSE file in the root directory of this source tree.
492
- */const hz={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};hz.node;const qve=vt(hz);/**
493
- * @license lucide-react v1.70.0 - ISC
494
- *
495
- * This source code is licensed under the ISC license.
496
- * See the LICENSE file in the root directory of this source tree.
497
- */const pz={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};pz.node;const Gve=vt(pz),Yve={"chevron-right":dve,"chevron-down":uve,pipette:Nve,x:Gve,copy:pve,menu:Cve,dot:mve,monitor:Tve,sun:Wve,moon:Rve,"rectangle-horizontal":$ve,circle:fve,"square-library":Bve,clock:hve,star:Zve,settings:Vve,plus:Dve,"arrow-left":sve,"arrow-right":ive,"arrow-up":ove,search:zve,loader:Sve,users:qve,lock:kve,mail:Eve,bell:ave,shield:Hve,palette:Ive,lightbulb:bve,rocket:Fve,heart:vve,paintbrush:Ave,brain:lve,globe:gve,user:Kve,image:_ve,link:xve,check:cve,"rotate-ccw":jve,play:Lve,pause:Ove,home:yve,"message-circle":Pve,inbox:wve,pencil:Mve,"skip-forward":Uve},DO={lucide:Yve},mz=g.createContext(null);function Xve(t){const e=g.useContext(mz);return e?DO[e.iconLibrary][t]:DO.lucide[t]}function Qve({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(mz.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const gz=g.createContext(null);function P6(){return g.useContext(gz)}const vz=g.createContext(null);function yz(){const t=g.useContext(vz);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Jve=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=g.useRef(null),l=g.useRef(new Map),[c,d]=g.useState(new Map),{activeIndex:f,setActiveIndex:h,itemRects:m,sessionRef:v,handlers:y,registerItem:_,measureItems:b}=_F(o),x=g.useCallback((le,se)=>{se?l.current.set(le,se):l.current.delete(le)},[]),k=g.useCallback(()=>{if(!o.current)return;const le=new Map;l.current.forEach((se,be)=>{le.set(be,{top:se.offsetTop,left:se.offsetLeft,width:se.offsetWidth,height:se.offsetHeight})}),d(le)},[]),[C,P]=g.useState(()=>r==="single"?t.defaultValue??"":""),[R,O]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),I=t.onValueChange,A=t.onValueChange,M=t.value,L=new Set(r==="multiple"?t.value??R:(()=>{const le=t.value??C;return le?[le]:[]})()),z=g.useCallback(le=>{const se=t;se.onValueChange?se.onValueChange(le):P(le)},[I]),$=g.useCallback(le=>{const se=t;se.onValueChange?se.onValueChange(le):O(le)},[A]),q=g.useCallback(le=>{if(r==="multiple"){const se=t.value??R;$(se.filter(be=>be!==le))}else z("")},[r,z,$,R,M]);g.useEffect(()=>{b(),k()},[b,k,n]);const X=[...L].join(",");g.useEffect(()=>{b(),k()},[b,k,X]);const[j,K]=g.useState(null),ee=f!==null?m[f]:null,H=j!==null?m[j]:null,Q=f!==null&&!c.has(f),B=Fm(),{value:D,defaultValue:G,onValueChange:fe,collapsible:ie,type:ue,...he}=i,we=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:$}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:z};return S.jsx(gz.Provider,{value:{registerItem:_,registerFullItem:x,activeIndex:f,grouped:!0,remeasure:()=>{b(),k()},openValues:L,openItemRects:c,toggleValue:q},children:S.jsx(_7,{...we,asChild:!0,children:S.jsxs("div",{ref:le=>{o.current=le,typeof e=="function"?e(le):e&&(e.current=le)},onMouseEnter:y.onMouseEnter,onMouseMove:le=>{const se=o.current;if(se){const be=se.getBoundingClientRect(),Se=se.offsetHeight,$e=be.height,kt=Se>0?$e/Se:1,tn=(le.clientY-be.top)/kt+se.scrollTop;for(const[nn,xt]of c){const Dt=m[nn];if(!Dt)continue;const un=Dt.top+Dt.height,Kt=xt.top+xt.height;if(tn>=un&&tn<=Kt){h(null);return}}}y.onMouseMove(le)},onMouseLeave:y.onMouseLeave,onFocus:le=>{var be;const se=(be=le.target.closest("[data-proximity-index]"))==null?void 0:be.getAttribute("data-proximity-index");if(se!=null){const Se=Number(se);h(Se),K(le.target.matches(":focus-visible")?Se:null)}},onBlur:le=>{var se;(se=o.current)!=null&&se.contains(le.relatedTarget)||(K(null),h(null))},className:mn("relative flex flex-col gap-0.5 w-72 max-w-full",s),...he,children:[S.jsx(Ei,{children:[...c.entries()].map(([le,se])=>S.jsx(Nr.div,{className:`absolute ${B.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:se.top,left:se.left,width:se.width,height:se.height,opacity:Q?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${le}`))}),S.jsx(Ei,{children:ee&&S.jsx(Nr.div,{className:`absolute ${B.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:ee.top,left:ee.left,width:ee.width,height:ee.height},animate:{opacity:1,top:ee.top,left:ee.left,width:ee.width,height:ee.height},exit:{opacity:0,transition:{duration:.06}},transition:{...pc.fast,opacity:{duration:.08}}},v.current)}),S.jsx(Ei,{children:H&&S.jsx(Nr.div,{className:`absolute ${B.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:H.left-2,top:H.top-2,width:H.width+4,height:H.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...pc.fast,opacity:{duration:.08}}})}),n]})})})});Jve.displayName="AccordionGroup";const _z=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},c)=>{const[d,f]=g.useState(()=>e==="single"?r??"":""),[h,m]=g.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??h:(()=>{const k=s??d;return k?[k]:[]})()),y=g.useCallback(k=>{i?i(k):f(k)},[i]),_=g.useCallback(k=>{i?i(k):m(k)},[i]),b=g.useCallback(k=>{e==="multiple"?_((s??h).filter(P=>P!==k)):y("")},[e,s,h,y,_]),x=e==="multiple"?{type:"multiple",value:s??h,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:y};return S.jsx(_7,{...x,asChild:!0,children:S.jsx("div",{ref:c,className:mn("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx(wz.Provider,{value:v,children:S.jsx(bz.Provider,{value:b,children:t})})})})});_z.displayName="Accordion";const wz=g.createContext(new Set),bz=g.createContext(()=>{}),xz=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=g.useRef(null),c=P6(),d=g.useContext(wz),f=g.useContext(bz),h=Fm(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),v=g.useRef(null),y=g.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):f(t)},[c,f,t]);return g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,v.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,l.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),S.jsx(vz.Provider,{value:{index:e,value:t,isOpen:m,onToggle:y,triggerRef:v},children:S.jsxs(Hge,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:mn(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(Ei,{children:m&&S.jsx(Nr.div,{className:`absolute inset-0 ${h.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});xz.displayName="AccordionItem";const Sz=g.forwardRef(({children:t,className:e,...n},r)=>{const s=Xve("chevron-right"),i=P6(),{index:o,isOpen:l,triggerRef:c}=yz(),d=Fm(),[f,h]=g.useState(!1),m=i!=null&&i.grouped?i.activeIndex===o:f,v=S.jsx(Bge,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Zge,{ref:r,className:mn(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Ip.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:mn("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?Ip.semibold:Ip.normal},children:t})]}),S.jsx(Nr.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:pc.fast,children:S.jsx(s,{size:16,strokeWidth:l||m?2:1.5,className:mn("transition-[color,stroke-width] duration-80",l||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:v}):S.jsxs("div",{className:"relative",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[S.jsx(Ei,{children:f&&S.jsx(Nr.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});Sz.displayName="AccordionTrigger";const kz=g.forwardRef(({children:t,className:e,...n},r)=>{const s=P6(),{isOpen:i}=yz();return S.jsx(Ei,{initial:!1,children:i&&S.jsx(Kge,{forceMount:!0,asChild:!0,...n,children:S.jsx(Nr.div,{ref:r,className:mn("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...pc.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});kz.displayName="AccordionContent";const gv=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(_z,{type:"multiple",defaultValue:e,className:mn("w-full",n),children:t}),e1e=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(xz,{value:t,className:mn("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(Sz,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(kz,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};gv.Item=e1e;const t1e=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(q1,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),n1e=()=>{const[t,e]=g.useState(0);return g.useEffect(()=>{const n=Date.now(),r=setInterval(()=>e(Math.max(0,Math.floor((Date.now()-n)/1e3))),1e3);return()=>clearInterval(r)},[]),t},r1e=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},$O="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",FO="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",s1e="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",vv=["Applying","Thinking","Planning","Crafting"],i1e=vv.reduce((t,e)=>t.length>=e.length?t:e),o1e=20,a1e="Still working — runs can take a few minutes.",l1e=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=n1e();g.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%vv.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=o1e?a1e:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(Nr.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(Nr.path,{animate:{d:[$O,FO,s1e,FO,$O]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Ip.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:i1e}),S.jsx(Ei,{mode:"popLayout",initial:!1,children:S.jsx(Nr.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:vv[n]},vv[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:r1e(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var c1e=Object.defineProperty,u1e=(t,e)=>c1e(t,"name",{value:e,configurable:!0});function T1(t,[e,n]){return Math.min(n,Math.max(e,t))}u1e(T1,"clamp");var d1e=Object.defineProperty,Yt=(t,e)=>d1e(t,"name",{value:e,configurable:!0}),jO={Horizontal:"horizontal"},f1e={LTR:"ltr"},Ez=["PageUp","PageDown"],Cz=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Pz={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Zm="Slider",[$S,h1e,p1e]=u7(Zm),[T6,wye]=ha(Zm,[p1e]),[m1e,nh]=T6(Zm),g1e=g.forwardRef(Yt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l=jO.Horizontal,disabled:c=!1,minStepsBetweenThumbs:d=0,preserveThumbOrder:f=!1,defaultValue:h=[s],value:m,onValueChange:v=Yt(()=>{},"onValueChange"),onValueCommit:y=Yt(()=>{},"onValueCommit"),inverted:_=!1,form:b,...x}=e,k=g.useRef(new Set),C=g.useRef(0),P=g.useRef(!1),[R,O]=g.useState(null),A=l===jO.Horizontal?v1e:y1e,[M,L]=g.useState(null),z=xn(n,L),[$=[],q]=kc({prop:m,defaultProp:h,onChange:Yt(B=>{var G;(G=[...k.current][C.current])==null||G.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,v(B)},"onChange")}),X=g.useRef($),j=g.useRef($);g.useEffect(()=>{const B=b?M==null?void 0:M.ownerDocument.getElementById(b):M==null?void 0:M.closest("form");if(B instanceof HTMLFormElement){const D=Yt(()=>q(j.current),"reset");return B.addEventListener("reset",D),()=>B.removeEventListener("reset",D)}},[M,b,q]);function K(B){const D=Lz($,B);Q(B,D)}Yt(K,"handleSlideStart");function ee(B){Q(B,C.current)}Yt(ee,"handleSlideMove");function H(){String($)!==String(X.current)&&y($)}Yt(H,"handleSlideEnd");function Q(B,D,{commit:G}={commit:!1}){const fe=A6(o),ie=Lp(Math.round((B-s)/o)*o+s,fe),ue=T1(ie,[s,i]),he=d*o;function we(se){const be=f?T1(ue,[se[D-1]===void 0?s:se[D-1]+he,se[D+1]===void 0?i:se[D+1]-he]):ue,Se=Mz(se,be,D);return Fz(Se,he)?{nextValues:Se,changedIndex:f?D:Se.indexOf(be),hasChanged:String(Se)!==String(se)}:null}Yt(we,"getNextValues");const le=we($);le!=null&&le.hasChanged&&O(le.nextValues),q((se=[])=>{const be=we(se);return be?(C.current=be.changedIndex,be.hasChanged&&G&&y(be.nextValues),be.hasChanged?be.nextValues:se):se})}return Yt(Q,"updateValues"),S.jsx(m1e,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:C,thumbs:k.current,values:$,orientation:l,form:b,userRequestedValues:R,children:S.jsx($S.Provider,{scope:e.__scopeSlider,children:S.jsx($S.Slot,{scope:e.__scopeSlider,children:S.jsx(A,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:z,onPointerDown:bn(x.onPointerDown,()=>{c||(X.current=$,P.current=!1)}),min:s,max:i,inverted:_,onSlideStart:c?void 0:K,onSlideMove:c?void 0:ee,onSlideEnd:c?void 0:H,onHomeKeyDown:()=>{c||(P.current=!0,Q(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(P.current=!0,Q(i,$.length-1,{commit:!0}))},onStepKeyDown:({event:B,direction:D})=>{if(!c){P.current=!0;const ie=Ez.includes(B.key)||B.shiftKey&&Cz.includes(B.key)?10:1,ue=C.current,he=$[ue],we=jz(he,{min:s,step:o,direction:D,multiplier:ie});Q(we,ue,{commit:!0})}}})})})})},"Slider")),[Tz,Rz]=T6(Zm,{startEdge:"left",endEdge:"right",size:"width",direction:1}),v1e=g.forwardRef(Yt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[m,v]=g.useState(null),y=xn(n,v),_=g.useRef(void 0),b=x6(i),x=b===f1e.LTR,k=x&&!o||!x&&o;function C(P){const R=_.current||m.getBoundingClientRect(),O=[0,R.width],A=by(O,k?[r,s]:[s,r]);return _.current=R,A(P-R.left)}return Yt(C,"getValueFromPointer"),S.jsx(Tz,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:S.jsx(Az,{dir:b,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const R=C(P.clientX);l==null||l(R)},onSlideMove:P=>{const R=C(P.clientX);c==null||c(R)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:P=>{const O=Pz[k?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:O?-1:1})}})})},"SliderHorizontal")),y1e=g.forwardRef(Yt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=g.useRef(null),m=xn(n,h),v=g.useRef(void 0),y=!i;function _(b){const x=v.current||h.current.getBoundingClientRect(),k=[0,x.height],P=by(k,y?[s,r]:[r,s]);return v.current=x,P(b-x.top)}return Yt(_,"getValueFromPointer"),S.jsx(Tz,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:S.jsx(Az,{"data-orientation":"vertical",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const x=_(b.clientY);o==null||o(x)},onSlideMove:b=>{const x=_(b.clientY);l==null||l(x)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:b=>{const k=Pz[y?"from-bottom":"from-top"].includes(b.key);d==null||d({event:b,direction:k?-1:1})}})})},"SliderVertical")),Az=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=nh(Zm,r);return S.jsx(er.span,{...f,ref:n,onKeyDown:bn(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):Ez.concat(Cz).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:bn(e.onPointerDown,m=>{const v=m.target;v.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:bn(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:bn(e.onPointerUp,m=>{const v=m.target;v.hasPointerCapture(m.pointerId)&&(v.releasePointerCapture(m.pointerId),o(m))})})},"SliderImpl")),_1e="SliderTrack",w1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,...s}=e,i=nh(_1e,r);return S.jsx(er.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),zO="SliderRange",b1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,...s}=e,i=nh(zO,r),o=Rz(zO,r),l=g.useRef(null),c=xn(n,l),d=i.values.length,f=i.values.map(v=>R6(v,i.min,i.max)),h=d>1?Math.min(...f):0,m=100-Math.max(...f);return S.jsx(er.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:m+"%"}})},"SliderRange")),x1e="SliderThumb",[S1e,Iz]=T6(x1e),k1e="SliderThumbProvider";function Oz(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=nh(k1e,e),o=h1e(e),[l,c]=g.useState(null),d=g.useMemo(()=>l?o().findIndex(b=>b.ref.current===l):-1,[o,l]),f=AE(l),h=l?!!i.form||!!l.closest("form"):!0,m=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),y=m===void 0?0:R6(m,i.min,i.max);g.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:m,name:v,form:i.form,isFormControl:h,index:d,thumb:l,onThumbChange:c,percent:y,size:f};return S.jsx(S1e,{scope:e,..._,children:zz(s)?s(_):r})}Yt(Oz,"SliderThumbProvider");var eb="SliderThumbTrigger",E1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,...s}=e,i=nh(eb,r),o=Rz(eb,r),{index:l,value:c,percent:d,size:f,onThumbChange:h}=Iz(eb,r),m=xn(n,h),v=Nz(l,i.values.length),y=f==null?void 0:f[o.size],_=y?Dz(y,d,o.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx($S.ItemSlot,{scope:r,children:S.jsx(er.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:c===void 0?{display:"none"}:e.style,onFocus:bn(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),C1e=g.forwardRef(Yt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(Oz,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(E1e,{...i,ref:n,__scopeSlider:r}),l?S.jsx(P1e,{__scopeSlider:r},o):null]})})},"SliderThumb")),VO="SliderBubbleInput",P1e=g.forwardRef(Yt(function({__scopeSlider:e,onInput:n,...r},s){const{index:i,value:o,name:l,form:c}=Iz(VO,e),{userRequestedValues:d}=nh(VO,e),f=g.useRef(null),h=xn(f,s),m=g.useRef(!1),v=g.useRef(o),y=g.useRef(d),_=g.useRef(d);return g.useEffect(()=>{const b=f.current;if(!b)return;const x=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(x,"value").set,P=v.current,R=P!==o;v.current=o;const O=d!==_.current;if(_.current=d,R&&C){const I=d!==y.current;y.current=d;const A=d==null?void 0:d[i],M=I&&(O&&A!==P||A===o);m.current=!M;const L=new Event("input",{bubbles:!0});C.call(b,o),b.dispatchEvent(L),m.current=!1}},[i,o,d]),S.jsx(er.input,{style:{display:"none"},name:l,form:c,...r,ref:h,defaultValue:o,onInput:bn(n,b=>{m.current&&b.stopPropagation()})})},"SliderBubbleInput"));function Mz(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Yt(Mz,"getNextSortedValues");function R6(t,e,n){const i=100/(n-e)*(t-e);return T1(i,[0,100])}Yt(R6,"convertValueToPercentage");function Nz(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Yt(Nz,"getLabel");function Lz(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}Yt(Lz,"getClosestValueIndex");function Dz(t,e,n){const r=t/2,i=by([0,50],[0,r]);return(r-i(e)*n)*n}Yt(Dz,"getThumbInBoundsOffset");function $z(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Yt($z,"getStepsBetweenValues");function Fz(t,e){if(e>0){const n=$z(t);return Math.min(...n)>=e}return!0}Yt(Fz,"hasMinStepsBetweenValues");function by(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}Yt(by,"linearScale");function A6(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}Yt(A6,"getDecimalCount");function Lp(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Yt(Lp,"roundValue");function jz(t,{min:e,step:n,direction:r,multiplier:s}){const i=A6(n),o=(t-e)/n,l=Math.round(o),c=Lp(l*n+e,i)===Lp(t,i);let d;return c?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),Lp(d*n+e,i)}Yt(jz,"getNextStepValue");function zz(t){return typeof t=="function"}Yt(zz,"isFunction");const FS=g.forwardRef(({className:t,...e},n)=>S.jsxs(g1e,{ref:n,className:mn("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(w1e,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(b1e,{className:"absolute h-full bg-primary"})}),S.jsx(C1e,{className:mn("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));FS.displayName="Slider";const T1e=[{name:"surface-1",utility:"bg-surface-1",className:"bg-surface-1"},{name:"surface-2",utility:"bg-surface-2",className:"bg-surface-2"},{name:"surface-3",utility:"bg-surface-3",className:"bg-surface-3"},{name:"surface-4",utility:"bg-surface-4",className:"bg-surface-4"},{name:"surface-5",utility:"bg-surface-5",className:"bg-surface-5"},{name:"surface-6",utility:"bg-surface-6",className:"bg-surface-6"}],R1e=[{name:"primary",utility:"bg-primary",className:"bg-primary"},{name:"selected",utility:"bg-selected",className:"bg-selected"},{name:"accent",utility:"bg-accent",className:"bg-accent"},{name:"success",utility:"bg-accent-success",className:"bg-accent-success"},{name:"warning",utility:"bg-accent-warning",className:"bg-accent-warning"},{name:"error",utility:"bg-accent-error",className:"bg-accent-error"}],A1e=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],Ng=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],I1e=()=>{window.location.hash=""},Aa=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),HO=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),O1e=t=>t==="showcased"?"border-accent-success/40 bg-accent-success/10 text-accent-success":t==="cataloged"?"border-primary/40 bg-primary/10 text-primary":t==="generated"?"border-accent/40 bg-accent/10 text-accent":t==="unsuitable"?"border-accent-warning/40 bg-accent-warning/10 text-accent-warning":"border-border bg-surface-4 text-content-muted",M1e=()=>{const t=Ng.filter(n=>n.status==="showcased").length,e=Ng.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:I1e,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(Sae,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(b9,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Aa,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(ia,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),S.jsx(ia,{title:"Secondary action",variant:"secondary",children:"Secondary"}),S.jsx(ia,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),S.jsx(NF,{primaryLabel:"Ship",primaryIcon:ww,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(zu,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(LE,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Aa,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(HO,{swatches:T1e})}),S.jsx(Aa,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(HO,{swatches:R1e})}),S.jsx(Aa,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Aa,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:A1e.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Aa,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(gv,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(gv.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(ww,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(gv.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(FS,{defaultValue:[64],max:100,step:1}),S.jsx(FS,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Aa,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(t1e,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(KE,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(l1e,{hint:"Reading selected elements"})})]})}),S.jsx(Aa,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(bS,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(fj,{icon:S.jsx(ww,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(JE,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Aa,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:Ng.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:Ng.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${O1e(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},N1e=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",jS=274,R1=395,tb=Math.min(R1,Math.round((jS+R1)/2*1.1)),UO="rivet:panelWidth:v2",L1e=({projectPath:t,libraryOrigin:e})=>{const n=St(CF)>0,[r,s]=QD(kF),i=Ii(),o=vie(),l=g.useCallback(L=>{const z=!r;i==null||i.capture("editor.ui_toggled",{source:L,isOpen:z}),s(z)},[r,i,s]),[c,d]=g.useState(()=>{if(typeof window>"u")return tb;const L=Number(window.localStorage.getItem(UO));return Number.isFinite(L)&&L>=jS&&L<=R1?L:tb}),[f,h]=g.useState(!1),[m,v]=g.useState(J0e),y=r?c:0,_=r?pc.slow:pc.moderate,[b,x]=g.useState(r);!r&&b&&x(!1);const[k,C]=g.useState(0);y!==k&&(C(y),r&&v(L=>Q0e({position:L,boundsLeftPx:c}))),g.useEffect(()=>{window.localStorage.setItem(UO,String(c))},[c]),g.useEffect(()=>{const L=z=>{if(!ZD(z.target)){if(phe(z)){z.preventDefault(),l("shortcut");return}z.key!=="Escape"||!r||(z.preventDefault(),s(!1))}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[r,s,l]);const P=g.useCallback(L=>{L.preventDefault(),L.stopPropagation();const z=L.clientX,$=c;h(!0);const q=j=>{const K=Math.min(R1,Math.max(jS,$+(j.clientX-z)));d(K)},X=()=>{window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",X),window.removeEventListener("pointercancel",X),h(!1)};window.addEventListener("pointermove",q),window.addEventListener("pointerup",X),window.addEventListener("pointercancel",X)},[c]),R=g.useCallback(()=>d(tb),[]),O=hge(),I=St(fy);gge({enabled:!I});const A=O.isProcessing?"Completing authentication...":null,M=Nt(dy);return g.useEffect(()=>{M(t??null)},[t,M]),S.jsxs(Nr.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[A!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(j0e,{message:A})}):null,S.jsx(hme,{}),S.jsx(S.Fragment,{children:n?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:b?c:0},children:S.jsxs(Nr.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:r?0:-c},transition:o?{duration:0}:_,onAnimationComplete:()=>{r&&x(!0)},style:{width:c,willChange:"transform"},children:[S.jsx(gpe,{onClose:()=>s(!1),libraryOrigin:e}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:P,onDoubleClick:R,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${f?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),f&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(nge,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!o,position:m,dragBoundsLeftPx:y,onPositionChange:v,onToggle:()=>l("click")})]})}),S.jsx(Yoe,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},zS="rivet_connect_deep_link",D1e=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(zS);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(zS,n),e){t.delete("connect");const r=t.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},$1e=D1e(),F1e=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(v1)==="1"),[r,s]=g.useState(!1),[i,o]=g.useState($1e);g.useEffect(()=>{n&&window.sessionStorage.removeItem(v1)},[n]);const{config:l,refetchConfig:c,loading:d,error:f}=fge(),h=Nt(fy),{startLogin:m,isStartingLogin:v,loginError:y}=ej(),[_,b]=g.useState(!1);Hie(l??void 0),g.useEffect(()=>{l&&Xe.register({source:"visual_editor",surface:"visual_editor"})},[l]);const x=l!=null&&l.agentModeAvailable!==!0,k=N1e(t),C=g.useCallback(async()=>{b(!0),h(!0);try{await c()}finally{h(!1),b(!1)}},[c,h]);if(g.useEffect(()=>{const I=()=>{const A=window.location.hash;e(A)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]),k==="design-system")return S.jsx(M1e,{});if(!d&&l===null&&!_){const I=f||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-muted mt-2 text-xs",children:I}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{C()},children:"Retry"})]})})}if(x)return S.jsx($0e,{isSigningIn:v,onStartSignIn:()=>{m()},errorMessage:y,displayMode:"full"});const R=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,O=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!R;return S.jsxs(S.Fragment,{children:[S.jsx(L1e,{projectPath:l==null?void 0:l.projectPath,libraryOrigin:(l==null?void 0:l.libraryOrigin)??null}),S.jsx(yS,{context:"onboarding",isOpen:O,onClose:()=>s(!0)}),S.jsx(yS,{context:"menu",isOpen:R,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(zS),o(null)}})]})};PH();const j1e=g.lazy(()=>t4(()=>import("./LibraryEntry-BE8nZneH.js"),[])),I6=window.location.pathname.startsWith("/rivet/library");I6||Lie();const z1e=new lee,V1e=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),Vz=document.getElementById("root");if(!Vz)throw new Error("Rivet root element is missing");const H1e=()=>Vie.createRoot(Vz).render(S.jsx(Ce.StrictMode,{children:S.jsx(hse,{reducedMotion:"user",children:S.jsx(bie,{client:Xe,children:S.jsx(Pie,{fallback:S.jsx(V1e,{}),children:S.jsx(DJ,{client:z1e,children:S.jsx(jle,{defaultShape:"rounded",children:S.jsx(Qve,{defaultLibrary:"lucide",children:I6?S.jsx(g.Suspense,{fallback:S.jsx("div",{className:"bg-background h-screen"}),children:S.jsx(j1e,{})}):S.jsx(F1e,{})})})})})})})})),U1e=async()=>{I6&&await PJ(),await LJ(),H1e()};U1e();export{Pk as $,ly as A,ia as B,cy as C,sy as D,K1e as E,on as F,Ys as G,z0e as H,$m as I,zve as J,ZN as K,la as L,T9 as M,Js as N,cve as O,VE as P,nee as Q,Ap as R,qf as S,ze as T,W1e as U,Z1e as V,Rt as W,Gve as X,Im as Y,Dn as Z,re as _,cee as a,Xs as a0,gye as a1,vye as a2,TJ as a3,She as a4,mn as a5,oL as a6,X1e as a7,Y1e as a8,Hie as a9,dye as aa,fye as ab,sve as ac,mpe as ad,Yoe as ae,rye as af,sye as ag,mhe as ah,nye as ai,J1e as aj,Q1e as ak,G1e as al,q1e as am,eye as an,tye as ao,lye as ap,aye as aq,iye as ar,ej as as,Ft as at,jN as au,CJ as av,EJ as aw,oye as ax,fee as b,g as c,hee as d,gee as e,pee as f,Os as g,vee as h,yee as i,mee as j,vt as k,Ii as l,wF as m,Ir as n,S as o,Wx as p,HE as q,QN as r,Zg as s,UE as t,Om as u,BE as v,Mve as w,iy as x,oy as y,ay as z};
498
- //# sourceMappingURL=main-1EDrDqgn.js.map