1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Pricing-CaGzto4r.js","assets/motion-q8SSFiMo.js","assets/InitiatorCard-B9Y4jrE0.js","assets/plans-B2Ku3ku2.js","assets/loader-circle-DBeCKWPL.js","assets/chevron-down-CYRTuq30.js","assets/check-D_LREIWh.js","assets/accordion-BmQe9T5U.js","assets/radix-2geflnVV.js","assets/supabase-D2RGniRs.js","assets/Templates-hzjjGpVW.js","assets/Lightbox-D7h46otu.js","assets/MinimalVideoPlayer-JlEtjQLc.js","assets/play-BZBH4xvf.js","assets/chevron-right-DRRmAdVu.js","assets/user-CHCgGgV8.js","assets/image-DafDb55B.js","assets/useInfiniteRender-BBOkK26T.js","assets/useQuery-DEPyPS1X.js","assets/Login-dgnmimPN.js","assets/Turnstile-8mN8ih3E.js","assets/arrow-left-DMvIOxsM.js","assets/GoogleButton-CRijuG6x.js","assets/input-B6wToA6_.js","assets/label-DdG5RL9L.js","assets/Register-XVFmFS2I.js","assets/OtpInput-CG6u6RPo.js","assets/ForgotPassword-DIEyaeaH.js","assets/StartFree-Bh-COuIw.js","assets/RotatingRaysBackground-BMHgvGSu.js","assets/Watch-BmVrOEkB.js","assets/RefLanding-DthRtg7d.js","assets/affiliate-GL9z8I3B.js","assets/Privacy-B7A4JPxw.js","assets/Terms-DKhgqWBf.js","assets/AppUpgrade-9K5oy-KR.js","assets/useEmbeddedCheckout-DcJ9GWhg.js","assets/rotate-ccw-Sof4xruh.js","assets/useProfile-C_TRo4hf.js","assets/EmbeddedCheckoutModal-BRAkIRwz.js","assets/index-BprFrCRm.js","assets/checkoutAnalytics-CQVM-M2P.js","assets/AffiliateDashboard-CHGkleI7.js","assets/adminStats-BPO-u0FJ.js","assets/refresh-cw-ZKiOWAyJ.js","assets/log-out-B01quul8.js","assets/copy-rZ3xVk6b.js","assets/users-S4DFFAQr.js","assets/AppLayout-BMTbM_ub.js","assets/alert-dialog-BvSjFv7_.js","assets/AppAvatar-4MTfFYFP.js","assets/upload-CtLA6sRC.js","assets/plus-B3i5VG1I.js","assets/credit-card-CAnhdOy2.js","assets/user-round-C7y5vhOY.js","assets/AppGallery-Y5hFbAKs.js","assets/trash-2-BpCDBb5w.js","assets/CategoryChip-CYrt1Am-.js","assets/select-Nc8qytD4.js","assets/chevron-up-CBtE5cIB.js","assets/AppProfile-xeCOfnFo.js","assets/AppSubscriptionPage-BUEIWqdP.js","assets/AccountSubPage-DLWhNh-8.js","assets/usePostCheckoutHandler-A0sQDaPd.js","assets/AppAccountPage-CV-5cXv_.js","assets/AppSupportPage-BCYrz1zF.js","assets/textarea-B0GM1-8J.js","assets/AppCreate-CK5_8lHi.js","assets/coins-AJvD5QYc.js","assets/AppTemplates-BxZFpMey.js","assets/AdminLayout-gK7gbXeq.js","assets/wand-sparkles-DVoNjoDb.js","assets/AdminOverview-DR6zXaBi.js","assets/AreaChart-KnnCN6vO.js","assets/MetricCard-BcPwPK8N.js","assets/AdminPrompts-S2UHF7ZL.js","assets/pencil-DoM1VXyg.js","assets/AdminTemplates-shIDLzli.js","assets/AdminUsers-B-t8RnOp.js","assets/search-DdzsjeMC.js","assets/AdminSubscribers-YGa_knSD.js","assets/AdminAffiliates-CIpnFlGn.js","assets/AdminWatch-CnveYK_a.js","assets/AdminRevenue-CC71pBK4.js","assets/AdminRefunds-BrFbUPuI.js","assets/BlogIndex-vKVdf7JE.js","assets/posts-DqZuQgk5.js","assets/BestAiAvatarGenerators2026-Bqd4G_WC.js","assets/BlogPostLayout-KBNMX0f_.js","assets/AiAvatarVsPhotoshootCost-DgDGRzf4.js","assets/CreateFirstAiAvatar-DEB70JGO.js","assets/AiAvatarPrivacyCreators-ChQblthZ.js","assets/AiPhotosInstagramSafely-DxhteAdR.js","assets/HyperRealisticAiPhotosTips-CwAyLlqY.js","assets/CreatorEconomy2026Ai-D18rJVwx.js","assets/StableDiffusionVsBeModel-V5gZkBPU.js","assets/BeModelVsLensa-Ci222GWM.js","assets/BeModelVsMidjourney-Dn5O4Zsn.js","assets/BeModelVsPhotoAi-BaC7PM-v.js","assets/About-BumtXKFR.js","assets/Faq-CdaDmkhE.js","assets/Glossary-RAR5OxPj.js","assets/Press-BQfXanuS.js"])))=>i.map(i=>d[i]); 2var lh=Object.defineProperty;var yo=t=>{throw TypeError(t)};var ch=(t,e,r)=>e in t?lh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Zs=(t,e,r)=>ch(t,typeof e!="symbol"?e+"":e,r),un=(t,e,r)=>e.has(t)||yo("Cannot "+r);var S=(t,e,r)=>(un(t,e,"read from private field"),r?r.call(t):e.get(t)),se=(t,e,r)=>e.has(t)?yo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),W=(t,e,r,s)=>(un(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),Le=(t,e,r)=>(un(t,e,"access private method"),r);var ei=(t,e,r,s)=>({set _(i){W(t,e,i,r)},get _(){return S(t,e,s)}});import{r as _,j as c,a as uh,R as F,u as hc,b as dh,c as pc,A as fc,m as ue}from"./motion-q8SSFiMo.js";import{r as hh,R as ph,V as gc,b as vc,A as mc,C as _c,T as yc,D as bc,P as fh,c as xc,d as gh,S as vh,O as wc,e as Ec,f as mh,g as Sc,h as kc,i as _h,j as yh,k as bh,l as Pc,m as xh}from"./radix-2geflnVV.js";import{c as wh}from"./supabase-D2RGniRs.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}})();var jc,bo=hh;jc=bo.createRoot,bo.hydrateRoot;const Eh="modulepreload",Sh=function(t){return"/"+t},xo={},U=function(e,r,s){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=Sh(l),l in xo)return;xo[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");
2if(h.rel=u?"stylesheet":Eh,u||(h.as="script"),h.crossOrigin="",h.href=l,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function n(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&n(o.reason);return e().catch(n)})};var Yi=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(){}},Ki=typeof window>"u"||"Deno"in globalThis;function ct(){}function kh(t,e){return typeof t=="function"?t(e):t}function Ph(t){return typeof t=="number"&&t>=0&&t!==1/0}function jh(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Gn(t,e){return typeof t=="function"?t(e):t}function Ch(t,e){return typeof t=="function"?t(e):t}function wo(t,e){const{type:r="all",exact:s,fetchStatus:i,predicate:n,queryKey:a,stale:o}=t;if(a){if(s){if(e.queryHash!==Ua(a,e.options))return!1}else if(!Ls(e.queryKey,a))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||n&&!n(e))}function Eo(t,e){const{exact:r,status:s,predicate:i,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(r){if(Fs(e.options.mutationKey)!==Fs(n))return!1}else if(!Ls(e.options.mutationKey,n))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function Ua(t,e){return((e==null?void 0:e.queryKeyHashFn)||Fs)(t)}function Fs(t){return JSON.stringify(t,(e,r)=>Wn(r)?Object.keys(r).sort().reduce((s,i)=>(s[i]=r[i],s),{}):r)}function Ls(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>Ls(t[r],e[r])):!1}function Cc(t,e){if(t===e)return t;const r=So(t)&&So(e);if(r||Wn(t)&&Wn(e)){const s=r?t:Object.keys(t),i=s.length,n=r?e:Object.keys(e),a=n.length,o=r?[]:{},l=new Set(s);let u=0;for(let d=0;d<a;d++){const h=r?d:n[d];(!r&&l.has(h)||r)&&t[h]===void 0&&e[h]===void 0?(o[h]=void 0,u++):(o[h]=Cc(t[h],e[h]),o[h]===t[h]&&t[h]!==void 0&&u++)}return i===a&&u===i?t:o}return e}function zy(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function So(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Wn(t){if(!ko(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!ko(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function ko(t){return Object.prototype.toString.call(t)==="[object Object]"}function Th(t){return new Promise(e=>{setTimeout(e,t)})}function Rh(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Cc(t,e):e}function Nh(t,e,r=0){const s=[...t,e];return r&&s.length>r?s.slice(1):s}function Ah(t,e,r=0){const s=[e,...t];return r&&s.length>r?s.slice(0,-1):s}var Va=Symbol();function Tc(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Va?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function By(t,e){return typeof t=="function"?t(...e):!!t}var fr,qt,Br,ic,Oh=(ic=class extends Yi{constructor(){super();se(this,fr);se(this,qt);se(this,Br);W(this,Br,e=>{if(!Ki&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){S(this,qt)||this.setEventListener(S(this,Br))}onUnsubscribe(){var e;this.hasListeners()||((e=S(this,qt))==null||e.call(this),W(this,qt,void 0))}setEventListener(e){var r;W(this,Br,e),(r=S(this,qt))==null||r.call(this),W(this,qt,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){S(this,fr)!==e&&(W(this,fr,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 4,912 bytes, line 2
2this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof S(this,fr)=="boolean"?S(this,fr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},fr=new WeakMap,qt=new WeakMap,Br=new WeakMap,ic),Rc=new Oh,Ur,Ht,Vr,nc,Ih=(nc=class extends Yi{constructor(){super();se(this,Ur,!0);se(this,Ht);se(this,Vr);W(this,Vr,e=>{if(!Ki&&window.addEventListener){const r=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}})}onSubscribe(){S(this,Ht)||this.setEventListener(S(this,Vr))}onUnsubscribe(){var e;this.hasListeners()||((e=S(this,Ht))==null||e.call(this),W(this,Ht,void 0))}setEventListener(e){var r;W(this,Vr,e),(r=S(this,Ht))==null||r.call(this),W(this,Ht,e(this.setOnline.bind(this)))}setOnline(e){S(this,Ur)!==e&&(W(this,Ur,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return S(this,Ur)}},Ur=new WeakMap,Ht=new WeakMap,Vr=new WeakMap,nc),xi=new Ih;function Fh(){let t,e;const r=new Promise((i,n)=>{t=i,e=n});r.status="pending",r.catch(()=>{});function s(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{s({status:"fulfilled",value:i}),t(i)},r.reject=i=>{s({status:"rejected",reason:i}),e(i)},r}function Lh(t){return Math.min(1e3*2**t,3e4)}function Nc(t){return(t??"online")==="online"?xi.isOnline():!0}var Ac=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function dn(t){return t instanceof Ac}function Oc(t){let e=!1,r=0,s=!1,i;const n=Fh(),a=g=>{var v;s||(f(new Ac(g)),(v=t.abort)==null||v.call(t))},o=()=>{e=!0},l=()=>{e=!1},u=()=>Rc.isFocused()&&(t.networkMode==="always"||xi.isOnline())&&t.canRun(),d=()=>Nc(t.networkMode)&&t.canRun(),h=g=>{var v;s||(s=!0,(v=t.onSuccess)==null||v.call(t,g),i==null||i(),n.resolve(g))},f=g=>{var v;s||(s=!0,(v=t.onError)==null||v.call(t,g),i==null||i(),n.reject(g))},p=()=>new Promise(g=>{var v;i=y=>{(s||u())&&g(y)},(v=t.onPause)==null||v.call(t)}).then(()=>{var g;i=void 0,s||(g=t.onContinue)==null||g.call(t)}),m=()=>{if(s)return;let g;const v=r===0?t.initialPromise:void 0;try{g=v??t.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(h).catch(y=>{var L;if(s)return;const w=t.retry??(Ki?0:3),x=t.retryDelay??Lh,E=typeof x=="function"?x(r,y):x,j=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,y);if(e||!j){f(y);return}r++,(L=t.onFail)==null||L.call(t,r,y),Th(E).then(()=>u()?void 0:p()).then(()=>{e?f(y):m()})})};return{promise:n,cancel:a,continue:()=>(i==null||i(),n),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?m():p().then(m),n)}}var Mh=t=>setTimeout(t,0);function $h(){let t=[],e=0,r=o=>{o()},s=o=>{o()},i=Mh;const n=o=>{e?t.push(o):i(()=>{r(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{s(()=>{o.forEach(l=>{r(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{n(()=>{o(...l)})},schedule:n,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{s=o},setScheduler:o=>{i=o}}}var Be=$h(),gr,ac,Ic=(ac=class{constructor(){se(this,gr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ph(this.gcTime)&&W(this,gr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ki?1/0:5*60*1e3))}clearGcTimeout(){S(this,gr)&&(clearTimeout(S(this,gr)),W(this,gr,void 0))}},gr=new WeakMap,ac),qr,vr,Xe,mr,$e,Ws,_r,ut,jt,oc,Dh=(oc=class extends Ic{constructor(e){super();se(this,ut);se(this,qr);se(this,vr);se(this,Xe);se(this,mr);se(this,$e);se(this,Ws);se(this,_r);W(this,_r,!1),W(this,Ws,e.defaultOptions),this.setOptions(e.options),this.observers=[],W(this,mr,e.client),W(this,Xe,S(this,mr).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,W(this,qr,Bh(this.options)),this.state=e.state??S(this,qr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=S(this,$e))==null?void 0:e.promise}setOptions(e){this.options={...S(this,Ws),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Xe).remove(this)}setData(e,r){const s=Rh(this.state.data,e,this.options);return Le(this,ut,jt).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(e,r){Le(this,ut,jt).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var s,i;const r=(s=S(this,$e))==null?void 0:s.promise;return(i=S(this,$e))==null||i.cancel(e),r?r.then(ct).catch(ct):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,qr))}isActive(){return this.observers.some(e=>Ch(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Va||this.state.dataUpdateCount+this.state.errorUpdate
2Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Gn(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:!jh(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=S(this,$e))==null||r.continue()}onOnline(){var r;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=S(this,$e))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),S(this,Xe).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(S(this,$e)&&(S(this,_r)?S(this,$e).cancel({revert:!0}):S(this,$e).cancelRetry()),this.scheduleGc()),S(this,Xe).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,ut,jt).call(this,{type:"invalidate"})}fetch(e,r){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(S(this,$e))return S(this,$e).continueRetry(),S(this,$e).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(W(this,_r,!0),s.signal)})},n=()=>{const f=Tc(this.options,r),m=(()=>{const g={client:S(this,mr),queryKey:this.queryKey,meta:this.meta};return i(g),g})();return W(this,_r,!1),this.options.persister?this.options.persister(f,m,this):f(m)},o=(()=>{const f={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:S(this,mr),state:this.state,fetchFn:n};return i(f),f})();(u=this.options.behavior)==null||u.onFetch(o,this),W(this,vr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Le(this,ut,jt).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const l=f=>{var p,m,g,v;dn(f)&&f.silent||Le(this,ut,jt).call(this,{type:"error",error:f}),dn(f)||((m=(p=S(this,Xe).config).onError)==null||m.call(p,f,this),(v=(g=S(this,Xe).config).onSettled)==null||v.call(g,this.state.data,f,this)),this.scheduleGc()};return W(this,$e,Oc({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:s.abort.bind(s),onSuccess:f=>{var p,m,g,v;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(y){l(y);return}(m=(p=S(this,Xe).config).onSuccess)==null||m.call(p,f,this),(v=(g=S(this,Xe).config).onSettled)==null||v.call(g,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,p)=>{Le(this,ut,jt).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Le(this,ut,jt).call(this,{type:"pause"})},onContinue:()=>{Le(this,ut,jt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),S(this,$e).start()}},qr=new WeakMap,vr=new WeakMap,Xe=new WeakMap,mr=new WeakMap,$e=new WeakMap,Ws=new WeakMap,_r=new WeakMap,ut=new WeakSet,jt=function(e){const r=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...zh(s.data,this.options),fetchMeta:e.meta??null};case"success":return W(this,vr,void 0),{...s,data:e.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return dn(i)&&i.revert&&S(this,vr)?{...S(this,vr),fetchStatus:"idle"}
vendor: 3,698 bytes, line 2
2:{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=r(this.state),Be.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),S(this,Xe).notify({query:this,type:"updated",action:e})})},oc);function zh(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Nc(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Bh(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,s=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ft,lc,Uh=(lc=class extends Yi{constructor(e={}){super();se(this,ft);this.config=e,W(this,ft,new Map)}build(e,r,s){const i=r.queryKey,n=r.queryHash??Ua(i,r);let a=this.get(n);return a||(a=new Dh({client:e,queryKey:i,queryHash:n,options:e.defaultQueryOptions(r),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){S(this,ft).has(e.queryHash)||(S(this,ft).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=S(this,ft).get(e.queryHash);r&&(e.destroy(),r===e&&S(this,ft).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Be.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return S(this,ft).get(e)}getAll(){return[...S(this,ft).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(s=>wo(r,s))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(s=>wo(e,s)):r}notify(e){Be.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Be.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Be.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ft=new WeakMap,lc),gt,ze,yr,vt,Vt,cc,Vh=(cc=class extends Ic{constructor(e){super();se(this,vt);se(this,gt);se(this,ze);se(this,yr);this.mutationId=e.mutationId,W(this,ze,e.mutationCache),W(this,gt,[]),this.state=e.state||qh(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){S(this,gt).includes(e)||(S(this,gt).push(e),this.clearGcTimeout(),S(this,ze).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){W(this,gt,S(this,gt).filter(r=>r!==e)),this.scheduleGc(),S(this,ze).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){S(this,gt).length||(this.state.status==="pending"?this.scheduleGc():S(this,ze).remove(this))}continue(){var e;return((e=S(this,yr))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var n,a,o,l,u,d,h,f,p,m,g,v,y,w,x,E,j,L,P,C;const r=()=>{Le(this,vt,Vt).call(this,{type:"continue"})};W(this,yr,Oc({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(k,A)=>{Le(this,vt,Vt).call(this,{type:"failed",failureCount:k,error:A})},onPause:()=>{Le(this,vt,Vt).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,ze).canRun(this)}));const s=this.state.status==="pending",i=!S(this,yr).canStart();try{if(s)r();else{Le(this,vt,Vt).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(n=S(this,ze).config).onMutate)==null?void 0:a.call(n,e,this));
2const A=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,e));A!==this.state.context&&Le(this,vt,Vt).call(this,{type:"pending",context:A,variables:e,isPaused:i})}const k=await S(this,yr).start();return await((d=(u=S(this,ze).config).onSuccess)==null?void 0:d.call(u,k,e,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,k,e,this.state.context)),await((m=(p=S(this,ze).config).onSettled)==null?void 0:m.call(p,k,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,k,null,e,this.state.context)),Le(this,vt,Vt).call(this,{type:"success",data:k}),k}catch(k){try{throw await((w=(y=S(this,ze).config).onError)==null?void 0:w.call(y,k,e,this.state.context,this)),await((E=(x=this.options).onError)==null?void 0:E.call(x,k,e,this.state.context)),await((L=(j=S(this,ze).config).onSettled)==null?void 0:L.call(j,void 0,k,this.state.variables,this.state.context,this)),await((C=(P=this.options).onSettled)==null?void 0:C.call(P,void 0,k,e,this.state.context)),k}finally{Le(this,vt,Vt).call(this,{type:"error",error:k})}}finally{S(this,ze).runNext(this)}}},gt=new WeakMap,ze=new WeakMap,yr=new WeakMap,vt=new WeakSet,Vt=function(e){const r=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Be.batch(()=>{S(this,gt).forEach(s=>{s.onMutationUpdate(e)}),S(this,ze).notify({mutation:this,type:"updated",action:e})})},cc);function qh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var At,dt,Ys,uc,Hh=(uc=class extends Yi{constructor(e={}){super();se(this,At);se(this,dt);se(this,Ys);this.config=e,W(this,At,new Set),W(this,dt,new Map),W(this,Ys,0)}build(e,r,s){const i=new Vh({mutationCache:this,mutationId:++ei(this,Ys)._,options:e.defaultMutationOptions(r),state:s});return this.add(i),i}add(e){S(this,At).add(e);const r=ti(e);if(typeof r=="string"){const s=S(this,dt).get(r);s?s.push(e):S(this,dt).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(S(this,At).delete(e)){const r=ti(e);if(typeof r=="string"){const s=S(this,dt).get(r);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&S(this,dt).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=ti(e);if(typeof r=="string"){const s=S(this,dt).get(r),i=s==null?void 0:s.find(n=>n.state.status==="pending");return!i||i===e}else return!0}runNext(e){var s;const r=ti(e);if(typeof r=="string"){const i=(s=S(this,dt).get(r))==null?void 0:s.find(n=>n!==e&&n.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Be.batch(()=>{S(this,At).forEach(e=>{this.notify({type:"removed",mutation:e})}),S(this,At).clear(),S(this,dt).clear()})}getAll(){return Array.from(S(this,At))}find(e){const r={exact:!0,...e};return this.getAll().find(s=>Eo(r,s))}findAll(e={}){return this.getAll().filter(r=>Eo(e,r))}notify(e){Be.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>
vendor: 7,008 bytes, lines 2-11
2r.state.isPaused);return Be.batch(()=>Promise.all(e.map(r=>r.continue().catch(ct))))}},At=new WeakMap,dt=new WeakMap,Ys=new WeakMap,uc);function ti(t){var e;return(e=t.options.scope)==null?void 0:e.id}function Po(t){return{onFetch:(e,r)=>{var d,h,f,p,m;const s=e.options,i=(f=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,n=((p=e.state.data)==null?void 0:p.pages)||[],a=((m=e.state.data)==null?void 0:m.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let g=!1;const v=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},y=Tc(e.options,e.fetchOptions),w=async(x,E,j)=>{if(g)return Promise.reject();if(E==null&&x.pages.length)return Promise.resolve(x);const P=(()=>{const M={client:e.client,queryKey:e.queryKey,pageParam:E,direction:j?"backward":"forward",meta:e.options.meta};return v(M),M})(),C=await y(P),{maxPages:k}=e.options,A=j?Ah:Nh;return{pages:A(x.pages,C,k),pageParams:A(x.pageParams,E,k)}};if(i&&n.length){const x=i==="backward",E=x?Gh:jo,j={pages:n,pageParams:a},L=E(s,j);o=await w(j,L,x)}else{const x=t??n.length;do{const E=l===0?a[0]??s.initialPageParam:jo(s,o);if(l>0&&E==null)break;o=await w(o,E),l++}while(l<x)}return o};e.options.persister?e.fetchFn=()=>{var g,v;return(v=(g=e.options).persister)==null?void 0:v.call(g,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function jo(t,{pages:e,pageParams:r}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,r[s],r):void 0}function Gh(t,{pages:e,pageParams:r}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,r[0],r):void 0}var Se,Gt,Wt,Hr,Gr,Yt,Wr,Yr,dc,Wh=(dc=class{constructor(t={}){se(this,Se);se(this,Gt);se(this,Wt);se(this,Hr);se(this,Gr);se(this,Yt);se(this,Wr);se(this,Yr);W(this,Se,t.queryCache||new Uh),W(this,Gt,t.mutationCache||new Hh),W(this,Wt,t.defaultOptions||{}),W(this,Hr,new Map),W(this,Gr,new Map),W(this,Yt,0)}mount(){ei(this,Yt)._++,S(this,Yt)===1&&(W(this,Wr,Rc.subscribe(async t=>{t&&(await this.resumePausedMutations(),S(this,Se).onFocus())})),W(this,Yr,xi.subscribe(async t=>{t&&(await this.resumePausedMutations(),S(this,Se).onOnline())})))}unmount(){var t,e;ei(this,Yt)._--,S(this,Yt)===0&&((t=S(this,Wr))==null||t.call(this),W(this,Wr,void 0),(e=S(this,Yr))==null||e.call(this),W(this,Yr,void 0))}isFetching(t){return S(this,Se).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return S(this,Gt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=S(this,Se).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=S(this,Se).build(this,e),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Gn(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return S(this,Se).findAll(t).map(({queryKey:e,state:r})=>{const s=r.data;return[e,s]})}setQueryData(t,e,r){const s=this.defaultQueryOptions({queryKey:t}),i=S(this,Se).get(s.queryHash),n=i==null?void 0:i.state.data,a=kh(e,n);if(a!==void 0)return S(this,Se).build(this,s).setData(a,{...r,manual:!0})}setQueriesData(t,e,r){return Be.batch(()=>S(this,Se).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=S(this,Se).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=S(this,Se);Be.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=S(this,Se);return Be.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},s=Be.batch(()=>S(this,Se).findAll(t).map(i=>i.cancel(r)));return Promise.all(s).then(ct).catch(ct)}invalidateQueries(t,e={}){return Be.batch(()=>(S(this,Se).findAll(t).forEach(r=>{r.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 r={...e,cancelRefetch:e.cancelRefetch??!0},s=Be.batch(()=>S(this,Se).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let n=i.fetch(void 0,r);return r.throwOnError||(n=n.catch(ct)),i.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(s).then(ct)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=S(this,Se).build(this,e);return r.isStaleByTime(Gn(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ct).catch(ct)}fetchInfiniteQuery(t){return t.behavior=Po(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ct).catch(ct)}ensureInfiniteQueryData(t){return t.behavior=Po(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return xi.isOnline()?S(this,Gt).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,Se)}getMutationCache(){return S(this,Gt)}getDefaultOptions(){return S(this,Wt)}setDefaultOptions(t){W(this,Wt,t)}setQueryDefaults(t,e){S(this,Hr).set(Fs(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...S(this,Hr).values()],r={};return e.forEach(s=>{Ls(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,e){S(this,Gr).set(Fs(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...S(this,Gr).values()],r={};return e.forEach(s=>{Ls(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...S(this,Wt).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ua(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===Va&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...S(this,Wt).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){S(this,Se).clear(),S(this,Gt).clear()}},Se=new WeakMap,Gt=new WeakMap,Wt=new WeakMap,Hr=new WeakMap,Gr=new WeakMap,Yt=new WeakMap,Wr=new WeakMap,Yr=new WeakMap,dc),Fc=_.createContext(void 0),Uy=t=>{const e=_.useContext(Fc);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Yh=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(Fc.Provider,{value:t,children:e}));/** 3 * @remix-run/router v1.23.0 4 * 5 * Copyright (c) Remix Software Inc. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE.md file in the root directory of this source tree. 9 * 10 * @license MIT 11 */function Ms(){return Ms=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
vendor: 5,028 bytes, line 11
11for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Ms.apply(this,arguments)}var Kt;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Kt||(Kt={}));const Co="popstate";function Kh(t){t===void 0&&(t={});function e(s,i){let{pathname:n,search:a,hash:o}=s.location;return Yn("",{pathname:n,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(s,i){return typeof i=="string"?i:wi(i)}return Jh(e,r,null,t)}function Ee(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Lc(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Qh(){return Math.random().toString(36).substr(2,8)}function To(t,e){return{usr:t.state,key:t.key,idx:e}}function Yn(t,e,r,s){return r===void 0&&(r=null),Ms({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?rs(e):e,{state:r,key:e&&e.key||s||Qh()})}function wi(t){let{pathname:e="/",search:r="",hash:s=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(e+=s.charAt(0)==="#"?s:"#"+s),e}function rs(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let s=t.indexOf("?");s>=0&&(e.search=t.substr(s),t=t.substr(0,s)),t&&(e.pathname=t)}return e}function Jh(t,e,r,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:n=!1}=s,a=i.history,o=Kt.Pop,l=null,u=d();u==null&&(u=0,a.replaceState(Ms({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){o=Kt.Pop;let v=d(),y=v==null?null:v-u;u=v,l&&l({action:o,location:g.location,delta:y})}function f(v,y){o=Kt.Push;let w=Yn(g.location,v,y);u=d()+1;let x=To(w,u),E=g.createHref(w);try{a.pushState(x,"",E)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(E)}n&&l&&l({action:o,location:g.location,delta:1})}function p(v,y){o=Kt.Replace;let w=Yn(g.location,v,y);u=d();let x=To(w,u),E=g.createHref(w);a.replaceState(x,"",E),n&&l&&l({action:o,location:g.location,delta:0})}function m(v){let y=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof v=="string"?v:wi(v);return w=w.replace(/ $/,"%20"),Ee(y,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,y)}let g={get action(){return o},get location(){return t(i,a)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Co,h),l=v,()=>{i.removeEventListener(Co,h),l=null}},createHref(v){return e(i,v)},createURL:m,encodeLocation(v){let y=m(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(v){return a.go(v)}};return g}var Ro;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Ro||(Ro={}));function Xh(t,e,r){return r===void 0&&(r="/"),Zh(t,e,r,!1)}function Zh(t,e,r,s){let i=typeof e=="string"?rs(e):e,n=Kr(i.pathname||"/",r);if(n==null)return null;let a=Mc(t);ep(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let u=dp(n);o=cp(a[l],u,s)}return o}function Mc(t,e,r,s){e===void 0&&(e=[]),r===void 0&&(r=[]),s===void 0&&(s="");let i=(n,a,o)=>{let l={relativePath:o===void 0?n.path||"":o,caseSensitive:n.caseSensitive===!0,childrenIndex:a,route:n};l.relativePath.startsWith("/")&&(Ee(l.relativePath.startsWith(s),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(s.length));let u=Jt([s,l.relativePath]),d=r.concat(l);n.children&&n.children.length>0&&(Ee(n.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Mc(n.children,e,d,u)),!(n.path==null&&!n.index)&&e.push({path:u,score:op(u,n.index),routesMeta:d})};return t.forEach((n,a)=>{var o;if(n.path===""||!((o=n.path)!=null&&o.includes("?")))i(n,a);else for(let l of $c(n.path))i(n,a,l)}),e}function $c(t){let e=t.split("/");if(e.length===0)return[];let[r,...s]=e,i=r.endsWith("?"),n=r.replace(/\?$/,"");if(s.length===0)return i?[n,""]:[n];let a=$c(s.join("/")),o=[];return o.push(...a.map(l=>l===""?n:[n,l].join("/"))),i&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function ep(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:lp(e.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}const tp=/^:[\w-]+$/,rp=3,sp=2,ip=1,np=10,ap=-2,No=t=>t==="*";function op(t,e){let r=t.split("/"),s=r.length;return r.some(No)&&(s+=ap),e&&(s+=sp),r.filter(i=>!No(i)).reduce((i,n)=>i+(tp.test(n)?rp:n===""?ip:np),s)}function lp(t,e){return t.length===e.length&&t.slice(0,-1).every((s,i)=>s===e[i])?t[t.length-1]-e[e.length-1]:0}function cp(t,e,r){let{routesMeta:s}=t,i={},n="/",a=[];for(let o=0;o<s.length;++o){let l=s[o],u=o===s.length-1,d=n==="/"?e:e.slice(n.length)||"/",h=Ei({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!h&&u&&r&&!s[s.length-1].route.index&&(h=Ei({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;
vendor: 9,390 bytes, lines 11-20
11Object.assign(i,h.params),a.push({params:i,pathname:Jt([n,h.pathname]),pathnameBase:gp(Jt([n,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(n=Jt([n,h.pathnameBase]))}return a}function Ei(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,s]=up(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let n=i[0],a=n.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:s.reduce((u,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let g=o[h]||"";a=n.slice(0,n.length-g.length).replace(/(.)\/+$/,"$1")}const m=o[h];return p&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:n,pathnameBase:a,pattern:t}}function up(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),Lc(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let s=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(s.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(s.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),s]}function dp(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Lc(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Kr(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,s=t.charAt(r);return s&&s!=="/"?null:t.slice(r)||"/"}function hp(t,e){e===void 0&&(e="/");let{pathname:r,search:s="",hash:i=""}=typeof t=="string"?rs(t):t;return{pathname:r?r.startsWith("/")?r:pp(r,e):e,search:vp(s),hash:mp(i)}}function pp(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function hn(t,e,r,s){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function fp(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function qa(t,e){let r=fp(t);return e?r.map((s,i)=>i===r.length-1?s.pathname:s.pathnameBase):r.map(s=>s.pathnameBase)}function Ha(t,e,r,s){s===void 0&&(s=!1);let i;typeof t=="string"?i=rs(t):(i=Ms({},t),Ee(!i.pathname||!i.pathname.includes("?"),hn("?","pathname","search",i)),Ee(!i.pathname||!i.pathname.includes("#"),hn("#","pathname","hash",i)),Ee(!i.search||!i.search.includes("#"),hn("#","search","hash",i)));let n=t===""||i.pathname==="",a=n?"/":i.pathname,o;if(a==null)o=r;else{let h=e.length-1;if(!s&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}o=h>=0?e[h]:"/"}let l=hp(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(n||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Jt=t=>t.join("/").replace(/\/\/+/g,"/"),gp=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),vp=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,mp=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function _p(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Dc=["post","put","patch","delete"];new Set(Dc);const yp=["get",...Dc];new Set(yp);/** 12 * React Router v6.30.1 13 * 14 * Copyright (c) Remix Software Inc. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE.md file in the root directory of this source tree. 18 * 19 * @license MIT 20 */function $s(){return $s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},$s.apply(this,arguments)}const Qi=_.createContext(null),zc=_.createContext(null),Lt=_.createContext(null),Ji=_.createContext(null),bt=_.createContext({outlet:null,matches:[],isDataRoute:!1}),Bc=_.createContext(null);function bp(t,e){let{relative:r}=e===void 0?{}:e;ss()||Ee(!1);let{basename:s,navigator:i}=_.useContext(Lt),{hash:n,pathname:a,search:o}=Xi(t,{relative:r}),l=a;return s!=="/"&&(l=a==="/"?s:Jt([s,a])),i.createHref({pathname:l,search:o,hash:n})}function ss(){return _.useContext(Ji)!=null}function xt(){return ss()||Ee(!1),_.useContext(Ji).location}function Uc(t){_.useContext(Lt).static||_.useLayoutEffect(t)}function Ga(){let{isDataRoute:t}=_.useContext(bt);return t?Fp():xp()}function xp(){ss()||Ee(!1);let t=_.useContext(Qi),{basename:e,future:r,navigator:s}=_.useContext(Lt),{matches:i}=_.useContext(bt),{pathname:n}=xt(),a=JSON.stringify(qa(i,r.v7_relativeSplatPath)),o=_.useRef(!1);return Uc(()=>{o.current=!0}),_.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){s.go(u);return}let h=Ha(u,JSON.parse(a),n,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Jt([e,h.pathname])),(d.replace?s.replace:s.push)(h,d.state,d)},[e,s,a,n,t])}const wp=_.createContext(null);function Ep(t){let e=_.useContext(bt).outlet;return e&&_.createElement(wp.Provider,{value:t},e)}function Vy(){let{matches:t}=_.useContext(bt),e=t[t.length-1];return e?e.params:{}}function Xi(t,e){let{relative:r}=e===void 0?{}:e,{future:s}=_.useContext(Lt),{matches:i}=_.useContext(bt),{pathname:n}=xt(),a=JSON.stringify(qa(i,s.v7_relativeSplatPath));return _.useMemo(()=>Ha(t,JSON.parse(a),n,r==="path"),[t,a,n,r])}function Sp(t,e){return kp(t,e)}function kp(t,e,r,s){ss()||Ee(!1);let{navigator:i}=_.useContext(Lt),{matches:n}=_.useContext(bt),a=n[n.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=xt(),d;if(e){var h;let v=typeof e=="string"?rs(e):e;l==="/"||(h=v.pathname)!=null&&h.startsWith(l)||Ee(!1),d=v}else d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let v=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=Xh(t,{pathname:p}),g=Rp(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:Jt([l,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Jt([l,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),n,r,s);return e&&g?_.createElement(Ji.Provider,{value:{location:$s({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Kt.Pop}},g):g}function Pp(){let t=Ip(),e=_p(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),r?_.createElement("pre",{style:i},r):null,null)}const jp=_.createElement(Pp,null);class Cp extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?_.createElement(bt.Provider,{value:this.props.routeContext},_.createElement(Bc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Tp(t){let{routeContext:e,match:r,children:s}=t,i=_.useContext(Qi);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),_.createElement(bt.Provider,{value:e},s)}function Rp(t,e,r,s){var i;if(e===void 0&&(e=[]),r===void 0&&(r=null),s===void 0&&(s=null),t==null){var n;if(!r)return null;if(r.errors)t=r.matches;else if((n=s)!=null&&n.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let a=t,o=(i=r)==null?void 0:i.errors;if(o!=null){let d=a.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||Ee(!1),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(r&&s&&s.v7_partialHydration)for(let d=0;d<a.length;d++){let h=a[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:p}=r,m=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||m){l=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,f)=>{let p,m=!1,g=null,v=null;r&&(p=o&&h.route.id?o[h.route.id]:void 0,g=h.route.errorElement||jp,l&&(u<0&&f===0?(m=!0,v=null):u===f&&(m=!0,v=h.route.hydrateFallbackElement||null)));let y=e.concat(a.slice(0,f+1)),w=()=>{let x;return p?x=g:m?x=v:h.route.Component?x=_.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=d,_.createElement(Tp,{match:h,routeC
20ontext:{outlet:d,matches:y,isDataRoute:r!=null},children:x})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?_.createElement(Cp,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}var Vc=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(Vc||{}),Si=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Si||{});function Np(t){let e=_.useContext(Qi);return e||Ee(!1),e}function Ap(t){let e=_.useContext(zc);return e||Ee(!1),e}function Op(t){let e=_.useContext(bt);return e||Ee(!1),e}function qc(t){let e=Op(),r=e.matches[e.matches.length-1];return r.route.id||Ee(!1),r.route.id}function Ip(){var t;let e=_.useContext(Bc),r=Ap(Si.UseRouteError),s=qc(Si.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[s]}function Fp(){let{router:t}=Np(Vc.UseNavigateStable),e=qc(Si.UseNavigateStable),r=_.useRef(!1);return Uc(()=>{r.current=!0}),_.useCallback(function(i,n){n===void 0&&(n={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,$s({fromRouteId:e},n)))},[t,e])}function Lp(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function xr(t){let{to:e,replace:r,state:s,relative:i}=t;ss()||Ee(!1);let{future:n,static:a}=_.useContext(Lt),{matches:o}=_.useContext(bt),{pathname:l}=xt(),u=Ga(),d=Ha(e,qa(o,n.v7_relativeSplatPath),l,i==="path"),h=JSON.stringify(d);return _.useEffect(()=>u(JSON.parse(h),{replace:r,state:s,relative:i}),[u,h,i,r,s]),null}function Wa(t){return Ep(t.context)}function D(t){Ee(!1)}function Mp(t){let{basename:e="/",children:r=null,location:s,navigationType:i=Kt.Pop,navigator:n,static:a=!1,future:o}=t;ss()&&Ee(!1);let l=e.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:l,navigator:n,static:a,future:$s({v7_relativeSplatPath:!1},o)}),[l,o,n,a]);typeof s=="string"&&(s=rs(s));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:m="default"}=s,g=_.useMemo(()=>{let v=Kr(d,l);return v==null?null:{location:{pathname:v,search:h,hash:f,state:p,key:m},navigationType:i}},[l,d,h,f,p,m,i]);return g==null?null:_.createElement(Lt.Provider,{value:u},_.createElement(Ji.Provider,{children:r,value:g}))}function $p(t){let{children:e,location:r}=t;return Sp(Kn(e),r)}new Promise(()=>{});function Kn(t,e){e===void 0&&(e=[]);let r=[];return _.Children.forEach(t,(s,i)=>{if(!_.isValidElement(s))return;let n=[...e,i];if(s.type===_.Fragment){r.push.apply(r,Kn(s.props.children,n));return}s.type!==D&&Ee(!1),!s.props.index||!s.props.children||Ee(!1);let a={id:s.props.id||n.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(a.children=Kn(s.props.children,n)),r.push(a)}),r}/** 21 * React Router DOM v6.30.1 22 * 23 * Copyright (c) Remix Software Inc. 24 * 25 * This source code is licensed under the MIT license found in the 26 * LICENSE.md file in the root directory of this source tree. 27 * 28 * @license MIT 29 */function ki(){return ki=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
29for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},ki.apply(this,arguments)}function Hc(t,e){if(t==null)return{};var r={},s=Object.keys(t),i,n;for(n=0;n<s.length;n++)i=s[n],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Dp(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function zp(t,e){return t.button===0&&(!e||e==="_self")&&!Dp(t)}function Qn(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let s=t[r];return e.concat(Array.isArray(s)?s.map(i=>[r,i]):[[r,s]])},[]))}function Bp(t,e){let r=Qn(t);return e&&e.forEach((s,i)=>{r.has(i)||e.getAll(i).forEach(n=>{r.append(i,n)})}),r}const Up=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Vp=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],qp="6";try{window.__reactRouterVersion=qp}catch{}const Hp=_.createContext({isTransitioning:!1}),Gp="startTransition",Ao=uh[Gp];function Wp(t){let{basename:e,children:r,future:s,window:i}=t,n=_.useRef();n.current==null&&(n.current=Kh({window:i,v5Compat:!0}));let a=n.current,[o,l]=_.useState({action:a.action,location:a.location}),{v7_startTransition:u}=s||{},d=_.useCallback(h=>{u&&Ao?Ao(()=>l(h)):l(h)},[l,u]);return _.useLayoutEffect(()=>a.listen(d),[a,d]),_.useEffect(()=>Lp(s),[s]),_.createElement(Mp,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:a,future:s})}const Yp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Kp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=_.forwardRef(function(e,r){let{onClick:s,relative:i,reloadDocument:n,replace:a,state:o,target:l,to:u,preventScrollReset:d,viewTransition:h}=e,f=Hc(e,Up),{basename:p}=_.useContext(Lt),m,g=!1;if(typeof u=="string"&&Kp.test(u)&&(m=u,Yp))try{let x=new URL(window.location.href),E=u.startsWith("//")?new URL(x.protocol+u):new URL(u),j=Kr(E.pathname,p);E.origin===x.origin&&j!=null?u=j+E.search+E.hash:g=!0}catch{}let v=bp(u,{relative:i}),y=Jp(u,{replace:a,state:o,target:l,preventScrollReset:d,relative:i,viewTransition:h});function w(x){s&&s(x),x.defaultPrevented||y(x)}return _.createElement("a",ki({},f,{href:m||v,onClick:g||n?s:w,ref:r,target:l}))}),Oo=_.forwardRef(function(e,r){let{"aria-current":s="page",caseSensitive:i=!1,className:n="",end:a=!1,style:o,to:l,viewTransition:u,children:d}=e,h=Hc(e,Vp),f=Xi(l,{relative:h.relative}),p=xt(),m=_.useContext(zc),{navigator:g,basename:v}=_.useContext(Lt),y=m!=null&&Xp(f)&&u===!0,w=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,x=p.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(x=x.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&v&&(E=Kr(E,v)||E);const j=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let L=x===w||!a&&x.startsWith(w)&&x.charAt(j)==="/",P=E!=null&&(E===w||!a&&E.startsWith(w)&&E.charAt(w.length)==="/"),C={isActive:L,isPending:P,isTransitioning:y},k=L?s:void 0,A;typeof n=="function"?A=n(C):A=[n,L?"active":null,P?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M=typeof o=="function"?o(C):o;return _.createElement(Ne,ki({},h,{"aria-current":k,className:A,ref:r,style:M,to:l,viewTransition:u}),typeof d=="function"?d(C):d)});var Jn;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Jn||(Jn={}));var Io;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Io||(Io={}));function Qp(t){let e=_.useContext(Qi);return e||Ee(!1),e}function Jp(t,e){let{target:r,replace:s,state:i,preventScrollReset:n,relative:a,viewTransition:o}=e===void 0?{}:e,l=Ga(),u=xt(),d=Xi(t,{relative:a});return _.useCallback(h=>{if(zp(h,r)){h.preventDefault();let f=s!==void 0?s:wi(u)===wi(d);l(t,{replace:f,state:i,preventScrollReset:n,relative:a,viewTransition:o})}},[u,l,d,s,i,r,t,n,a,o])}function qy(t){let e=_.useRef(Qn(t)),r=_.useRef(!1),s=xt(),i=_.useMemo(()=>Bp(s.search,r.current?null:e.current),[s.search]),n=Ga(),a=_.useCallback((o,l)=>{const u=Qn(typeof o=="function"?o(i):o);r.current=!0,n("?"+u,l)},[n,i]);return[i,a]}function Xp(t,e){e===void 0&&(e={});let r=_.useContext(Hp);r==null&&Ee(!1);let{basename:s}=Qp(Jn.useViewTransitionState),i=Xi(t,{relative:e.relative});if(!r.isTransitioning)return!1;let n=Kr(r.currentLocation.pathname,s)||r.currentLocation.pathname,a=Kr(r.nextLocation.pathname,s)||r.nextLocation.pathname;return Ei(i.pathname,a)!=null||Ei(i.pathname,n)!=null}var Zp=t=>{switch(t){case"success":return rf;case"info":return nf;case"warning":return sf;case"error":return af;default:return null}},ef=Array(12).fill(0),tf=({visible:t,className:e})=>F.createElement("div",{className:["sonner-loading-wrapper",e].filter(
29Boolean).join(" "),"data-visible":t},F.createElement("div",{className:"sonner-spinner"},ef.map((r,s)=>F.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),rf=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),sf=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},F.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"})),nf=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),af=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),of=F.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"},F.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),F.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),lf=()=>{let[t,e]=F.useState(document.hidden);return F.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},Xn=1,cf=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;let{message:s,...i}=e,n=typeof(e==null?void 0:e.id)=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:Xn++,a=this.toasts.find(l=>l.id===n),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),a?this.toasts=this.toasts.map(l=>l.id===n?(this.publish({...l,...e,id:n,title:s}),{...l,...e,id:n,dismissible:o,title:s}):l):this.addToast({title:s,...i,dismissible:o,id:n}),n},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:e,dismiss:!0})),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let i=e instanceof Promise?e:e(),n=s!==void 0,a,o=i.then(async u=>{if(a=["resolve",u],F.isValidElement(u))n=!1,this.create({id:s,type:"default",message:u});else if(df(u)&&!u.ok){n=!1;let d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,h=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description;this.create({id:s,type:"error",message:d,description:h})}else if(r.success!==void 0){n=!1;let d=typeof r.success=="function"?await r.success(u):r.success,h=typeof r.description=="function"?await r.description(u):r.description;this.create({id:s,type:"success",message:d,description:h})}}).catch(async u=>
29{if(a=["reject",u],r.error!==void 0){n=!1;let d=typeof r.error=="function"?await r.error(u):r.error,h=typeof r.description=="function"?await r.description(u):r.description;this.create({id:s,type:"error",message:d,description:h})}}).finally(()=>{var u;n&&(this.dismiss(s),s=void 0),(u=r.finally)==null||u.call(r)}),l=()=>new Promise((u,d)=>o.then(()=>a[0]==="reject"?d(a[1]):u(a[1])).catch(d));return typeof s!="string"&&typeof s!="number"?{unwrap:l}:Object.assign(s,{unwrap:l})},this.custom=(e,r)=>{let s=(r==null?void 0:r.id)||Xn++;return this.create({jsx:e(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},He=new cf,uf=(t,e)=>{let r=(e==null?void 0:e.id)||Xn++;return He.addToast({title:t,...e,id:r}),r},df=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",hf=uf,pf=()=>He.toasts,ff=()=>He.getActiveToasts(),Gy=Object.assign(hf,{success:He.success,info:He.info,warning:He.warning,error:He.error,custom:He.custom,message:He.message,promise:He.promise,dismiss:He.dismiss,loading:He.loading},{getHistory:pf,getToasts:ff});function gf(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",e==="top"&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}gf(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
29left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
29:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
29--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)} 30`);function ri(t){return t.label!==void 0}var vf=3,mf="32px",_f="16px",Fo=4e3,yf=356,bf=14,xf=20,wf=200;function ot(...t){return t.filter(Boolean).join(" ")}function Ef(t){let[e,r]=t.split("-"),s=[];return e&&s.push(e),r&&s.push(r),s}var Sf=t=>{var e,r,s,i,n,a,o,l,u,d,h;let{invert:f,toast:p,unstyled:m,interacting:g,setHeights:v,visibleToasts:y,heights:w,index:x,toasts:E,expanded:j,removeToast:L,defaultRichColors:P,closeButton:C,style:k,cancelButtonStyle:A,actionButtonStyle:M,className:O="",descriptionClassName:H="",duration:V,position:re,gap:X,loadingIcon:K,expandByDefault:_e,classNames:z,icons:ae,closeButtonAriaLabel:te="Close toast",pauseWhenPageIsHidden:
vendor: 1,524 bytes, line 30
30Q}=t,[q,ee]=F.useState(null),[ne,De]=F.useState(null),[ie,Re]=F.useState(!1),[Fe,wt]=F.useState(!1),[tr,Ke]=F.useState(!1),[Js,nn]=F.useState(!1),[an,rt]=F.useState(!1),[on,Sr]=F.useState(0),[ns,as]=F.useState(0),Mt=F.useRef(p.duration||V||Fo),os=F.useRef(null),st=F.useRef(null),Zd=x===0,eh=x+1<=y,Qe=p.type,kr=p.dismissible!==!1,th=p.className||"",rh=p.descriptionClassName||"",Xs=F.useMemo(()=>w.findIndex(G=>G.toastId===p.id)||0,[w,p.id]),sh=F.useMemo(()=>{var G;return(G=p.closeButton)!=null?G:C},[p.closeButton,C]),go=F.useMemo(()=>p.duration||V||Fo,[p.duration,V]),ln=F.useRef(0),Pr=F.useRef(0),vo=F.useRef(0),jr=F.useRef(null),[ih,nh]=re.split("-"),mo=F.useMemo(()=>w.reduce((G,oe,ye)=>ye>=Xs?G:G+oe.height,0),[w,Xs]),_o=lf(),ah=p.invert||f,cn=Qe==="loading";Pr.current=F.useMemo(()=>Xs*X+mo,[Xs,mo]),F.useEffect(()=>{Mt.current=go},[go]),F.useEffect(()=>{Re(!0)},[]),F.useEffect(()=>{let G=st.current;if(G){let oe=G.getBoundingClientRect().height;return as(oe),v(ye=>[{toastId:p.id,height:oe,position:p.position},...ye]),()=>v(ye=>ye.filter(it=>it.toastId!==p.id))}},[v,p.id]),F.useLayoutEffect(()=>{if(!ie)return;let G=st.current,oe=G.style.height;G.style.height="auto";let ye=G.getBoundingClientRect().height;G.style.height=oe,as(ye),v(it=>it.find(nt=>nt.toastId===p.id)?it.map(nt=>nt.toastId===p.id?{...nt,height:ye}:nt):[{toastId:p.id,height:ye,position:p.position},...it])},[ie,p.title,p.description,v,p.id]);let $t=F.useCallback(()=>{wt(!0),Sr(Pr.current),v(G=>G.filter(oe=>oe.toastId!==p.id)),setTimeout(()=>
30{L(p)},wf)},[p,L,v,Pr]);F.useEffect(()=>{if(p.promise&&Qe==="loading"||p.duration===1/0||p.type==="loading")return;let G;return j||g||Q&&_o?(()=>{if(vo.current<ln.current){let oe=new Date().getTime()-ln.current;Mt.current=Mt.current-oe}vo.current=new Date().getTime()})():Mt.current!==1/0&&(ln.current=new Date().getTime(),G=setTimeout(()=>{var oe;(oe=p.onAutoClose)==null||oe.call(p,p),$t()},Mt.current)),()=>clearTimeout(G)},[j,g,p,Qe,Q,_o,$t]),F.useEffect(()=>{p.delete&&$t()},[$t,p.delete]);function oh(){var G,oe,ye;return ae!=null&&ae.loading?F.createElement("div",{className:ot(z==null?void 0:z.loader,(G=p==null?void 0:p.classNames)==null?void 0:G.loader,"sonner-loader"),"data-visible":Qe==="loading"},ae.loading):K?F.createElement("div",{className:ot(z==null?void 0:z.loader,(oe=p==null?void 0:p.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":Qe==="loading"},K):F.createElement(tf,{className:ot(z==null?void 0:z.loader,(ye=p==null?void 0:p.classNames)==null?void 0:ye.loader),visible:Qe==="loading"})}return F.createElement("li",{tabIndex:0,ref:st,className:ot(O,th,z==null?void 0:z.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,z==null?void 0:z.default,z==null?void 0:z[Qe],(r=p==null?void 0:p.classNames)==null?void 0:r[Qe]),"data-sonner-toast":"","data-rich-colors":(s=p.richColors)!=null?s:P,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ie,"data-promise":!!p.promise,"data-swiped":an,"data-removed":Fe,"data-visible":eh,"data-y-position":ih,"data-x-position":nh,"data-index":x,"data-front":Zd,"data-swiping":tr,"data-dismissible":kr,"data-type":Qe,"data-invert":ah,"data-swipe-out":Js,"data-swipe-direction":ne,"data-expanded":!!(j||_e&&ie),style:{"--index":x,"--toasts-before":x,"--z-index":E.length-x,"--offset":`${Fe?on:Pr.current}px`,"--initial-height":_e?"auto":`${ns}px`,...k,...p.style},onDragEnd:()=>{Ke(!1),ee(null),jr.current=null},onPointerDown:G=>{cn||!kr||(os.current=new Date,Sr(Pr.current),G.target.setPointerCapture(G.pointerId),G.target.tagName!=="BUTTON"&&(Ke(!0),jr.current={x:G.clientX,y:G.clientY}))},onPointerUp:()=>{var G,oe,ye,it;if(Js||!kr)return;jr.current=null;let nt=Number(((G=st.current)==null?void 0:G.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dt=Number(((oe=st.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),rr=new Date().getTime()-((ye=os.current)==null?void 0:ye.getTime()),at=q==="x"?nt:Dt,zt=Math.abs(at)/rr;if(Math.abs(at)>=xf||zt>.11){Sr(Pr.current),(it=p.onDismiss)==null||it.call(p,p),De(q==="x"?nt>0?"right":"left":Dt>0?"down":"up"),$t(),nn(!0),rt(!1);return}Ke(!1),ee(null)},onPointerMove:G=>{var oe,ye,it,nt;if(!jr.current||!kr||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let Dt=G.clientY-jr.current.y,rr=G.clientX-jr.current.x,at=(ye=t.swipeDirections)!=null?ye:Ef(re);!q&&(Math.abs(rr)>
301||Math.abs(Dt)>1)&&ee(Math.abs(rr)>Math.abs(Dt)?"x":"y");let zt={x:0,y:0};q==="y"?(at.includes("top")||at.includes("bottom"))&&(at.includes("top")&&Dt<0||at.includes("bottom")&&Dt>0)&&(zt.y=Dt):q==="x"&&(at.includes("left")||at.includes("right"))&&(at.includes("left")&&rr<0||at.includes("right")&&rr>0)&&(zt.x=rr),(Math.abs(zt.x)>0||Math.abs(zt.y)>0)&&rt(!0),(it=st.current)==null||it.style.setProperty("--swipe-amount-x",`${zt.x}px`),(nt=st.current)==null||nt.style.setProperty("--swipe-amount-y",`${zt.y}px`)}},sh&&!p.jsx?F.createElement("button",{"aria-label":te,"data-disabled":cn,"data-close-button":!0,onClick:cn||!kr?()=>{}:()=>{var G;$t(),(G=p.onDismiss)==null||G.call(p,p)},className:ot(z==null?void 0:z.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(n=ae==null?void 0:ae.close)!=null?n:of):null,p.jsx||_.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:F.createElement(F.Fragment,null,Qe||p.icon||p.promise?F.createElement("div",{"data-icon":"",className:ot(z==null?void 0:z.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||oh():null,p.type!=="loading"?p.icon||(ae==null?void 0:ae[Qe])||Zp(Qe):null):null,F.createElement("div",{"data-content":"",className:ot(z==null?void 0:z.content,(o=p==null?void 0:p.classNames)==null?void 0:o.content)},F.createElement("div",{"data-title":"",className:ot(z==null?void 0:z.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?F.createElement("div",{"data-description":"",className:ot(H,rh,z==null?void 0:z.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),_.isValidElement(p.cancel)?p.cancel:p.cancel&&ri(p.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:G=>{var oe,ye;ri(p.cancel)&&kr&&((ye=(oe=p.cancel).onClick)==null||ye.call(oe,G),$t())},className:ot(z==null?void 0:z.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,_.isValidElement(p.action)?p.action:p.action&&ri(p.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:G=>{var oe,ye;ri(p.action)&&((ye=(oe=p.action).onClick)==null||ye.call(oe,G),!G.defaultPrevented&&$t())},className:ot(z==null?void 0:z.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function Lo(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function kf(t,e){let r={};return[t,e].forEach((s,i)=>{let n=i===1,a=n?"--mobile-offset":"--offset",o=n?_f:mf;function l(u){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?l(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?r[`${a}-${u}`]=o:r[`${a}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):l(o)}),r}var Pf=_.forwardRef(function(t,e){let{invert:r,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:n,closeButton:a,className:o,offset:l,mobileOffset:u,theme:d="light",richColors:h,duration:f,style:p,visibleToasts:m=vf,toastOptions:g,dir:v=Lo(),gap:y=bf,loadingIcon:w,icons:x,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:j}=t,[L,P]=F.useState([]),C=F.useMemo(()=>Array.from(new Set([s].concat(L.filter(Q=>Q.position).map(Q=>Q.position)))),[L,s]),[k,A]=F.useState([]),[M,O]=F.useState(!1),[H,V]=F.useState(!1),[re,X]=F.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=F.useRef(null),_e=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=F.useRef(null),ae=F.useRef(!1),te=F.useCallback(Q=>{P(q=>{var ee;return(ee=q.find(ne=>ne.id===Q.id))!=null&&ee.delete||He.dismiss(Q.id),q.filter(({id:ne})=>ne!==Q.id)})},[]);return F.useEffect(()=>He.subscribe(Q=>{if(Q.dismiss){P(q=>q.map(ee=>ee.id===Q.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{ph.flushSync(()=>{P(q=>{let ee=q.findIndex(ne=>ne.id===Q.id);return ee!==-1?[...q.slice(0,ee),{...q[ee],...Q},...q.slice(ee+1)]:[Q,...q]})})})}),[]),F.useEffect(()=>{if(d!=="system"){X(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;let Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:q})=>{X(q?"dark":"light")})}catch{Q.addListener(({matches:ee})=>{try{X(ee?"dark":"light")}catch(ne){console.error(ne)}})}},[d]),F.useEffect(()=>{L.length<=1&&O(!1)},[L]),F.useEffect(()=>{let Q=q=>{var ee,ne;i.every(De=>q[De]||q.code===De)&&(O(!0),(ee=K.current)==null||ee.focus()),q.code==="Escape"&&(document.activeElement===K.current||(ne=K.current)!=null&&ne.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[i]),F.useEffect(()=>{if(K.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,ae.current=!1)}},[K.current]),F.createElement("section",{ref:e,"aria-label":`${E} ${_e}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((Q,q)=>{var ee;let[ne,De]=Q.split("-");return L.length?F.createElement("ol",{key:Q,dir:v==="auto"?Lo():v,tabIndex:-1,ref:K,className:o,"data-sonner-toaster":!0,"data-theme":re,"data-y-position":ne,"data-lifted":M&&L.length>1&&!n,"data-x-position":De,style:{"--front-toast-height":`${((ee=k[0])==null?void 0:ee.height)||0}px`,"--width":`${yf}px`,"--gap":`${y}px`,...p,...kf(l,u)},onBlur:ie=>{ae.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(ae.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,z.current=ie.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{H||O(!1)},onDragEnd:()=>O(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},L.filter(ie=>!ie.position&&q===0||ie.position===Q).map((ie,Re)=>{var Fe,wt;return F.createElement(Sf,{key:ie.id,icons:x,index:Re,toast:ie,defaultRichColors:h,duration:(Fe=g==null?void 0:g.duration)!=null?Fe:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:m,closeButton:(wt=g==null?void 0:g.closeButton)!=null?wt:a,interacting:H,position:Q,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:te,toasts:L.filter(tr=>tr.position==ie.position),heights:k.filter(tr=>tr.position==ie.position),setHeights:A,expandByDefault:n,gap:y,loadingIcon:w,exp
30anded:M,pauseWhenPageIsHidden:j,swipeDirections:t.swipeDirections})})):null}))});const jf=({...t})=>c.jsx(Pf,{theme:"dark",position:"bottom-right",duration:4e3,className:"toaster group",toastOptions:{classNames:{toast:"group toast font-sans group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border group-[.toaster]:border-border group-[.toaster]:shadow-[0_24px_48px_-16px_hsl(0_0%_0%/0.6)] group-[.toaster]:rounded-lg",description:"group-[.toast]:text-text-secondary",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-background-tertiary group-[.toast]:text-text-secondary",success:"group-[.toaster]:!text-success",error:"group-[.toaster]:!text-destructive",warning:"group-[.toaster]:!text-warning"}},...t}),Cf=1,Tf=1e6;let pn=0;function Rf(){return pn=(pn+1)%Number.MAX_SAFE_INTEGER,pn.toString()}const fn=new Map,Mo=t=>{if(fn.has(t))return;const e=setTimeout(()=>{fn.delete(t),Cs({type:"REMOVE_TOAST",toastId:t})},Tf);fn.set(t,e)},Nf=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Cf)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?Mo(r):t.toasts.forEach(s=>{Mo(s.id)}),{...t,toasts:t.toasts.map(s=>
30s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},pi=[];let fi={toasts:[]};function Cs(t){fi=Nf(fi,t),pi.forEach(e=>{e(fi)})}function Af({...t}){const e=Rf(),r=i=>Cs({type:"UPDATE_TOAST",toast:{...i,id:e}}),s=()=>Cs({type:"DISMISS_TOAST",toastId:e});return Cs({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||s()}}}),{id:e,dismiss:s,update:r}}function Of(){const[t,e]=_.useState(fi);return _.useEffect(()=>(pi.push(e),()=>{const r=pi.indexOf(e);r>-1&&pi.splice(r,1)}),[t]),{...t,toast:Af,dismiss:r=>Cs({type:"DISMISS_TOAST",toastId:r})}}function Gc(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=Gc(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function Wc(){for(var t,e,r=0,s="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=Gc(t))&&(s&&(s+=" "),s+=e);return s}const $o=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Do=Wc,Yc=(t,e)=>r=>{var s;if((e==null?void 0:e.variants)==null)return Do(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:n}=e,a=Object.keys(i).map(u=>{const d=r==null?void 0:r[u],h=n==null?void 0:n[u];if(d===null)return null;const f=$o(d)||$o(h);return i[u][f]}),o=r&&Object.entries(r).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),l=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...n,...o}[g]):{...n,...o}[g]===v})?[...u,h,f]:u},[]);return Do(t,a,l,r==null?void 0:r.class,r==null?void 0:r.className)};/** 31 * @license lucide-react v0.462.0 - ISC 32 * 33 * This source code is licensed under the ISC license. 34 * See the LICENSE file in the root directory of this source tree. 35 */const If=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Kc=(...t)=>t.filter((e,r,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===r).join(" ").trim();/** 36 * @license lucide-react v0.462.0 - ISC 37 * 38 * This source code is licensed under the ISC license. 39 * See the LICENSE file in the root directory of this source tree. 40 */var Ff={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const Lf=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:i="",children:n,iconNode:a,...o},l)=>_.createElement("svg",{ref:l,...Ff,width:e,height:e,stroke:t,strokeWidth:s?Number(r)*24/Number(e):r,className:Kc("lucide",i),...o},[...a.map(([u,d])=>_.createElement(u,d)),...Array.isArray(n)?n:[n]]));/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */const Ks=(t,e)=>{const r=_.forwardRef(({className:s,...i},n)=>_.createElement(Lf,{ref:n,iconNode:e,className:Kc(`lucide-${If(t)}`,s),...i}));return r.displayName=`${t}`,r};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const Ya=Ks("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const Mf=Ks("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const $f=Ks("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const Qc=Ks("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const Ka=Ks("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 12,241 bytes, line 75
75],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qa="-",Df=t=>{const e=Bf(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:a=>{const o=a.split(Qa);return o[0]===""&&o.length!==1&&o.shift(),Jc(o,e)||zf(a)},getConflictingClassGroupIds:(a,o)=>{const l=r[a]||[];return o&&s[a]?[...l,...s[a]]:l}}},Jc=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const r=t[0],s=e.nextPart.get(r),i=s?Jc(t.slice(1),s):void 0;if(i)return i;if(e.validators.length===0)return;const n=t.join(Qa);return(a=e.validators.find(({validator:o})=>o(n)))==null?void 0:a.classGroupId},zo=/^\[(.+)\]$/,zf=t=>{if(zo.test(t)){const e=zo.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},Bf=t=>{const{theme:e,prefix:r}=t,s={nextPart:new Map,validators:[]};return Vf(Object.entries(t.classGroups),r).forEach(([n,a])=>{Zn(a,s,n,e)}),s},Zn=(t,e,r,s)=>{t.forEach(i=>{if(typeof i=="string"){const n=i===""?e:Bo(e,i);n.classGroupId=r;return}if(typeof i=="function"){if(Uf(i)){Zn(i(s),e,r,s);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([n,a])=>{Zn(a,Bo(e,n),r,s)})})},Bo=(t,e)=>{let r=t;return e.split(Qa).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},Uf=t=>t.isThemeGetter,Vf=(t,e)=>e?t.map(([r,s])=>{const i=s.map(n=>typeof n=="string"?e+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([a,o])=>[e+a,o])):n);return[r,i]}):t,qf=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,s=new Map;const i=(n,a)=>{r.set(n,a),e++,e>t&&(e=0,s=r,r=new Map)};return{get(n){let a=r.get(n);if(a!==void 0)return a;if((a=s.get(n))!==void 0)return i(n,a),a},set(n,a){r.has(n)?r.set(n,a):i(n,a)}}},Xc="!",Hf=t=>{const{separator:e,experimentalParseClassName:r}=t,s=e.length===1,i=e[0],n=e.length,a=o=>{const l=[];let u=0,d=0,h;for(let v=0;v<o.length;v++){let y=o[v];if(u===0){if(y===i&&(s||o.slice(v,v+n)===e)){l.push(o.slice(d,v)),d=v+n;continue}if(y==="/"){h=v;continue}}y==="["?u++:y==="]"&&u--}const f=l.length===0?o:o.substring(d),p=f.startsWith(Xc),m=p?f.substring(1):f,g=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return r?o=>r({className:o,parseClassName:a}):a},Gf=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(s=>{s[0]==="["?(e.push(...r.sort(),s),r=[]):r.push(s)}),e.push(...r.sort()),e},Wf=t=>({cache:qf(t.cacheSize),parseClassName:Hf(t),...Df(t)}),Yf=/\s+/,Kf=(t,e)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:i}=e,n=[],a=t.trim().split(Yf);let o="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=r(u);let m=!!p,g=s(m?f.substring(0,p):f);if(!g){if(!m){o=u+(o.length>0?" "+o:o);continue}if(g=s(f),!g){o=u+(o.length>0?" "+o:o);continue}m=!1}const v=Gf(d).join(":"),y=h?v+Xc:v,w=y+g;if(n.includes(w))continue;n.push(w);const x=i(g,m);for(let E=0;E<x.length;++E){const j=x[E];n.push(y+j)}o=u+(o.length>0?" "+o:o)}return o};function Qf(){let t=0,e,r,s="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Zc(e))&&(s&&(s+=" "),s+=r);return s}const Zc=t=>{if(typeof t=="string")return t;let e,r="";for(let s=0;s<t.length;s++)t[s]&&(e=Zc(t[s]))&&(r&&(r+=" "),r+=e);return r};function Jf(t,...e){let r,s,i,n=a;function a(l){const u=e.reduce((d,h)=>h(d),t());return r=Wf(u),s=r.cache.get,i=r.cache.set,n=o,o(l)}function o(l){const u=s(l);if(u)return u;const d=Kf(l,r);return i(l,d),d}return function(){return n(Qf.apply(null,arguments))}}const ge=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},eu=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xf=/^\d+\/\d+$/,Zf=new Set(["px","full","screen"]),eg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tg=/\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$/,rg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ig=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Et=t=>$r(t)||Zf.has(t)||Xf.test(t),Bt=t=>is(t,"length",hg),$r=t=>!!t&&!Number.isNaN(Number(t)),gn=t=>is(t,"number",$r),ls=t=>!!t&&Number.isInteger(Number(t)),ng=t=>t.endsWith("%")&&$r(t.slice(0,-1)),J=t=>eu.test(t),Ut=t=>eg.test(t),ag=new Set(["length","size","percentage"]),og=t=>is(t,ag,tu),lg=t=>is(t,"position",tu),cg=new Set(["image","url"]),ug=t=>is(t,cg,fg),dg=t=>is(t,"",pg),cs=()=>!0,is=(t,e,r)=>{const s=eu.exec(t);return s?s[1]?typeof e=="string"?s[1]===e:e.has(s[1]):r(s[2]):!1},hg=t=>tg.test(t)&&!rg.test(t),tu=()=>!1,pg=t=>sg.test(t),fg=t=>ig.test(t),gg=()=>{const t=ge("colors"),e=ge("spacing"),r=ge("blur"),s=ge("brightness"),i=ge("borderColor"),n=ge("borderRadius"),a=ge("borderSpacing"),o=ge("borderWidth"),l=ge("contrast"),u=ge("grayscale"),d=ge("hueRotate"),h=ge("invert"),f=ge("gap"),p=ge("gradientColorStops"),m=ge("gradientColorStopPositions"),g=ge("inset"),v=ge("margin"),y=ge("opacity"),w=ge("padding"),x=ge("saturate"),E=ge("scale"),j=ge("sepia"),L=ge("skew"),P=ge("space"),C=ge("translate"),k=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",J,e],O=()=>[J,e],H=()=>["",Et,Bt],V=()=>["auto",$r,J],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",J],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>[$r,J];return{cacheSize:500,separator:":",theme:{colors:[cs],spacing:[Et,Bt],blur:["none","",Ut,J],brightness:te(),borderColor:[t],borderRadius:["none","","full",Ut,J],borderSpacing:O(),borderWidth:H(),contrast:te(),grayscale:z(),hueRotate:te(),invert:z(),gap:O(),gradientColorStops:[t],gradientColorStopPositions:[ng,Bt],inset:M(),margin:M(),opacity:te(),padding:O(),saturate:te(),scale:te(),sepia:z(),skew:te(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",J]}],container:["container"],columns:[{columns:[Ut]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"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"],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:[...re(),J]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ls,J]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",J]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",ls,J]}],"grid-cols":[{"grid-cols":[cs]}],"col-start-end":[{col:["auto",{span:["full",ls,J]},J]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[cs]}],"row-start-end":[{row:["auto",{span:[ls,J]},J]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",J]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",J]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",..._e()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._e(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._e(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",J,e]}],"min-w":[{"min-w":[J,e,"min","max","fit"]}],"max-w":[{"max-w":[J,e,"none","full","min","max","fit","prose",{screen:[Ut]},Ut]}],h:[{h:[J,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[J,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[J,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[J,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Ut,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gn]}],"font-family":[{font:[cs]}],"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:["tighter","tight","normal","wide","wider","widest",J]}],"line-clamp":[{"line-clamp":["none",$r,gn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Et,J]}],"list-image":[{"list-image":["none",J]}],"list-style-type":[{list:["none","disc","decimal",J]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Et,Bt]}],"underline-offset":[{"underline-offset":["auto",Et,J]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",J]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),lg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",og]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ug]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}
75],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,460 bytes, line 75
75],"divide-style":[{divide:X()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[Et,J]}],"outline-w":[{outline:[Et,Bt]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Et,Bt]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Ut,dg]}],"shadow-color":[{shadow:[cs]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ut,J]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[x]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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:["none","all","","colors","opacity","shadow","transform",J]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",J]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",J]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[ls,J]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",J]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],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",J]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",J]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Et,Bt,gn]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
75none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},vg=Jf(gg);function pe(...t){return vg(Wc(t))}const mg=fh,ru=_.forwardRef(({className:t,...e},r)=>c.jsx(gc,{ref:r,className:pe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));ru.displayName=gc.displayName;const _g=Yc("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),su=_.forwardRef(({className:t,variant:e,...r},s)=>c.jsx(vc,{ref:s,className:pe(_g({variant:e}),t),...r}));su.displayName=vc.displayName;const yg=_.forwardRef(({className:t,...e},r)=>c.jsx(mc,{ref:r,className:pe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));yg.displayName=mc.displayName;const iu=_.forwardRef(({className:t,...e},r)=>c.jsx(_c,{ref:r,className:pe("absolute right-2 top-2 rounded-md p-1 text-foreground
75/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:c.jsx(Ka,{className:"h-4 w-4"})}));iu.displayName=_c.displayName;const nu=_.forwardRef(({className:t,...e},r)=>c.jsx(yc,{ref:r,className:pe("text-sm font-semibold",t),...e}));nu.displayName=yc.displayName;const au=_.forwardRef(({className:t,...e},r)=>c.jsx(bc,{ref:r,className:pe("text-sm opacity-90",t),...e}));au.displayName=bc.displayName;function bg(){const{toasts:t}=Of();return c.jsxs(mg,{children:[t.map(function({id:e,title:r,description:s,action:i,...n}){return c.jsxs(su,{...n,children:[c.jsxs("div",{className:"grid gap-1",children:[r&&c.jsx(nu,{children:r}),s&&c.jsx(au,{children:s})]}),i,c.jsx(iu,{})]},e)}),c.jsx(ru,{})]})}const xg=gh,wg=_.forwardRef(({className:t,sideOffset:e=4,...r},s)=>c.jsx(xc,{ref:s,sideOffset:e,className:pe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));wg.displayName=xc.displayName;const Eg="https://nhckcgrkrneiqdppmnmt.supabase.co",Sg="sb_publishable_f632Cxu7mO-c-riVtG7yow__t08a9wT",ou=Eg,kg=Sg,Wy=`${ou}/functions/v1`,dr=wh(ou,kg,{auth:{persistSession:!0,autoRefreshToken:!0,storage:localStorage}});var b=typeof window<"u"?window:void 0,Te=typeof globalThis<"u"?globalThis:b;typeof self>"u"&&(Te.self=Te),typeof File>"u"&&(Te.File=function(){});var Ue=Te==null?void 0:Te.navigator,I=Te==null?void 0:Te.document,Pe=Te==null?void 0:Te.location,ea=Te==null?void 0:Te.fetch,ta=Te!=null&&Te.XMLHttpRequest&&"withCredentials"in new Te.XMLHttpRequest?Te.XMLHttpRequest:void 0,Uo=Te==null?void 0:Te.AbortController,Pg=Te==null?void 0:Te.CompressionStream,qe=Ue==null?void 0:Ue.userAgent,$=b??{};function lu(){return!(!b||b.navigator.onLine===!1)}var Vo="1.398.7",ke={DEBUG:!1,LIB_VERSION:Vo,LIB_NAME:"web",JS_SDK_VERSION:Vo};function qo(t,e,r,s,i,n,a){try{var o=t[n](a),l=o.value}catch(u){return void r(u)}o.done?e(l):Promise.resolve(l).then(s,i)}function Ce(t){return function(){var e=this,r=arguments;return new Promise(function(s,i){var n=t.apply(e,r);function a(l){qo(n,s,i,a,o,"next",l)}function o(l){qo(n,s,i,a,o,"throw",l)}a(void 0)})}}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var s in r)({}
75).hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},T.apply(null,arguments)}function cu(t,e){if(t==null)return{};var r={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.indexOf(s)!==-1)continue;r[s]=t[s]}return r}var Ho=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function Go(t){return typeof t=="string"||t}function Wo(t){return typeof t=="string"?t:void 0}var us,Rt=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.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),Yo=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),jg=["$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"],Cg=["token"],uu="NativeGzipValidationError",ra=t=>t.length>=2&&t[0]===31&&t[1]===139,Ko=(t,e)=>t===Yo.GZipJS||e===Yo.GZipJS||e==="gzip",Qo=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",si=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=uu,e},Tg=function(){var t=Ce(function*(e,r){18>e.size&&si("too-short");var s=new Uint8Array(yield e.slice(0,10).arrayBuffer());ra(s)&&s[2]===8||si("invalid-header");var i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(a=>{for(var o=(()=>{if(us)return us;us=[];for(var d=0;256>d;d++){for(var h=d,f=0;8>f;f++)h=1&h?3988292384^h>>>1:h>>>1;us[d]=h>>>0}return us})(),l=4294967295,u=0;a.length>u;u++)l=o[255&(l^a[u])]^l>>>8;return(4294967295^l)>>>0})(r)&&si("invalid-crc");var n=r.length>>>0;i.getUint32(4,!0)!==n&&si("invalid-size")});return function(e,r){return t.apply(this,arguments)}}();function sa(){return sa=Ce(function*(t,e,r){e===void 0&&(e=!0);try{var s=new TextEncoder().encode(t),i=new CompressionStream("gzip"),n=i.writable.getWriter(),a=n.write(s).then(()=>n.close()).catch(function(){var u=Ce(function*(d){try{yield n.abort(d)}catch{}throw d});return function(d){return u.apply(this,arguments)}}()),o=new Response(i.readable).blob(),[l]=yield Promise.all([o,a]);return yield Tg(l,s),l}catch(u){if(r!=null&&r.rethrow)throw u;return e&&console.error("Failed to gzip compress data",u),null}}),sa.apply(this,arguments)}var Rg=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Jo=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var r=t.toLowerCase();return Rg.concat(e).some(s=>{var i=s.toLowerCase();return r.indexOf(i)!==-1})};function B(t,e){return t.indexOf(e)!==-1}var Zi=function(t){return t.trim()},ia=function(t){return t.replace(/^\$/,"")},du=Object.prototype,hu=du.hasOwnProperty,en=du.toString,Z=Array.isArray||function(t){return en.call(t)==="[object Array]"},ht=t=>typeof t=="function",ve=t=>t===Object(t)&&!Z(t),Qt=t=>{if(ve(t)){for(var e in t)if(hu.call(t,e))return!1;return!0}return!1},N=t=>t===void 0,ce=t=>en.call(t)=="[object String]",na=t=>ce(t)&&t.trim().length===0,Ve=t=>t===null,Y=t=>N(t)||Ve(t),Ie=t=>en.call(t)=="[object Number]"&&t==t,Ct=t=>Ie(t)&&t>0,yt=t=>en.call(t)==="[object Boolean]",Ng=t=>t instanceof FormData,Ag=t=>B(jg,t),Og=t=>B(Cg,t);function pu(t){return t===null||typeof t!="object"}function Pi(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Ja(t){return typeof Event<"u"&&function(e,r){try{return e instanceof r}catch{return!1}}(t,Event)}
75var Ig=[!0,"true",1,"1","yes"],vn=t=>B(Ig,t),Fg=[!1,"false",0,"0","no"];function _t(t,e,r,s,i){return e>r&&(s.warn("min cannot be greater than max."),e=r),Ie(t)?t>r?(s.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(s.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(s.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),_t(i||r,e,r,s))}class Lg{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=_t(e.bucketSize,0,100,e.Ae),this.$e=_t(e.refillRate,0,this.Fe,e.Ae),this.De=_t(e.refillInterval,0,864e5,e.Ae)}Ne(e,r){var s=Math.floor((r-e.lastAccess)/this.De);s>0&&(e.tokens=Math.min(e.tokens+s*this.$e,this.Fe),e.lastAccess=e.lastAccess+s*this.De)}consumeRateLimit(e){var r,s=Date.now(),i=String(e),n=this.Ee[i];return n?this.Ne(n,s):this.Ee[i]=n={tokens:this.Fe,lastAccess:s},n.tokens===0||(n.tokens--,n.tokens===0&&((r=this.Pe)==null||r.call(this,e)),n.tokens===0)}stop(){this.Ee={}}}var Ye="Mobile",ji="iOS",Ft="Android",Qr="Tablet",fu=Ft+" "+Qr,gu="iPad",vu="Apple",mu=vu+" Watch",Ts="Safari",Jr="BlackBerry",_u="Samsung",yu=_u+"Browser",bu=_u+" Internet",br="Chrome",Mg=br+" OS",xu=br+" "+ji,Xa="Internet Explorer",wu=Xa+" "+Ye,Za="Opera",$g=Za+" Mini",eo="Edge",Eu="Microsoft "+eo,Dr="Firefox",Su=Dr+" "+ji,Ds="Nintendo",zs="PlayStation",zr="Xbox",ku=Ft+" "+Ye,Pu=Ye+" "+Ts,xs="Windows",aa=xs+" Phone",Xo="Nokia",oa="Ouya",ju="Generic",Dg=ju+" "+Ye.toLowerCase(),Cu=ju+" "+Qr.toLowerCase(),la="Konqueror",Tu="Oculus Browser",Ci="Vivaldi",Ru="Yandex",Ti="Whale",ca="DuckDuckGo",Nu="Pale Moon",Ri="Waterfox",Rs="Brave",Au="Google Search App",be="(\\d+(\\.\\d+)?)",mn=new RegExp("Version/"+be),zg=new RegExp(zr,"i"),Bg=new RegExp(zs+" \\w+","i"),Ug=new RegExp(Ds+" \\w+","i"),to=new RegExp(Jr+"|PlayBook|BB10","i"),Vg={"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"},Ou=function(t,e,r,s){e=e||"";var i=function(n){return n!=null&&n.brave?Rs:null}(r);return i||(s!=null&&s.detectGoogleSearchApp&&B(t,"GSA/")?Au:B(t," OPR/")&&B(t,"Mini")?$g:B(t," OPR/")?Za:to.test(t)?Jr:B(t,"IE"+Ye)||B(t,"WPDesktop")?wu:B(t,"OculusBrowser")?Tu:B(t,yu)?bu:B(t,eo)||B(t,"Edg/")?Eu:B(t,Ci+"/")?Ci:B(t,"YaBrowser/")?Ru:B(t,Ti+"/")?Ti:B(t,ca+"/")||B(t,"Ddg/")?ca:B(t,"FBIOS")?"Facebook "+Ye:B(t,"UCWEB")||B(t,"UCBrowser")?"UC Browser":B(t,"CriOS")?xu:B(t,"CrMo")||B(t,br)?br:B(t,Ft)&&B(t,Ts)?ku:B(t,"FxiOS")?Su:B(t.toLowerCase(),la.toLowerCase())?la:B(t,Rs+"/")?Rs:((n,a)=>a&&B(a,vu)||function(o){return B(o,Ts)&&!B(o,br)&&!B(o,Ft)}(n))(t,e)?B(t,Ye)?Pu:Ts:B(t,"PaleMoon/")?Nu:B(t,Ri+"/")?Ri:B(t,Dr)?Dr:B(t,"MSIE")||B(t,"Trident/")?Xa:B(t,"Gecko")?Dr:"")},qg={[wu]:[new RegExp("rv:"+be)],[Eu]:[new RegExp(eo+"?\\/"+be)],[br]:[new RegExp("("+br+"|CrMo)\\/"+be)],[xu]:[new RegExp("CriOS\\/"+be)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+be)],[Ts]:[mn],[Pu]:[mn],[Za]:[new RegExp("(Opera|OPR)\\/"+be)],[Dr]:[new RegExp(Dr+"\\/"+be)],[Su]:[new RegExp("FxiOS\\/"+be)],[la]:[new RegExp("Konqueror[:/]?"+be,"i")],[Jr]:[new RegExp(Jr+" "+be),mn],[ku]:[new RegExp("android\\s"+be,"i")],[bu]:[new RegExp(yu+"\\/"+be)],[Tu]:[new RegExp("OculusBrowser\\/"+be)],[Ci]:[new RegExp(Ci+"\\/"+be)],[Ru]:[new RegExp("YaBrowser\\/"+be)],[Ti]:[new RegExp(Ti+"\\/"+be)],[Rs]:[new RegExp(Rs+"\\/"+be)],[ca]:[new RegExp("(DuckDuckGo|Ddg)\\/"+be)],[Nu]:[new RegExp("PaleMoon\\/"+be)],[Ri]:[new RegExp(Ri+"\\/"+be)],[Au]:[new RegExp("GSA\\/"+be)],[Xa]:[new RegExp("(rv:|MSIE )"+be)],Mozilla:[new RegExp("rv:"+be)]},Hg=function(t,e,r,s){var i=Ou(t,e,r,s),n=qg[i];if(N(n))return null;for(var a=0;n.length>a;a++){var o=t.match(n[a]);if(o)return parseFloat(o[o.length-2])}return null},Zo=[[new RegExp(zr+"; "+zr+" (.*?)[);]","i"),t=>[zr,t&&t[1]||""]],[new RegExp(Ds,"i"),[Ds,""]],[new RegExp(zs,"i"),[zs,""]],[to,[Jr,""]],[new RegExp(xs,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[aa,""];if(new RegExp(Ye).test(e)&&!/IEMobile\b/.test(e))return[xs+" "+Ye,""];
75var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var s=Vg[r[1]]||"";return/arm/i.test(e)&&(s="RT"),[xs,s]}return[xs,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[ji,[t[3],t[4],t[5]||"0"].join(".")]:[ji,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=N(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ft+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ft+")","i"),t=>t&&t[2]?[Ft,[t[2],t[3],t[4]||"0"].join(".")]:[Ft,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Mg,""]],[/Linux|debian/i,["Linux",""]]],el=function(t){return Ug.test(t)?Ds:Bg.test(t)?zs:zg.test(t)?zr:new RegExp(oa,"i").test(t)?oa:new RegExp("("+aa+"|WPDesktop)","i").test(t)?aa:/iPad/.test(t)?gu:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?mu:to.test(t)?Jr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Xo,"i").test(t)?Xo:/(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(Ye).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)?Ft:fu:new RegExp("(pda|"+Ye+")","i").test(t)?Dg:new RegExp(Qr,"i").test(t)&&!new RegExp(Qr+" pc","i").test(t)?Cu:""},Gg=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tl(t,e){return typeof(r=t)=="string"&&Gg.test(r)?t:e();var r}function Xt(t){return t&&t.split("#")[0]}function _n(t,e){var r=setTimeout(t,e);return r!=null&&r.unref&&(r==null||r.unref()),r}var Wg=t=>t instanceof Error,Iu={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Yg=Iu.info;function Fu(t){if(yt(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(Z(t))return{arrayValue:{values:t.map(e=>Fu(e))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function Lu(t){var e=[];for(var r in t){var s=t[r];Ve(s)||N(s)||e.push({key:r,value:Fu(s)})}return e}function Kg(t,e){var r=t.level||"info",{text:s,number:i}=Iu[r]||Yg,n=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Y(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Y(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var o=T({},a,t.attributes||{}),l={timeUnixNano:n,observedTimeUnixNano:n,severityNumber:i,severityText:s,body:{stringValue:t.body},attributes:Lu(o)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),N(t.trace_flags)||(l.flags=t.trace_flags),l}function Mu(t,e,r){return T({},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":r})}function $u(t,e,r,s){return{resourceLogs:[{resource:{attributes:Lu(e)},scopeLogs:[{scope:{name:r,version:s},logRecords:t}]}]}}let Qg=class{constructor(t,e,r,s,i,n,a){var o;n===void 0&&(n=()=>Promise.resolve()),this._instance=t,this.Se=e,this.Ae=r,this.qe=s,this.Be=i,this.je=n,this.He=a,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=e.maxBufferSize,this.Je=Math.max((o=e.maxQueueSize)!==null&&o!==void 0?o:e.maxBufferSize,e.maxBufferSize),this.Ye=e.flushIntervalMs,this.Ke=e.maxBatchRecordsPerPost,this.Xe=e.rateCapWindowMs,this.et=e.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.it(t);if(e!==null)if(e.body){if(this.nt()){var r={record:Kg(e,this.qe())};this.Be(()=>this.st(r))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(t){var e=this.Se.beforeSend;if(!e)return t;var r=Z(e)?e:[e],s=t;for(var i of r)try{var n=i(s);if(!n)return this.Ae.info("Log was rejected in beforeSend function"),null;s=n}catch(a){return this.Ae.error("Error in beforeSend function for log:",a),null}return s}nt(){if(this.et===void 0)return!0;var t=Date.now(),e=t-this.We;return this.Xe>e&&e>=0||(this.We=t,this.Ge=0,this.Ze=!1),this.et>
75this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var t=this;return Ce(function*(){if(!t._instance.isDisabled)return t.Ue||(t.Ue=t.ot().finally(()=>{t.Ue=null})),t.Ue})()}ot(){var t=this;return Ce(function*(){var e;t.tt();var r=(e=t._instance.getPersistedProperty(Rt.LogsQueue))!==null&&e!==void 0?e:[];if(r.length!==0)for(var s=r.length,i=0;r.length>0&&s>i;){var n,a;t.ze=0;var o=Math.min(r.length,t.Ke),l=r.slice(0,o),u=$u(l.map(h=>h.record),t.ut(),(n=t.He)!==null&&n!==void 0?n:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.ht(u);if(d.kind==="too-large"&&l.length>1)t.Ke=Math.max(1,Math.floor(l.length/2)),t.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ke);else if(d.kind==="retry-later"||(d.kind==="too-large"?t.Ae.warn("Dropping a single log record after 413 with batch size 1 â the record is larger than the server cap and cannot be split further."):d.kind==="ok"&&t.Se.maxBatchRecordsPerPost>t.Ke&&(t.Ke=Math.min(t.Se.maxBatchRecordsPerPost,t.Ke+1)),yield t.dt(l.length),r=(a=t._instance.getPersistedProperty(Rt.LogsQueue))!==null&&a!==void 0?a:[],i+=l.length,d.kind==="fatal"))throw d.error}})()}dt(t){var e=this;return Ce(function*(){var r,s=Math.max(0,t-e.ze),i=(r=e._instance.getPersistedProperty(Rt.LogsQueue))!==null&&r!==void 0?r:[];e._instance.setPersistedProperty(Rt.LogsQueue,i.slice(s)),yield e.je()})()}ut(){return Mu(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(t){var e;if(!this._instance.optedOut){var r=(e=this._instance.getPersistedProperty(Rt.LogsQueue))!==null&&e!==void 0?e:[];this.Je>r.length||(r.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(Rt.LogsQueue,r),this.Qe>r.length?this.ct():this.rt()}}ct(t){t===void 0&&(t=this.Ye),this.vt||(this.vt=_n(()=>{this.vt=void 0,this.rt()},t))}ft(){var t=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*Math.pow(2,t)}yt(){var t=this._instance.getPersistedProperty(Rt.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Ce(function*(){e.tt();var r=e.flush().catch(()=>{});t!==void 0?yield Promise.race([r,new Promise(s=>_n(s,t))]):yield r})()}flushWithTimeout(t){var e=this;return Ce(function*(){var r=!1,s=e.flush(),i=new Promise(n=>_n(()=>{r=!0,n()},t));try{yield Promise.race([s,i])}finally{r&&s.catch(()=>{})}})()}rt(){this.flush().then(()=>{this.Ve=0},t=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())})}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};var ii,rl,yn;function Jg(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return yn&&r.length===rl||(rl=r.length,yn=r.reduce((s,i)=>{ii||(ii={});var n=ii[i];if(n)s[n[0]]=n[1];else for(var a=t(i),o=a.length-1;o>=0;o--){var l=a[o],u=l==null?void 0:l.filename,d=e[i];if(u&&d){s[u]=d,ii[i]=[u,d];break}}return s},{})),yn}}class Xg{constructor(e,r,s){s===void 0&&(s=[]),this.coercers=e,this.stackParser=r,this.modifiers=s}buildFromUnknown(e,r){r===void 0&&(r={});var s=r&&r.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(s,r,0).apply(e),n=this.buildParsingContext(r),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,s),$exception_level:"error"}}modifyFrames(e){var r=this;return Ce(function*(){for(var s of e)s.stacktrace&&s.stacktrace.frames&&Z(s.stacktrace.frames)&&(s.stacktrace.frames=yield r.applyModifiers(s.stacktrace.frames));return e})()}coerceFallback(e){var r;return{type:"Error",value:"Unknown error",stack:(r=e.syntheticException)==null?void 0:r.stack,synthetic:!0}}parseStacktrace(e,r){var s,i;return e.cause!=null&&(s=this.parseStacktrace(e.cause,r)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?r.skipFirstLines:0),r.chunkIdMap)),T({},e,{cause:s,stack:i})}applyChunkIds(e,r){return e.map(s=>(s.filename&&r&&(s.chunk_id=r[s.filename]),s))}applyCoercers(e,r){for(var s of this.coercers)if(s.match(e))return s.coerce(e,r);return this.coerceFallback(r)}applyModifiers(e){var r=this;return Ce(function*(){var s=e;for(var i of r.modifiers)s=yield i(s);return s})()}convertToExceptionList(e,r){var s,i,n,a={type:e.type,value:e.value,mechanism:{type:(s=r.type)!==null&&s!==void 0?s:"generic",handled:(i=r.handled)===null||i===void 0||i,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,T({},r,{handled:!0}))),o}buildParsingContext(e){var r;return{chunkIdMap:Jg(this.stackParser),skipFirstLines:(r=e.skipFirstLines)!==null&&r!==void 0?r:1}}buildCoercingContext(e,r,s){s===void 0&&(s=0);var i=(n,a)=>
75{if(4>=a){var o=this.buildCoercingContext(e,r,a);return this.applyCoercers(n,o)}};return T({},r,{syntheticException:s==0?r.syntheticException:void 0,mechanism:e,apply:n=>i(n,s),next:n=>i(n,s+1)})}}var Xr="?";function ua(t,e,r,s,i){var n={platform:t,filename:e,function:r==="<anonymous>"?Xr:r,in_app:!0};return N(s)||(n.lineno=s),N(i)||(n.colno=i),n}var Du=(t,e)=>{var r=t.indexOf("safari-extension")!==-1,s=t.indexOf("safari-web-extension")!==-1;return r||s?[t.indexOf("@")!==-1?t.split("@")[0]:Xr,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Zg=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ev=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tv=/\((\S*)(?::(\d+))(?::(\d+))\)/,rv=(t,e)=>{var r=Zg.exec(t);if(r){var[,s,i,n]=r;return ua(e,s,Xr,+i,+n)}var a=ev.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var o=tv.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,u]=Du(a[1]||Xr,a[2]);return ua(e,u,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},sv=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,iv=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,nv=(t,e)=>{var r=sv.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var s=iv.exec(r[3]);s&&(r[1]=r[1]||"eval",r[3]=s[1],r[4]=s[2],r[5]="")}var i=r[3],n=r[1]||Xr;return[n,i]=Du(n,i),ua(e,i,n,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},sl=/\(error: (.*)\)/;class av{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,r){var s=ce(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:s?e.stack:void 0,cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var r=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?r+": "+e.message:r}isDOMException(e){return Pi(e,"DOMException")}isDOMError(e){return Pi(e,"DOMError")}}class ov{match(e){return(r=>r instanceof Error)(e)}coerce(e,r){return{type:this.getType(e),value:this.getMessage(e,r),stack:this.getStack(e),cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,r){var s=e.message;return String(s.error&&typeof s.error.message=="string"?s.error.message:s)}getStack(e){return e.stacktrace||e.stack||void 0}}class lv{constructor(){}match(e){return Pi(e,"ErrorEvent")&&e.error!=null}coerce(e,r){var s;return r.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}}var cv=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class uv{match(e){return typeof e=="string"}coerce(e,r){var s,[i,n]=this.getInfos(e);return{type:i??"Error",value:n??e,stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}getInfos(e){var r="Error",s=e,i=e.match(cv);return i&&(r=i[1],s=i[2]),[r,s]}}var dv=["fatal","error","warning","log","info","debug"];function zu(t,e){e===void 0&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var s=r.length;s>0;s--){var i=r.slice(0,s).join(", ");if(e>=i.length)return s===r.length?i:i.length>e?i.slice(0,e)+"...":i}return""}class hv{match(e){return typeof e=="object"&&e!==null}coerce(e,r){var s,i=this.getErrorPropertyFromObject(e);return i?r.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(s=r.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Ja(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var r="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(r+=" with message: '"+e.message+"'"),r}if("message"in e&&typeof e.message=="string")return e.message;var s=this.getObjectClassName(e);return(s&&s!=="Object"?"'"+s+"'":"Object")+" captured as exception with keys: "+zu(e)}isSeverityLevel(e){return ce(e)&&!na(e)&&dv.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var r in e)if({}.hasOwnProperty.call(e,r)){var s=e[r];if(Wg(s))return s}}getObjectClassName(e){try{var r=Object.getPrototypeOf(e);return r?r.constructor.name:void 0}catch{return}}}class pv{match(e){return Ja(e)}coerce(e,r){var s,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+zu(e),stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class fv{match(e){return pu(e)}coerce(e,r){var s;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class gv{match(e){return Pi(e,"PromiseRejectionEvent")||this.isCu
75stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Ja(e))return!1;try{var r=e.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(e,r){var s,i=this.getUnhandledRejectionReason(e);return pu(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}:r.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var Ni="$message",Ai="$timestamp",vv=new Set([Ni,Ai]),bn={enabled:!0,max_bytes:32768};function Oi(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:bn.enabled,max_bytes:_v(t.max_bytes,bn.max_bytes)}:T({},bn)}class mv{constructor(e){this.bt=[],this._t=0,this.Se=Oi(e)}setConfig(e){this.Se=Oi(e),this.wt()}add(e){var r=function(i){var n,a,o;try{o=[],n=(a=JSON.stringify(i,function(f,p){if(typeof p=="bigint")return p.toString();if(typeof p!="function"&&typeof p!="symbol"){if(p instanceof Error)return{name:p.name,message:p.message,stack:p.stack};if(p&&typeof p=="object"){for(;o.length>0&&o[o.length-1]!==this;)o.pop();if(o.includes(p))return"[Circular]";o.push(p)}return p}}))!==null&&a!==void 0?a:"null"}catch{return}try{var l=JSON.parse(n);if(!ve(l))return;var u=l,d=u[Ni],h=u[Ai];return!ce(d)||d.trim().length===0||!ce(h)&&!Ie(h)?void 0:{step:u,json:n}}catch{return}}(e);if(r){var s=function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).length;for(var n=encodeURIComponent(i),a=0,o=0;n.length>o;o++)n[o]==="%"?(a+=1,o+=2):a+=1;return a}(r.json);s>this.Se.max_bytes||(this.bt.push({step:r.step,bytes:s}),this._t+=s,this.wt())}}getAttachable(){return this.bt.map(e=>e.step)}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}}function _v(t,e){if(!Ie(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var Bu=function(t,e){var{debugEnabled:r}=e===void 0?{}:e,s={k(i){if(b&&(ke.DEBUG||$.POSTHOG_DEBUG||r)&&!N(b.console)&&b.console){for(var n=("__rrweb_original__"in b.console[i])?b.console[i].__rrweb_original__:b.console[i],a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];n(t,...o)}},debug(){for(var i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];s.k("debug",...n)},info(){for(var i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];s.k("log",...n)},warn(){for(var i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];s.k("warn",...n)},error(){for(var i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];s.k("error",...n)},critical(){for(var i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];console.error(t,...n)},uninitializedWarning(i){s.error("You must initialize PostHog before calling "+i)},createLogger:(i,n)=>Bu(t+" "+i,n)};return s},R=Bu("[PostHog.js]"),we=R.createLogger,yv=we("[ExternalScriptsLoader]"),xn=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return yv.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var s=I==null?void 0:I.querySelectorAll("script");if(s){for(var i,n=function(){if(s[a].src===e){var l=s[a];return l.__posthog_loading_callback_fired?{v:r()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,r(void 0,u)}),l.onerror=u=>r(u),{v:void 0})}},a=0;s.length>a;a++)if(i=n())return i.v}var o=()=>{if(!I)return r("document not found");var l=I.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,r(void 0,h)},l.onerror=h=>r(h),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return r("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")I.head.appendChild(l);else{var u,d=I.querySelectorAll("body > script");d.length>0?(u=d[0].parentNode)==null||u.insertBefore(l,d[0]):I.body.appendChild(l)}};I!=null&&I.body?o():I==null||I.addEventListener("DOMContentLoaded",o)};$.__PosthogExtensions__=$.__PosthogExtensions__||{},$.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if(e!=="remote-config"){var s;if(t.config.strict_script_versioning)s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var i="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var n=3e5;i=i+"&t="+Math.floor(Date.now()/n)*n}
75s=t.requestRouter.endpointFor("assets",i)}xn(t,s,r)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");xn(t,a,r)}},$.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var s=t.requestRouter.endpointFor("api",e);xn(t,s,r)};var Uu="$people_distinct_id",Ii="$device_id",wn="$device_model",ws="__alias",Es="__timers",da="$autocapture_disabled_server_side",ha="$heatmaps_enabled_server_side",pa="$exception_capture_enabled_server_side",fa="$error_tracking_suppression_rules",ga="$error_tracking_capture_extension_exceptions",va="$web_vitals_enabled_server_side",ro="$dead_clicks_enabled_server_side",so="$product_tours_enabled_server_side",ma="$web_vitals_allowed_metrics",pr="$session_recording_remote_config",Vu="$replay_sample_rate",qu="$replay_override_sampling",Hu="$replay_override_linked_flag",Gu="$replay_override_url_trigger",Wu="$replay_override_event_trigger",Lr="$sesid",io="$session_is_sampled",hr="$enabled_feature_flags",gi="$active_feature_flags",Ss="$early_access_features",_a="$feature_flag_details",vi="$feature_flag_payloads",ya="$feature_flag_request_id",Tt="$override_feature_flags",Or="$override_feature_flag_payloads",lr="$stored_person_properties",cr="$stored_group_properties",ba="$surveys",Fi="$surveys_loaded_at",xa="$surveys_activated",ks="ph_product_tours",Ns="$flag_call_reported",wa="$flag_call_reported_session_id",Ea="$feature_flag_errors",Bs="$feature_flag_evaluated_at",lt="$user_state",Sa="$client_session_props",ka="$capture_rate_limit",Pa="$initial_campaign_params",ja="$initial_referrer_info",Li="$initial_person_info",Mi="$epp",Yu="__POSTHOG_TOOLBAR__",ni="$posthog_cookieless",Ku="$sdk_debug_extensions_init_method",Qu="$sdk_debug_extensions_init_time_ms",Ju="$sdk_debug_recording_script_not_loaded",Ca="PostHog loadExternalDependency extension not found.",ur="on_reject",Ot="always",Cr="anonymous",Tr="identified",Ta="identified_only",$i="visibilitychange",Di="beforeunload",Ir="$pageview",En="$pageleave",Sn="$identify",il="$groupidentify";function ai(t,e){Z(t)&&t.forEach(e)}function he(t,e){if(!Y(t))if(Z(t))t.forEach(e);else if(Ng(t))t.forEach((s,i)=>e(s,i));else for(var r in t)hu.call(t,r)&&e(t[r],r)}var fe=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;e>s;s++)r[s-1]=arguments[s];for(var i of r)for(var n in i)i[n]!==void 0&&(t[n]=i[n]);return t};function mi(t){for(var e=Object.keys(t),r=e.length,s=new Array(r);r--;)s[r]=[e[r],t[e[r]]];return s}var nl=function(t){try{return t()}catch{return}},bv=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),s=0;e>s;s++)r[s]=arguments[s];return t.apply(this,r)}catch(i){R.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),R.critical(i)}}},no=function(t){var e={};return he(t,function(r,s){(ce(r)&&r.length>0||Ie(r))&&(e[s]=r)}),e},xv=["herokuapp.com","vercel.app","netlify.app"];function wv(t){var e=t==null?void 0:t.hostname;if(!ce(e))return!1;var r=e.split(".").slice(-2).join(".");for(var s of xv)if(r===s)return!1;return!0}function xe(t,e,r,s){var{capture:i=!1,passive:n=!0}=s??{};t==null||t.addEventListener(e,r,{capture:i,passive:n})}function Xu(t){return t.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Ie(t)&&isFinite(t)&&Math.floor(t)===t});class zi{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,s,i){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(s)||!Number.isInteger(i)||0>e||0>r||0>s||0>i||e>0xffffffffffff||r>4095||s>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|r>>>8,n[7]=r,n[8]=128|s>>>24,n[9]=s>
75>>16,n[10]=s>>>8,n[11]=s,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new zi(n)}toString(){for(var e="",r=0;this.bytes.length>r;r++)e=e+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new zi(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var r=0;16>r;r++){var s=this.bytes[r]-e.bytes[r];if(s!==0)return Math.sign(s)}return 0}}class Ev{constructor(){this.S=0,this.C=0,this.I=new Sv}generate(){var e=this.generateOrAbort();if(N(e)){this.S=0;var r=this.generateOrAbort();if(N(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return zi.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var al,Zu=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};b&&!N(b.crypto)&&crypto.getRandomValues&&(Zu=t=>crypto.getRandomValues(t));class Sv{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Zu(this.R),this.O=0),this.R[this.O++]}}var Nt=()=>kv().toString(),kv=()=>(al||(al=new Ev)).generate(),ds="",Pv=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,mt={N:()=>!!I,D(t){R.error("cookieStore error: "+t)},A(t){if(I){try{for(var e=t+"=",r=I.cookie.split(";").filter(n=>n.length),s=0;r.length>s;s++){for(var i=r[s];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},F(t){var e;try{e=JSON.parse(mt.A(t))||{}}catch{}return e},q(t,e,r,s,i){if(!I)return!1;try{var n="",a="",o=function(d,h){if(h){var f=function(m,g){if(g===void 0&&(g=I),ds)return ds;if(!g||["localhost","127.0.0.1"].includes(m))return"";for(var v=m.split("."),y=Math.min(v.length,8),w="dmn_chk_"+Nt();!ds&&y--;){var x=v.slice(y).join("."),E=w+"=1;domain=."+x+";path=/";g.cookie=E+";max-age=3",g.cookie.includes(w)&&(g.cookie=E+";max-age=0",ds=x)}return ds}(d);if(!f){var p=(m=>{var g=m.match(Pv);return g?g[0]:""})(d);p!==f&&R.info("Warning: cookie subdomain discovery mismatch",p,f),f=p}return f?"; domain=."+f:""}return""}(I.location.hostname,s);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),n="; expires="+l.toUTCString()}i&&(a="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&R.warn("cookieStore warning: large cookie, len="+u.length),I.cookie=u,!0}catch{return!1}},P(t,e){if(I!=null&&I.cookie)try{mt.q(t,"",-1,e)}catch{return}}},kn=null,de={N(){if(!Ve(kn))return kn;var t=!0;if(N(b))t=!1;else try{var e="__mplssupport__";de.q(e,"xyz"),de.A(e)!=='"xyz"'&&(t=!1),de.P(e)}catch{t=!1}return t||R.error("localStorage unsupported; falling back to cookie store"),kn=t,t},D(t){R.error("localStorage error: "+t)},A(t){try{return b==null?void 0:b.localStorage.getItem(t)}catch(e){de.D(e)}return null},F(t){try{return JSON.parse(de.A(t))||{}}catch{}return null},q(t,e){try{return b==null||b.localStorage.setItem(t,JSON.stringify(e)),!0}catch(r){de.D(r)}return!1},P(t){try{b==null||b.localStorage.removeItem(t)}catch(e){de.D(e)}}},jv=[Ii,"distinct_id",Lr,io,Mi,Li,lt],oi={},Cv={N:()=>!0,D(t){R.error("memoryStorage error: "+t)},A:t=>oi[t]||null,F:t=>oi[t]||null,q:(t,e)=>(oi[t]=e,!0),P(t){delete oi[t]}},sr=null,Ae={N(){if(!Ve(sr))return sr;if(sr=!0,N(b))sr=!1;else try{var t="__support__";Ae.q(t,"xyz"),Ae.A(t)!=='"xyz"'&&(sr=!1),Ae.P(t)}catch{sr=!1}return sr},D(t){R.error("sessionStorage error: ",t)},A(t){try{return b==null?void 0:b.sessionStorage.getItem(t)}catch(e){Ae.D(e)}return null},F(t){try{return JSON.parse(Ae.A(t))||null}catch{}return null},q(t,e){try{return b==null||b.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(r){Ae.D(r)}return!1},P(t){try{b==null||b.sessionStorage.removeItem(t)}catch(e){Ae.D(e)}}};class Tv{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}
75isOptedOut(){return this.Se.cookieless_mode===Ot||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===ur}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:r,consent_persistence_name:s}=this._instance.config;return s||(r?r+e:"__ph_opt_in_out_"+e)}get St(){var e=this.Ct.A(this.It);return vn(e)?1:B(Fg,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,r=e==="localStorage"?de:mt;if(!this.Tt||this.Tt!==r){this.Tt=r;var s=e==="localStorage"?mt:de;s.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(vn(s.A(this.It))),s.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[Ue==null?void 0:Ue.doNotTrack,Ue==null?void 0:Ue.msDoNotTrack,$.doNotTrack].some(e=>vn(e))}}function ed(t,e){var r,s=t==null||(r=t.config)==null?void 0:r.get_current_url;if(!ht(s))return e;try{var i=s(e);return ce(i)&&i?i:e}catch(n){return R.error("Error in get_current_url, falling back to window.location.href",n),e}}var Rv=1,Nv=3,Av=11;function ol(t){return t instanceof Element&&(t.id===Yu||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Zt(t){return!!t&&t.nodeType===Rv}function We(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function td(t){return!!t&&t.nodeType===Nv}function rd(t){return!!t&&t.nodeType===Av&&Zt(t.host)}function ao(t){return t?Zi(t).split(/\s+/):[]}function ll(t,e){var r=function(s){var i,n=b==null||(i=b.location)==null?void 0:i.href;return N(n)?void 0:ed(s,n)}(e);return!!(r&&t&&t.some(s=>r.match(s)))}function Bi(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ao(e)}function sd(t){return Y(t)?null:Zi(t).split(/(\s+)/).filter(e=>As(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Us(t){var e="";return Na(t)&&!od(t)&&t.childNodes&&t.childNodes.length&&he(t.childNodes,function(r){var s;td(r)&&r.textContent&&(e+=(s=sd(r.textContent))!==null&&s!==void 0?s:"")}),Zi(e)}function Pn(t){return N(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var oo=["a","button","form","input","select","textarea","label"];function Ra(t,e){if(N(e))return!0;var r,s=function(n){if(e.some(a=>function(o,l){var u=o.matches||o.matchesSelector||o.msMatchesSelector||o.mozMatchesSelector||o.webkitMatchesSelector||o.oMatchesSelector;try{return!!u&&u.call(o,l)}catch{return!1}}(n,a)))return{v:!0}};for(var i of t)if(r=s(i))return r.v;return!1}function id(t){var e=t.parentNode;return!(!e||!Zt(e))&&e}var Ov=[".ph-no-autocapture","[data-ph-no-autocapture]"],nd=["next","previous","prev",">","<"],Iv=[...nd,"+","-","â","â"],cl=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ul=[".ph-no-rageclick",".ph-no-capture"],Fv=["","text","search","email","password","url","tel","number"];function dl(t,e){if(!b||lo(t))return!1;var r,s,i,n,a;if(yt(e)?(r=!!e&&ul,s=void 0,i=!1):(r=(n=e==null?void 0:e.css_selector_ignorelist)!==null&&n!==void 0?n:ul,s=e==null?void 0:e.content_ignorelist,i=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),r===!1||i&&function(l){return!(!l||!Zt(l))&&(!!We(l,"textarea")||(We(l,"input")?B(Fv,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var d=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return d==="true"||d===""}(l)))}(t))return!1;var{targetElementList:o}=ad(t,!1);return!function(l,u){if(l===!1||N(l))return!1;var d;if(l===!0)d=nd;else{if(!Z(l))return!1;if(l.length>10)return R.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;d=l.map(h=>h.toLowerCase())}return u.some(h=>{var{safeText:f,ariaLabel:p}=h;return d.some(m=>cl(f,m)||cl(p,m))})}(s,o.map(l=>{var u;return{safeText:Us(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!Ra(o,r)}var lo=t=>!t||We(t,"html")||!Zt(t),ad=(t,e)=>{if(!b||lo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[t],i=t;i.parentNode&&!We(i,"body");)if(rd(i.parentNode))s.push(i.parentNode.host),i=i.parentNode.host;else{var n=id(i);if(!n)break;if(e||oo.indexOf(n.tagName.toLowerCase())>-1)r=!0;else try{var a=b.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(n),i=n}return{parentIsUsefulElement:r,targetElementList:s}};function Na(t){for(var e=t;e.parentNode&&!We(e,"body");e=e.parentNode){var r=Bi(e);if(B(r,"ph-sensitive")||B(r,"ph-no-capture"))return!1}if(B(Bi(t),"ph-include"))return!0;var s=t.type||"";if(ce(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!ce(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function od(t){return!!(We(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||We(t,"select")||We(t,"textarea")||t.getAttribute("contenteditable")==="true")}var ld="(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}
75)|((?:2131|1800|35[0-9]{3})[0-9]{11})",Lv=new RegExp("^(?:"+ld+")$"),Mv=new RegExp(ld),cd="\\d{3}-?\\d{2}-?\\d{4}",$v=new RegExp("^("+cd+")$"),Dv=new RegExp("("+cd+")");function As(t,e){return e===void 0&&(e=!0),!(Y(t)||ce(t)&&(t=Zi(t),(e?Lv:Mv).test((t||"").replace(/[- ]/g,""))||(e?$v:Dv).test(t)))}function hl(t){var e=Us(t);return As(e=(e+" "+ud(t)).trim())?e:""}function ud(t){var e="";return t&&t.childNodes&&t.childNodes.length&&he(t.childNodes,function(r){var s;if(r&&((s=r.tagName)==null?void 0:s.toLowerCase())==="span")try{var i=Us(r);e=(e+" "+i).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+ud(r)).trim())}catch(n){R.error("[AutoCapture]",n)}}),e}function pl(t){return t.replace(/"|\\"/g,'\\"')}function zv(t){var e=t.attr__class;return e?Z(e)?e:ao(e):void 0}var li=we("[Dead Clicks]"),Bv=()=>!0,Uv=t=>{var e,r=!((e=t.instance.persistence)==null||!e.get_property(ro)),s=t.instance.config.capture_dead_clicks;return yt(s)?s:!!ve(s)||r};class fl{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,r,s){this.instance=e,this.isEnabled=r,this.onCapture=s,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[ro]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt(()=>{this.Pt()}):this.stop()}Mt(e){var r,s;(r=$.__PosthogExtensions__)!=null&&r.initDeadClicksAutocapture?e():(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"dead-clicks-autocapture",i=>{i?li.error("failed to load script",i):e()})}Pt(){var e;if(I){if(!this.Et&&(e=$.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var r=ve(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};r.__onCapture=this.onCapture,this.Et=$.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,r),this.Et.start(I),li.info("starting...")}}else li.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,li.info("stopping..."))}}var jn=we("[SegmentIntegration]"),dd="posthog-js";function hd(t,e){var{organization:r,projectId:s,prefix:i,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,u,d,h,f;if(n!=="*"&&!n.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});var p=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());o.tags["PostHog Person URL"]=p,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var m,g=((l=o.exception)==null?void 0:l.values)||[],v=g.map(w=>T({},w,{stacktrace:w.stacktrace?T({},w.stacktrace,{type:"raw",frames:(w.stacktrace.frames||[]).map(x=>T({},x,{platform:"web:javascript"}))}):void 0})),y={$exception_message:((u=g[0])==null?void 0:u.value)||o.message,$exception_type:(d=g[0])==null?void 0:d.type,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((h=g[0])==null?void 0:h.value)||o.message,$sentry_exception_type:(f=g[0])==null?void 0:f.type,$sentry_tags:o.tags};return r&&s&&(y.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+o.event_id),a&&((m=t.exceptions)==null||m.sendExceptionEvent(y)),o}}class Vv{constructor(e,r,s,i,n,a){this.name=dd,this.setupOnce=function(o){o(hd(e,{organization:r,projectId:s,prefix:i,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}class gl{constructor(e){this.Rt=(r,s,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(R.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:r,changeReason:i}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){var e;this.Ft=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Rt)}destroy(){var e;(e=this.Ft)==null||e.call(this),this.Ft=void 0}doPageView(e,r){var s,i=this.At(e,r);return this.Ot={pathname:(s=b==null?void 0:b.location.pathname)!==null&&s!==void 0?s:"",pageViewId:r,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var r;return this.At(e,(r=this.Ot)==null?void 0:r.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Ot)==null?void 0:e.pageViewId}}At(e,r){var s=this.Ot;if(!s)return{$pageview_id:r};var i={$pageview_id:r,$prev_pageview_id:s.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:u,last
75ContentY:d,maxContentY:h}=n;if(!(N(a)||N(o)||N(l)||N(u)||N(d)||N(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),h=Math.ceil(h);var f=a>1?_t(o/a,0,1,R):1,p=a>1?_t(l/a,0,1,R):1,m=u>1?_t(d/u,0,1,R):1,g=u>1?_t(h/u,0,1,R):1;i=fe(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:m,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:g})}}return s.pathname&&(i.$prev_pageview_pathname=s.pathname),s.timestamp&&(i.$prev_pageview_duration=(e.getTime()-s.timestamp.getTime())/1e3),i}}var ci=["flags","surveys"],qv={[Uu]:{exposure:"hidden"},[ws]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Es]:{exposure:"hidden"},[da]:{exposure:"event"},[ha]:{exposure:"hidden"},[pa]:{exposure:"event"},[fa]:{exposure:"hidden"},[ga]:{exposure:"event"},[va]:{exposure:"event"},[ro]:{exposure:"event"},[so]:{exposure:"hidden"},[ma]:{exposure:"event"},[pr]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Lr]:{exposure:"hidden"},[io]:{exposure:"event"},[Vu]:{exposure:"event",shouldSkipFromEventProperties:t=>Ve(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[hr]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!ve(t))return{};for(var e={},r=Object.keys(t),s=0;r.length>s;s++)e["$feature/"+r[s]]=t[r[s]];return e}},[gi]:{exposure:"event",storageGroup:"flags"},[Ss]:{exposure:"hidden"},[_a]:{exposure:"hidden",storageGroup:"flags"},[vi]:{exposure:"event",storageGroup:"flags"},[ya]:{exposure:"event",storageGroup:"flags",volatile:!0},[Tt]:{exposure:"event"},[Or]:{exposure:"hidden"},[lr]:{exposure:"hidden"},[cr]:{exposure:"hidden"},[ba]:{exposure:"hidden",storageGroup:"surveys"},[Fi]:{exposure:"hidden",storageGroup:"surveys",volatile:!0}
75,[xa]:{exposure:"event"},[ks]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Ns]:{exposure:"hidden"},[wa]:{exposure:"hidden"},[Ea]:{exposure:"hidden"},[Bs]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[lt]:{exposure:"hidden"},[Sa]:{exposure:"hidden"},[ka]:{exposure:"hidden"},[Pa]:{exposure:"hidden"},[ja]:{exposure:"hidden"},[Li]:{exposure:"hidden"},[Mi]:{exposure:"hidden"},[qu]:{exposure:"event"},[Hu]:{exposure:"event"},[Gu]:{exposure:"event"},[Wu]:{exposure:"event"},[Ku]:{exposure:"event"},[Qu]:{exposure:"event"},[Ju]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Hv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ir=t=>{var e=qv[t];if(e)return e;for(var[r,s]of Hv)if(t.indexOf(r)===0)return s},Vs=t=>{var e=I==null?void 0:I.createElement("a");return N(e)?null:(e.href=t,e)},Zr=function(t,e){for(var r,s=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;s.length>i;i++){var n=s[i].split("=");if(n[0]===e){r=n;break}}if(!Z(r)||2>r.length)return"";var a=r[1];try{a=decodeURIComponent(a)}catch{R.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},qs=function(t,e,r){if(!t||!e||!e.length)return t;for(var s=t.split("#"),i=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],d=0;l.length>d;d++){var h=l[d].split("=");Z(h)&&(e.includes(h[0])?u.push(h[0]+"="+r):u.push(l[d]))}var f=o;return a!=null&&(f+="?"+u.join("&")),i!=null&&(f+="#"+i),f},Ui=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},pd=(t,e)=>t>=e&&lu(),fd=(t,e,r,s)=>{if(t===0){if(lu()){var i=e+1;return i===r&&s(),i}return e}return 0},ui="https?://(.*)",es=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Gv=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...es],Hs="<masked>",Wv=["li_fat_id"];function gd(t,e,r){if(!I)return{};var s,i=e?[...es,...r||[]]:[],n=vd(qs(I.URL,i,Hs),t),a=(s={},he(Wv,function(o){var l=mt.A(o);s[o]=l||null}),s);return fe(a,n)}function vd(t,e){var r=Gv.concat(e||[]),s={};return he(r,function(i){var n=Zr(t,i);s[i]=n||null}),s}function md(t){var e=function(n){return n?n.search(ui+"google.([^/?]*)")===0?"google":n.search(ui+"bing.com")===0?"bing":n.search(ui+"yahoo.com")===0?"yahoo":n.search(ui+"duckduckgo.com")===0?"duckduckgo":null:null}(t),r=e!="yahoo"?"q":"p",s={};if(!Ve(e)){s.$search_engine=e;var i=I?Zr(I.referrer,r):"";i.length&&(s.ph_keyword=i)}return s}function vl(){return navigator.language||navigator.userLanguage}var Vi="$direct";function _d(){return(I==null?void 0:I.referrer)||Vi}function yd(t,e,r){r===void 0&&(r=!1);var s=t?[...es,...e||[]]:[],i=r?Xt(Pe==null?void 0:Pe.href):Pe==null?void 0:Pe.href,n=i==null?void 0:i.substring(0,1e3);return{r:_d().substring(0,1e3),u:n?qs(n,s,Hs):void 0}}function bd(t,e){var r;e===void 0&&(e=!1);var{r:s,u:i}=t,n=e?Xt(i):i,a={$referrer:s,$referring_domain:s==null?void 0:s==Vi?Vi:(r=Vs(s))==null?void 0:r.host};if(n){a.$current_url=n;var o=Vs(n);a.$host=o==null?void 0:o.host,a.$pathname=o==null?void 0:o.pathname;var l=vd(n);fe(a,l)}if(s){var u=md(s);fe(a,u)}return a}function xd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Yv(){try{return new Date().getTimezoneOffset()}catch{return}}var Kv={flags:Bs,surveys:Fi},Qv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Rr="main";class Cn{constructor(e,r,s){if(s===void 0&&(s=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=s,this.props={},this.Bt=!1,this.jt=(n=>{var a="";return n.token&&(a=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+a+"_posthog"})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&R.info("Persistence loaded",e.persistence,T({},this.props)),this.update_config(e,e,r),this.save(),b){var i=()=>this.flush();xe(b,"beforeunload",i,{capture:!1}),xe(b,"pagehide",i,{capture:!1})}}zt(){var e,r=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Ie(r)&&r>0?r:0}isDisabled(){return!!this.Vt}Ht(e){Qv.indexOf(e.persistence.toLowerCase())===-1&&(R.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var r,s=function(a,o){a===void 0&&(a=[]),o===void 0&&(o=!1);var l=[...jv,...a];return T({},de,{F(u){try{var d={};try{d=mt.F(u)||{}}catch{}var h,f=JSON.parse(de.A(u)||"{}");if(o){var p={};for(var m in d){var g=d[m];Ve(g)||g===""||(p[m]=g)}h=fe(f,p)}else h=fe(d,f);return de.q(u,h),h}catch{}return null},q(u,d,h,f,p,m){var g=de.q(u,d,void 0,void 0,m);try{var v={};l.forEach(y=>{d[y]&&(v[y]=d[y])}),Object.keys(v).length&&mt.q(u,v,h,f,p,m)}catch(y){de.D(y)}return g},P(u,d){try{b==null||b.localStorage.removeItem(u),mt.P(u,d)}catch(h){de.D(h)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),i=!1,n=e.persistence.toLowerCase();return n==="localstorage"&&de.N()?(r=de,i=!0):n==="localstorage+cookie"&&s.N()?(r=s,i=!0):n==="sessionstorage"&&Ae.N()?r=Ae:n==="memory"?r=Cv:n==="cookie"?r=mt:s.N()?(r=s,i=!0):r=mt,this.Dt=i,r}Wt(e){return this.jt+"__"+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var r=e??this.Se.feature_flag_cache_ttl_ms;if(!r||0>=r)return!1;var s=this.props[Bs];return!s||typeof s!="number"||Date.now()-s>r}properties(){var e={};return he(this.props,(r,s)=>{var i=ir(s);if((i==null?void 0:i.exposure)==="derived"){if(i.shouldSkipFromEventProperties!=null&&i.shouldSkipFromEventProperties(r,s===hr?()=>this.Gt():()=>!1))return;i.transformToEventProperties&&fe(e,i.transformToEventProperties(r))}else if(!i||i.exposure==="event"){if(i!=null&&i.shouldSkipFromEventProperties!=null&&i.shouldSkipFromEventProperties(r,()=>!1))return;e[s]=r}}),e}load(){if(!this.Vt){var e=this.Ct.F(this.jt);e&&(this.props=fe({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of ci){var r=de.F(this.Wt(e));if(r&&!Qt(r)){var s=this.Qt(e);s.persisted=!0,this.Jt(e)||(s.fingerprint=this.Yt(r,e)),this.Kt(e,r)||fe(this.props,r)}}}Jt(e){return Object.keys(this.props).some(r=>{var s;return((s=ir(r))==null?void 0:s.storageGroup)===e})}Kt(e,r){var s=Kv[e];
75if(!s)return!1;var i=r[s],n=this.props[s];return Ie(i)&&Ie(n)&&n>i}refreshKey(e){var r;if(!this.Vt){var s=this.Nt?(r=ir(e))==null?void 0:r.storageGroup:void 0,i=s?de.F(this.Wt(s)):this.Ct.F(this.jt);if(i&&e in i)this.Xt(e,i[e]);else{if(s){var n=this.Ct.F(this.jt);if(n&&e in n)return void this.Xt(e,n[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?N(this.tr)&&(this.tr=setTimeout(()=>{this.tr=void 0,this.rr()},e)):this.rr()}}flush(){N(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,Rr))}ir(){var{main:e,groups:r}=this.sr();for(var s of(this.nr(this.Ct,this.jt,e,Rr),ci)){var i,n=r[s];(!Qt(n)||(i=this.$t[s])!=null&&i.persisted)&&this.nr(de,this.Wt(s),n,s)}}sr(){var e={},r={};for(var s of ci)r[s]={};return he(this.props,(i,n)=>{var a,o=(a=ir(n))==null?void 0:a.storageGroup;o?r[o][n]=i:e[n]=i}),{main:e,groups:r}}Yt(e,r){if(r===Rr)return JSON.stringify(e)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var s={};return he(e,(i,n)=>{var a;s[n]=(a=ir(n))!=null&&a.volatile?"__volatile__":i}),JSON.stringify(s)}nr(e,r,s,i){var n=this.Qt(i);if(i===Rr||n.dirty||N(n.fingerprint)){var a;try{if((a=this.Yt(s,i))===n.fingerprint)return void(n.dirty=!1)}catch{a=void 0}e.q(r,s,this.ar,this.lr,this.ur,this.Se.debug)?(n.dirty=!1,i!==Rr&&(n.persisted=!0),N(a)||(n.fingerprint=a)):this.Se.debug&&R.warn('failed to persist storage entry "'+r+'"; will retry on next save')}}remove(e){var{keepGroupEntries:r=!1}=e===void 0?{}:e;if(N(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.jt,!1),this.Ct.P(this.jt,!0),!r&&this.qt)for(var s of ci)de.P(this.Wt(s));r?delete this.$t[Rr]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,r,s){if(ve(e)){N(r)&&(r="None"),this.ar=N(s)?this.hr:s;var i=!1;if(he(e,(n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==r||(this.Xt(a,n),i=!0)}),i)return this.save(),!0}return!1}register(e,r){if(ve(e)){this.ar=N(r)?this.hr:r;var s=!1;if(he(e,(i,n)=>{e.hasOwnProperty(n)&&this.props[n]!==i&&(this.Xt(n,i),s=!0)}),s)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.Bt){var e=gd(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);Qt(no(e))||this.register(e),this.Bt=!0}}update_search_keyword(){var e;this.register((e=I==null?void 0:I.referrer)?md(e):{})}update_referrer_info(){var e;this.register_once({$referrer:_d(),$referring_domain:I!=null&&I.referrer&&((e=Vs(I.referrer))==null?void 0:e.host)||Vi},void 0)}set_initial_person_info(){this.props[Pa]||this.props[ja]||this.register_once({[Li]:yd(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};he([ja,Pa],i=>{var n=this.props[i];n&&he(n,function(a,o){e["$initial_"+ia(o)]=a})});var r=this.props[Li];if(r){var s=function(i,n){n===void 0&&(n=!1);var a=bd(i,n),o={};return he(a,function(l,u){o["$initial_"+ia(u)]=l}),o}(r,this.Se.disable_capture_url_hashes);fe(e,s)}return e}safe_merge(e){return he(this.props,function(r,s){s in e||(e[s]=r)}),e}update_config(e,r,s){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!s),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==r.persistence||!((l,u)=>{if(l.length!==u.length)return!1;var d=[...l].sort(),h=[...u].sort();return d.every((f,p)=>f===h[p])})(e.cookie_persisted_properties||[],r.cookie_persisted_properties||[]),n=i?this.Ht(e):this.Ct,a=this.Ut(e);if(i||a!==this.Nt){var o=this.props;this.clear(),this.Ct=n,this.Nt=a,this.props=o,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,r){var s=this.props[Es]||{};s[e]=r,this.Xt(Es,s),this.save()}remove_event_timer(e){var r=this.props[Es]||{},s=r[e];return N(s)||(delete r[e],this.Xt(Es,r),this.save()),s}get_property(e){return this.props[e]}set_property(e,r){this.Xt(e,r),this.save()}Xt(e,r){var s;this.props[e]=r,(s=ir(e))!=null&&s.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var r,s=(r=ir(e))==null?void 0:r.storageGroup;s&&(this.Qt(s).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}}var hs={Activation:"events",Cancellation:"cancelEvents"},Tn={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Jv={Once:"once",Recurring:"recurring",Always:"always"},It={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Rn={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_
75START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Aa={Popover:"popover",Inline:"inline"},Xv={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},ml={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},_l=we("[RateLimiter]");class Zv{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var s=r.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(i=>{_l.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void _l.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:s})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var r,s,i;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:a}=this,o=new Date().getTime(),l=(r=(s=this.instance.persistence)==null?void 0:s.get_property(ka))!==null&&r!==void 0?r:{tokens:n,last:o};l.tokens+=(o-l.last)/1e3*a,l.last=o,l.tokens>n&&(l.tokens=n);var u=1>l.tokens;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(i=this.instance.persistence)==null||i.set_property(ka,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var r=this.serverLimits[e||"events"]||!1;return r!==!1&&new Date().getTime()<r}}var ps=we("[RemoteConfig]");class wd{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=$._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}cr(e){var r,s;(r=$.__PosthogExtensions__)!=null&&r.loadExternalDependency?(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}vr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(r){e(r.json)}})}load(){try{if(this.remoteConfig)return ps.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void ps.warn("Remote config is disabled. Falling back to local config.");this.cr(e=>{if(!e)return ps.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr(r=>{this.pr(r),this.gr()});this.pr(e),this.gr()})}catch(e){ps.error("Error loading remote config",e)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}refresh(){!this._instance.mr()&&I&&I.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}gr(){var e;if(!this.yr){var r=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;r!==0&&(this.yr=setInterval(()=>{this.refresh()},r))}}pr(e){var r;e||ps.error("Failed to fetch remote config from PostHog."),this._instance.pr(e??{}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded())}}var Ze={GZipJS:"gzip-js",Base64:"base64"},tt=Uint8Array,Ge=Uint16Array,ts=Uint32Array,co=new tt([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]),uo=new tt([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]),yl=new tt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ed=function(t,e){for(var r=new Ge(31),s=0;31>s;++s)r[s]=e+=1<<t[s-1];var i=new ts(r[30]);for(s=1;30>s;++s)for(var n=r[s];r[s+1]>n;++n)i[n]=n-r[s]<<5|s;return[r,i]},Sd=Ed(co,2),Oa=Sd[1];Sd[0][28]=258,Oa[258]=28;for(var bl=Ed(uo,0)[1],kd=new Ge(32768),me=0;32768>me;++me){var Nr=(43690&me)>>>1|(21845&me)<<1;kd[me]=((65280&(Nr=(61680&(Nr=(52428&Nr)>>>2|(13107&Nr)<<2))>>>4|(3855&Nr)<<4))>>>8|(255&Nr)<<8)>>>1}var Os=function(t,e,r){for(var s=t.length,i=0,n=new Ge(e);s>i;++i)++n[t[i]-1];var a,o=new Ge(e);for(i=0;e>i;++i)o[i]=o[i-1]+n[i-1]<<1;for(a=new Ge(s),i=0;s>i;++i)a[i]=kd[o[t[i]-1]++]>>>15-t[i];return a},wr=new tt(288);for(me=0;144>me;++me)wr[me]=8;for(me=144;256>me;++me)wr[me]=9;for(me=256;280>me;
vendor: 5,070 bytes, line 75
75++me)wr[me]=7;for(me=280;288>me;++me)wr[me]=8;var qi=new tt(32);for(me=0;32>me;++me)qi[me]=5;var em=Os(wr,9),tm=Os(qi,5),Pd=function(t){return(t/8>>0)+(7&t&&1)},jd=function(t,e,r){(r==null||r>t.length)&&(r=t.length);var s=new(t instanceof Ge?Ge:t instanceof ts?ts:tt)(r-e);return s.set(t.subarray(e,r)),s},St=function(t,e,r){var s=e/8>>0;t[s]|=r<<=7&e,t[s+1]|=r>>>8},fs=function(t,e,r){var s=e/8>>0;t[s]|=r<<=7&e,t[s+1]|=r>>>8,t[s+2]|=r>>>16},Nn=function(t,e){for(var r=[],s=0;t.length>s;++s)t[s]&&r.push({s,f:t[s]});var i=r.length,n=r.slice();if(!i)return[new tt(0),0];if(i==1){var a=new tt(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(j,L){return j.f-L.f}),r.push({s:-1,f:25001});var o=r[0],l=r[1],u=0,d=1,h=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};d!=i-1;)o=r[r[h].f>r[u].f?u++:h++],l=r[u!=d&&r[h].f>r[u].f?u++:h++],r[d++]={s:-1,f:o.f+l.f,l:o,r:l};var f=n[0].s;for(s=1;i>s;++s)n[s].s>f&&(f=n[s].s);var p=new Ge(f+1),m=Ia(r[d-1],p,0);if(m>e){s=0;var g=0,v=m-e,y=1<<v;for(n.sort(function(j,L){return p[L.s]-p[j.s]||j.f-L.f});i>s;++s){var w=n[s].s;if(e>=p[w])break;g+=y-(1<<m-p[w]),p[w]=e}for(g>>>=v;g>0;){var x=n[s].s;e>p[x]?g-=1<<e-p[x]++-1:++s}for(;s>=0&&g;--s){var E=n[s].s;p[E]==e&&(--p[E],++g)}m=e}return[new tt(p),m]},Ia=function(t,e,r){return t.s==-1?Math.max(Ia(t.l,e,r+1),Ia(t.r,e,r+1)):e[t.s]=r},xl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ge(++e),s=0,i=t[0],n=1,a=function(l){r[s++]=l},o=1;e>=o;++o)if(t[o]==i&&o!=e)++n;else{if(!i&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(i),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(i);n=1,i=t[o]}return[r.subarray(0,s),e]},gs=function(t,e){for(var r=0,s=0;e.length>s;++s)r+=t[s]*e[s];return r},Fa=function(t,e,r){var s=r.length,i=Pd(e+2);t[i]=255&s,t[i+1]=s>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var n=0;s>n;++n)t[i+n+4]=r[n];return 8*(i+4+s)},wl=function(t,e,r,s,i,n,a,o,l,u,d){St(e,d++,r),++i[256];for(var h=Nn(i,15),f=h[0],p=h[1],m=Nn(n,15),g=m[0],v=m[1],y=xl(f),w=y[0],x=y[1],E=xl(g),j=E[0],L=E[1],P=new Ge(19),C=0;w.length>C;++C)P[31&w[C]]++;for(C=0;j.length>C;++C)P[31&j[C]]++;for(var k=Nn(P,7),A=k[0],M=k[1],O=19;O>4&&!A[yl[O-1]];--O);var H,V,re,X,K=u+5<<3,_e=gs(i,wr)+gs(n,qi)+a,z=gs(i,f)+gs(n,g)+a+14+3*O+gs(P,A)+(2*P[16]+3*P[17]+7*P[18]);if(_e>=K&&z>=K)return Fa(e,d,t.subarray(l,l+u));if(St(e,d,1+(_e>z)),d+=2,_e>z){H=Os(f,p),V=f,re=Os(g,v),X=g;var ae=Os(A,M);for(St(e,d,x-257),St(e,d+5,L-1),St(e,d+10,O-4),d+=14,C=0;O>C;++C)St(e,d+3*C,A[yl[C]]);d+=3*O;for(var te=[w,j],Q=0;2>Q;++Q){var q=te[Q];for(C=0;q.length>C;++C)St(e,d,ae[ee=31&q[C]]),d+=A[ee],ee>15&&(St(e,d,q[C]>>>5&127),d+=q[C]>>>12)}}else H=em,V=wr,re=tm,X=qi;for(C=0;o>C;++C)if(s[C]>255){var ee;fs(e,d,H[257+(ee=s[C]>>>18&31)]),d+=V[ee+257],ee>7&&(St(e,d,s[C]>>>23&31),d+=co[ee]);var ne=31&s[C];fs(e,d,re[ne]),d+=X[ne],ne>3&&(fs(e,d,s[C]>>>5&8191),d+=uo[ne])}else fs(e,d,H[s[C]]),d+=V[s[C]];return fs(e,d,H[256]),d+V[256]},rm=new ts([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sm=function(){for(var t=new ts(256),e=0;256>e;++e){for(var r=e,s=9;--s;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),An=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function im(t,e){e===void 0&&(e={});var r=function(){var h=4294967295;return{p(f){for(var p=h,m=0;f.length>m;++m)p=sm[255&p^f[m]]^p>>>8;h=p},d(){return 4294967295^h}}}(),s=t.length;r.p(t);var i,n,a,o,l,u=(o=10+((i=e).filename&&i.filename.length+1||0),l=8,function(h,f,p,m,g,v){var y=h.length,w=new tt(m+y+5*(1+Math.floor(y/7e3))+g),x=w.subarray(m,w.length-g),E=0;if(!f||8>y)for(var j=0;y>=j;j+=65535){var L=j+65535;y>L?E=Fa(x,E,h.subarray(j,L)):(x[j]=!0,E=Fa(x,E,h.subarray(j,y)))}else{for(var P=rm[f-1],C=P>>>13,k=8191&P,A=(1<<p)-1,M=new Ge(32768),O=new Ge(A+1),H=Math.ceil(p/3),V=2*H,re=function(st){return(h[st]^h[st+1]<<H^h[st+2]<<V)&A},X=new ts(25e3),K=new Ge(288),_e=new Ge(32),z=0,ae=0,te=(j=0,0),Q=0,q=0;y>j;++j){var ee=re(j),ne=32767&j,De=O[ee];if(M[ne]=De,O[ee]=ne,j>=Q){var ie=y-j;if((z>7e3||te>24576)&&ie>423){E=wl(h,x,0,X,K,_e,ae,te,q,j-q,E),te=z=ae=0,q=j;for(var Re=0;286>Re;++Re)K[Re]=0;for(Re=0;30>Re;++Re)_e[Re]=0}var Fe=2,wt=0,tr=k,Ke=ne-De&32767;if(ie>2&&ee==re(j-Ke))for(var Js=Math.min(C,ie)-1,nn=Math.min(32767,j),an=Math.min(258,ie);nn>=Ke&&--tr&&ne!=De;){if(h[j+Fe]==h[j+Fe-Ke]){for(var rt=0;an>rt&&h[j+rt]==h[j+rt-Ke];++rt);if(rt>Fe){if(Fe=rt,wt=Ke,rt>Js)break;var on=Math.min(Ke,rt-2),Sr=0;for(Re=0;on>Re;++Re){var ns=j-Ke+Re+32768&32767,as=ns-M[ns]+32768&32767;as>Sr&&(Sr=as,De=ns)}}}Ke+=(ne=De)-(De=M[ne])+32768&32767}if(wt){X[te++]=268435456|Oa[Fe]<<18|bl[wt];var Mt=31&Oa[Fe],os=31&bl[wt];ae+=co[Mt]+uo[os],++K[257+Mt],++_e[os],Q=j+Fe,++z}else X[te++]=h[j],++K[h[j]]}}E=wl(h,x,!0,X,K,_e,ae,te,q,j-q,E)}return jd(w,0,m+Pd(E)+g)}(n=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+a.mem,o,l)),d=u.length;return function(h,f){var p=f.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>f.level?4:f.level==9?2:0,h[9]=3,f.mtime!=0&&An(h,4,Math.floor(new Date(f.mtime||Date.now())/1e3)),p){h[3]=8;for(var m=0;p.length>=m;
75++m)h[m+10]=p.charCodeAt(m)}}(u,e),An(u,d-8,r.d()),An(u,d-4,s),u}var nm=!!ta||!!ea,Cd="text/plain",_i=!1,La=(t,e)=>{var[r,s]=t.split("#"),[i,n]=r.split("?");if(!n)return t;var a=n.split("&").filter(o=>o.split("=")[0]!==e).join("&");return i+(a?"?"+a:"")+(s?"#"+s:"")},Td=function(t,e,r){var s;r===void 0&&(r=!0);var[i,n]=t.split("?"),a=T({},e),o=(s=n==null?void 0:n.split("&").map(u=>{var d,[h,f]=u.split("="),p=r&&(d=a[h])!==null&&d!==void 0?d:f;return delete a[h],h+"="+p}))!==null&&s!==void 0?s:[],l=function(u,d){var h,f;d===void 0&&(d="&");var p=[];return he(u,function(m,g){N(m)||N(g)||g==="undefined"||(h=encodeURIComponent((v=>v instanceof File)(m)?m.name:m.toString()),f=encodeURIComponent(g),p[p.length]=f+"="+h)}),p.join(d)}(a);return l&&o.push(l),i+"?"+o.join("&")},Mr=(t,e)=>JSON.stringify(t,(r,s)=>typeof s=="bigint"?s.toString():s,e),El=t=>{if(t.xt)return t.xt;var{data:e,compression:r}=t;if(e){if(r===Ze.GZipJS){var s=im(function(o,l){var u=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var d=new tt(o.length+(o.length>>>1)),h=0,f=function(v){d[h++]=v},p=0;u>p;++p){if(h+5>d.length){var m=new tt(h+8+(u-p<<1));m.set(d),d=m}var g=o.charCodeAt(p);128>g?f(g):2048>g?(f(192|g>>>6),f(128|63&g)):g>55295&&57344>g?(f(240|(g=65536+(1047552&g)|1023&o.charCodeAt(++p))>>>18),f(128|g>>>12&63),f(128|g>>>6&63),f(128|63&g)):(f(224|g>>>12),f(128|g>>>6&63),f(128|63&g))}return jd(d,0,h)}(Mr(e)),{mtime:0});return{contentType:Cd,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(r===Ze.Base64){var i=function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(Mr(e)),n=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Mr(o)))(i);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var a=Mr(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Rd=t=>{var e,r,s=()=>({url:La(t.url,"compression"),encodedBody:El(T({},t,{compression:void 0,xt:void 0}))});try{e=El(t)}catch(i){if(Ko(t.compression,Zr(t.url,"compression")))return R.error("Failed to gzip request body, sending uncompressed payload",i),s();throw i}return e&&Ko(t.compression,Zr(t.url,"compression"))&&!((r=e.body)instanceof ArrayBuffer?ra(new Uint8Array(r)):ArrayBuffer.isView(r)&&ra(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(_i=!0,s()):{url:t.url,encodedBody:e}},Sl=t=>{try{return Rd(t)}catch(e){return R.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},am=function(){var t=Ce(function*(e){var r=Mr(e.data),s=yield function(n,a,o){return sa.apply(this,arguments)}(r,ke.DEBUG,{rethrow:!0});if(!s)return e;var i=yield s.arrayBuffer();return T({},e,{xt:{contentType:Cd,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),om=["/e/","/s/"],kl=(t,e)=>{var r=(i=>{var n=(a=>{var o=Vs(a),l=(o==null?void 0:o.pathname)||a.split(/[?#]/)[0];return l?l[0]==="/"?l:"/"+l:"/"})(i);return om.some(a=>((o,l)=>o.slice(o.length-l.length)===l)(n,a))})(t),s=r?La(t,"ver"):t;return Td(e===Ze.GZipJS?La(s,"compression"):s,T({_:new Date().getTime().toString()},r?{}:{ver:ke.JS_SDK_VERSION},e===Ze.GZipJS?{}:{compression:e}))},yi=[];ea&&yi.push({transport:"fetch",method(t){var e,r=Sl(t);if(r){var{url:s,encodedBody:i}=r,{contentType:n,body:a,estimatedSize:o}=i??{},l=new Headers;he(t.headers,function(f,p){l.append(p,f)}),n&&l.append("Content-Type",n);var u=null,d=!1;if(Uo){var h=new Uo;u={signal:h.signal,timeout:setTimeout(()=>{var f,p;d=!0,h.abort((f=t.timeout,(p=new Error("PostHog request timed out"+(f?" after "+f+"ms":""))).name="AbortError",p))},t.timeout)}}ea(s,T({method:(t==null?void 0:t.method)||"GET",headers:l,keepalive:t.method==="POST"&&52428.8>(o||0),body:a,signal:(e=u)==null?void 0:e.signal},t.fetchOptions)).then(f=>f.text().then(p=>{var m={statusCode:f.status,text:p};if(f.status===200)try{m.json=JSON.parse(p)}catch(g){R.error(g)}t.callback==null||t.callback(m)})).catch(f=>{d&&(f==null?void 0:f.name)==="AbortError"?R.warn(f):R.error(f),t.callback==null||t.callback({statusCode:0,error:f})}).finally(()=>u?clearTimeout(u.timeout):null)}}}),ta&&yi.push({transport:"XHR",method(t){var e=Sl(t);if(e){var r=new ta,{url:s,encodedBody:i}=e;r.open(t.method||"GET",s,!0);var{contentType:n,body:a}=i??{};he(t.headers,function(o,l){r.setRequestHeader(l,o)}),n&&r.setRequestHeader("Content-Type",n),t.timeout&&(r.timeout=t.timeout),r.onreadystatechange=()=>{if(r.readyState===4){var o={statusCode:r.status,text:r.responseText};if(r.status===200)try{o.json=JSON.parse(r.responseText)}catch{}t.callback==null||t.callback(o)}},r.send(a)}}}),Ue!=null&&Ue.sendBeacon&&yi.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Rd(t),{contentType:s,body:i}=r??{};if(!i)return;var n=i instanceof Blob?i:new Blob([i],{type:s});Ue.sendBeacon(e,n)}catch{}}});var Ma=3e3;class lm{constructor(e,r){this.br=!0,this._r=[],this.wr=_t((r==null?void 0:r.flush_interval_ms)||Ma,250,5e3,R.createLogger("flush interval"),Ma),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=this._r.length>0?this.Tr():{},r=Object.values(e);[...r.filter(s=>s.url.indexOf("/e")===0),...r.filter(s=>s.url.indexOf("/e")!==0)].map(s=>{this.Er(T({},s,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout(()=>{if(this.Ir(),this._r.length>0){var r=this.Tr(),s=function(){var n=r[i],a=new Date().getTime();n.data&&Z(n.data)&&he(n.data,o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp}),e.Er(n)};for(var i in r)s()}},this.wr))}Er(e){try{this.kr(e)}catch(r){R.error(r)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return he(this._r,r=>{var s,i=r,n=(i?i.batchKey:null)||i.url;N(e[n])&&(e[n]=T({},i,{data:[]})),(s=e[n].data)==null||s.push(i.data)}),this._r=[],e}}var cm=["retriesPerformedSoFar"];class um{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!N(b)&&"onLine"in b.navigator&&(this.Rr=b.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},xe(b,"online",this.Or),xe(b,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:r}=e,s=cu(e,cm);Ct(r)&&(s.url=Td(s.url,{retry_count:r})),this._instance._send_request(T({},s,{callback:i=>{if(i.statusCode!==200&&(400>
75i.statusCode||i.statusCode>=500)){if((i.statusCode===0?3:10)>(r??0))return void this.st(T({retriesPerformedSoFar:r},s));i.statusCode===0&&R.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(r??0)+" retries.")}s.callback==null||s.callback(i)}}))}st(e){var r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=function(a){var o=3e3*Math.pow(2,a),l=o/2,u=Math.min(18e5,o),d=Math.random()-.5;return Math.ceil(u+d*(u-l))}(r),i=Date.now()+s;this._r.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+s;navigator.onLine||(n+=" (Browser is offline)"),R.warn(n),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),this._r.length===0)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout(()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()},this.Pr)}Lr(){var e=Date.now(),r=[],s=this._r.filter(n=>e>n.retryAt||(r.push(n),!1));if(this._r=r,s.length>0)for(var{requestOptions:i}of s)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,N(b)||(this.Or&&(b.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(b.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(T({},e,{transport:"sendBeacon"}))}catch(r){R.error(r)}this._r=[]}}class dm{constructor(e){this.Dr=()=>{var r,s,i,n;this.Nr||(this.Nr={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,u=o+((a==null?void 0:a.clientHeight)||0),d=(a==null?void 0:a.scrollHeight)||0;this.Nr.lastScrollY=Math.ceil(o),this.Nr.maxScrollY=Math.max(o,(r=this.Nr.maxScrollY)!==null&&r!==void 0?r:0),this.Nr.maxScrollHeight=Math.max(l,(s=this.Nr.maxScrollHeight)!==null&&s!==void 0?s:0),this.Nr.lastContentY=u,this.Nr.maxContentY=Math.max(u,(i=this.Nr.maxContentY)!==null&&i!==void 0?i:0),this.Nr.maxContentHeight=Math.max(d,(n=this.Nr.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){xe(b,"scroll",this.Dr,{capture:!0}),xe(b,"scrollend",this.Dr,{capture:!0}),xe(b,"resize",this.Dr)}scrollElement(){if(!this.qr)return b==null?void 0:b.document.documentElement;var e=Z(this.qr)?this.qr:[this.qr];for(var r of e){var s=b==null?void 0:b.document.querySelector(r);if(s)return s}}Br(e){var r=e==="y"?"scrollTop":"scrollLeft";if(this.qr){var s=this.scrollElement();return s&&s[r]||0}return b?e==="y"?b.scrollY||b.pageYOffset||b.document.documentElement.scrollTop||0:b.scrollX||b.pageXOffset||b.document.documentElement.scrollLeft||0:0}scrollY(){return this.Br("y")}scrollX(){return this.Br("x")}}var hm=t=>yd(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);class Pl{constructor(e,r,s,i){this.jr=n=>{var a=this.Hr();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Ur(this._instance)};this.zr.register({[Sa]:o})}},this._instance=e,this.Vr=r,this.zr=s,this.Ur=i||hm,this.Vr.onSessionId(this.jr)}Hr(){return this.zr.props[Sa]}getSetOnceProps(){var e,r=(e=this.Hr())==null?void 0:e.props;return r?"r"in r?bd(r,this._instance.config.disable_capture_url_hashes):{$referring_domain:r.referringDomain,$pathname:r.initialPathName,utm_source:r.utm_source,utm_campaign:r.utm_campaign,utm_medium:r.utm_medium,utm_content:r.utm_content,utm_term:r.utm_term}:{}}getSessionProps(){var e={};return he(no(this.getSetOnceProps()),(r,s)=>{s==="$current_url"&&(s="url"),e["$session_entry_"+ia(s)]=r}),e}}class ho{constructor(){this.Wr={}}on(e,r){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(r),()=>{this.Wr[e]=this.Wr[e].filter(s=>s!==r)}}emit(e,r){for(var s of this.Wr[e]||[])s(r);for(var i of this.Wr["*"]||[])i(e,r)}}var vs=we("[SessionId]");class jl{on(e,r){return this.Gr.on(e,r)}constructor(e,r,s){var i;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new ho,this.Kr=(u,d)=>!(!Ct(u)||!Ct(d))&&Math.abs(u-d)>
75this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Ot)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=r||Nt,this.ri=s||Nt;var n=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*_t(this.Se.session_idle_timeout_seconds||1800,60,36e3,vs.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+n+"_window_id",this.si="ph_"+n+"_primary_window_exists",this.oi()){var a=Ae.F(this.ni),o=Ae.F(this.si);a&&!o?this.Xr=a:Ae.P(this.ni),Ae.q(this.si,!0)}if((i=this.Se.bootstrap)!=null&&i.sessionID)try{var l=(u=>{var d=this.Se.bootstrap.sessionID.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,new Date().getTime(),l)}catch(u){vs.error("Invalid sessionID in bootstrap",u)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return N(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter(r=>r!==e)}}oi(){return this.Se.persistence!=="memory"&&!this.zr.Vt&&Ae.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&Ae.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?Ae.F(this.ni):null}di(e){var r=this.Zr;return!Ve(r)&&!Ve(e)&&5e3>Math.abs(e-r)}ai(e,r,s){var i=r!==this._sessionActivityTimestamp,n=!(e!==this.ei||s!==this._sessionStartTimestamp);this._sessionStartTimestamp=s,this._sessionActivityTimestamp=r,this.ei=e,n&&!i||n&&this.di(r)||(this.Zr=r,this.zr.register({[Lr]:[r,e,s]}))}ci(){var e,r=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Ct(r)&&r>0}vi(){this.ci()?this.zr.refreshKey(Lr):(this.zr.flush(),this.zr.load())}fi(){var e;if(!Ve(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,r,s]=this.pi();r===this.ei&&s===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[Lr]:[this._sessionActivityTimestamp,(e=this.ei)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi(),r=Ct(e)?e:0,s=Ct(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(r,s)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[Lr];return Z(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&b&&(b.removeEventListener(Di,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&Ae.P(this.si)},xe(b,Di,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,r){if(e===void 0&&(e=!1),r===void 0&&(r=null),this.Se.cookieless_mode===Ot)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=r||new Date().getTime(),[,i,n]=this.pi(),a=this.gi(),o=this.hi(),l=Ct(n)&&Math.abs(s-n)>864e5,u=!1,d=!1,h=!i,f=i,p=!h&&!e&&this.Kr(s,a);p&&((p=this.mi(s))||vs.info("cross-tab refresh kept the session alive",{sessionId:i}),[,i,n]=this.pi()),h||p||l?(i=this.ti(),o=this.ri(),vs.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:l}}),n=s,u=!0):(o||(o=this.ri(),u=!0),(d=i!==f)&&(vs.info("adopted cross-tab session id",{sessionId:i,windowId:o}),u=!0));var m=Ct(a)&&e&&!l?a:s,g=Ct(n)?n:new Date().getTime();this.ui(o),this.ai(i,m,g),e||this.ii();var v={noSessionId:h,activityTimeout:p,sessionPastMaximumLength:l,crossTabAdoption:d};return u&&this.Qr.forEach(y=>y(i,o,v)),{sessionId:i,windowId:o,sessionStartTimestamp:g,changeReason:u?v:void 0,lastActivityTimestamp:a}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout(()=>{if(!this.Yr)if(this.mi(new Date().getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:e})}else this.ii()},1.1*this.sessionTimeoutMs))}}var Nd=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Jo(r,e))return!0;try{var s=t==null?void 0:t.userAgentData;if(s!=null&&s.brands&&s.brands.some(i=>Jo(i==null?void 0:i.brand,e)))return!0}catch{}
75return!!t.webdriver};function Ad(){return(Ad=Ce(function*(){var t=Ue==null?void 0:Ue.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=e==null?void 0:e.model;return ce(r)&&r.length>0?r:void 0}catch(s){return void R.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",s)}})).apply(this,arguments)}var Hi=function(t,e){if(!function(r){try{new RegExp(r)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Cl(t,e,r){return Mr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Od={exact:(t,e)=>e.some(r=>t.some(s=>r===s)),is_not:(t,e)=>e.every(r=>t.every(s=>r!==s)),regex:(t,e)=>e.some(r=>t.some(s=>Hi(r,s))),not_regex:(t,e)=>e.every(r=>t.every(s=>!Hi(r,s))),icontains:(t,e)=>e.map(di).some(r=>t.map(di).some(s=>r.includes(s))),not_icontains:(t,e)=>e.map(di).every(r=>t.map(di).every(s=>!r.includes(s))),gt:(t,e)=>e.some(r=>{var s=parseFloat(r);return!isNaN(s)&&t.some(i=>s>parseFloat(i))}),lt:(t,e)=>e.some(r=>{var s=parseFloat(r);return!isNaN(s)&&t.some(i=>s<parseFloat(i))})},di=t=>t.toLowerCase();function Id(t,e){return!t||Object.entries(t).every(r=>{var[s,i]=r,n=e==null?void 0:e[s];if(N(n)||Ve(n))return!1;var a=[String(n)],o=Od[i.operator];return!!o&&o(i.values,a)})}var $a="custom",Tl="i.posthog.com",pm=/^\/static\//;class fm{constructor(e){this.bi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,r=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return r||(r=this.apiHost.replace("."+Tl,".posthog.com")),r==="https://app.posthog.com"?"https://us.posthog.com":r}get region(){return this.bi[this.apiHost]||(this.bi[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":$a),this.bi[this.apiHost]}wi(e){if(pm.test(e)){var r=this.instance.config.asset_host;if(typeof r=="string")return r.trim().replace(/\/$/,"")||void 0}}endpointFor(e,r){if(r===void 0&&(r=""),r&&(r=r[0]==="/"?r:"/"+r),e==="ui")return this.uiHost+r;if(e==="flags")return this.flagsApiHost+r;if(e==="assets"){var s=this.wi(r);if(s)return""+s+r}if(this.region===$a)return this.apiHost+r;var i=Tl+r;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var le=we("[Surveys]"),Da="seenSurvey_",Fd=t=>{try{var e=(r=>((s,i)=>{var n=""+Da+i.id;return i.current_iteration&&i.current_iteration>0&&(n=""+Da+i.id+"_"+i.current_iteration),n})(0,r))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(r){le.error("Failed to persist survey seen state",r)}},gm=[Tn.Popover,Tn.Widget,Tn.API],vm={ignoreConditions:!1,ignoreDelay:!1,displayType:Aa.Popover},mm=we("[PostHog ExternalIntegrations]"),_m={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ym{constructor(e){this._instance=e}Mt(e,r){var s;(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,e,i=>{if(i)return mm.error("failed to load script",i);r()})}startIfEnabledOrStop(){var e=this,r=function(a){var o,l,u;!i||(o=$.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.Mt(_m[a],()=>{var d;(d=$.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[a])==null||d.start(e._instance)}),!i&&(l=$.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((u=$.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.stop())};for(var[s,i]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;r(s)}}}var Is={},On=0,Gi=()=>{},Rl='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ms="Surveys module not available",Nl="sanitize_properties is deprecated. Use before_send instead",Ld="Invalid value for property_denylist config: ",Fr="posthog",Md=!nm&&(qe==null?void 0:qe.indexOf("MSIE"))===-1&&(qe==null?void 0:qe.indexOf("Mozilla"))===-1,Al=t=>{var e;return T({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:wv(I==null?void 0:I.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Gi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Pe&&ce(Pe==null?void 0:Pe.search)&&Pe.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(b==null||(e=b.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(r){R.error("Bad HTTP status: "+r.statusCode+" "+r.text)},get_device_id:r=>r,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Ta,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Ma},error_tracking:{},_onCapture:Gi},(r=>({rageclick:r&&r>="2026-05-30"?{content_ignorelist:Iv,ignore_text_selection:!0}
75:!r||"2025-11-30">r||{content_ignorelist:!0},capture_pageview:!r||"2025-05-24">r||"history_change",session_recording:r&&r>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:r&&r>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:r&&r>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:r&&r>="2026-01-30"?"head":"body",internal_or_test_user_hostname:r&&r>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:r&&r>="2026-05-30"?250:0,split_storage:!(!r||"2026-05-30">r),detect_google_search_app:!(!r||"2026-05-30">r),disable_capture_url_hashes:!(!r||"2026-06-25">r)}))(t))},bm=[["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"]],Ol=t=>{var e={};for(var[r,s]of bm)N(t[r])||(e[s]=t[r]);var i=fe({},e,t),n=t.__preview_external_dependency_versioned_paths;return N(n)||(N(t.strict_script_versioning)&&(i.strict_script_versioning=!!n),ce(n)&&N(t.asset_host)&&(i.asset_host=n)),Z(t.property_blacklist)&&(N(t.property_denylist)?i.property_denylist=t.property_blacklist:Z(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:R.error(Ld+t.property_denylist)),i};class xm{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){R.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class et{ki(e,r){if(e){var s=this.Si.indexOf(e);s!==-1&&this.Si.splice(s,1)}return this.Si.push(r),r.initialize==null||r.initialize(),r}Ci(){return this.config.cookieless_mode===Ot||this.config.cookieless_mode===ur&&this.consent.isRejected()}get decideEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new xm,this.Ii=!1,this.version=ke.LIB_VERSION,this.Ti=new ho,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Al(),this.SentryIntegration=Vv,this.sentryIntegration=s=>function(i,n){var a=hd(i,n);return{name:dd,processEvent:o=>a(o)}}(this,s),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new dm(this),this.pageViewManager=new gl(this),this.rateLimiter=new Zv(this),this.requestRouter=new fm(this),this.consent=new Tv(this),this.externalIntegrations=new ym(this);var r=(e=et.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:(s,i,n)=>{var a=ce(s)?{[s]:i}:s;this.setPersonProperties(a),n==null||n({})},set_once:(s,i,n)=>{var a=ce(s)?{[s]:i}:s;this.setPersonProperties(void 0,a),n==null||n({})}},this.on("eventCaptured",s=>R.info('send "'+(s==null?void 0:s.event)+'"',s))}init(e,r,s){if(s&&s!==Fr){var i,n=(i=Is[s])!==null&&i!==void 0?i:new et;return n._init(e,r,s),Is[s]=n,Is[Fr][s]=n,n}return this._init(e,r,s)}_init(e,r,s){var i,n;r===void 0&&(r={});var a=ce(e)?e.trim():"";if(!a)return R.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},r.debug=this.Oi(r.debug),this.Li=r,this.Fi=[],r.person_profiles?this.Pi=r.person_profiles:r.process_person&&(this.Pi=r.process_person);var o=Al(r.defaults),l=Ol(r),u=fe({},o,l,{name:s,token:a});ve(o.rageclick)&&ve(l.rageclick)&&(u.rageclick=fe({}
75,o.rageclick,l.rageclick)),ve(o.session_recording)&&ve(l.session_recording)&&(u.session_recording=fe({},o.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&R.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:Ze.GZipJS;var d=this.Ai();this.persistence=new Cn(this.config,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Cn(T({},this.config,{persistence:"sessionStorage"}),d,!1);var h=T({},this.persistence.props),f=T({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new lm(E=>this.Di(E),this.config.request_queue_config),this.Ni=new um(this),this.__request_queue=[];var p=this.Ci();if(p||(this.sessionManager=new jl(this),this.sessionPropsManager=new Pl(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(R.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.qi(p)},0)):(R.info("Initializing extensions synchronously"),this.qi(p)),ke.DEBUG=ke.DEBUG||this.config.debug,ke.DEBUG&&R.info("Starting in debug mode",{this:this,config:r,thisC:T({},this.config),p:h,s:f}),!this.config.identity_distinct_id||(i=r.bootstrap)!=null&&i.distinctID||(r.bootstrap=T({},r.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((n=r.bootstrap)==null?void 0:n.distinctID)!==void 0){var m=r.bootstrap.distinctID,g=this.get_distinct_id(),v=this.persistence.get_property(lt);if(r.bootstrap.isIdentifiedID&&g!=null&&g!==m&&v===Cr)this.identify(m);else if(r.bootstrap.isIdentifiedID&&g!=null&&g!==m&&v===Tr)R.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var y=this.config.get_device_id(Nt()),w=r.bootstrap.isIdentifiedID?y:m;this.persistence.set_property(lt,r.bootstrap.isIdentifiedID?Tr:Cr),this.register({distinct_id:m,$device_id:w})}}if(p)this.register_once({distinct_id:ni,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(Nt());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(lt,Cr)}return xe(b,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),r.segment?function(E,j){var L=E.config.segment;if(!L)return j();(function(P,C){var k=P.config.segment;if(!k)return C();var A=O=>{var H=()=>O.anonymousId()||Nt();P.config.get_device_id=H,O.id()&&(P.register({distinct_id:O.id(),$device_id:H()}),P.persistence.set_property(lt,Tr)),C()},M=k.user();"then"in M&&ht(M.then)?M.then(A):A(M)})(E,()=>{L.register((P=>{typeof Promise<"u"&&Promise.resolve||jn.warn("This browser does not have Promise support, and can not use the segment integration");var C=(k,A)=>{if(!A)return k;k.event.userId||k.event.anonymousId===P.get_distinct_id()||(jn.info("No userId set, resetting PostHog"),P.reset()),k.event.userId&&k.event.userId!==P.get_distinct_id()&&(jn.info("UserId set, identifying with PostHog"),P.identify(k.event.userId));var M=P.calculateEventProperties(A,k.event.properties);return k.event.properties=Object.assign({},M,k.event.properties),k};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:k=>C(k,k.event.event),page:k=>C(k,Ir),identify:k=>C(k,Sn),screen:k=>C(k,"$screen")}})(E)).then(()=>{j()})})}(this,()=>this.Bi()):this.Bi(),ht(this.config._onCapture)&&this.config._onCapture!==Gi&&(R.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&R.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 Ad.apply(this,arguments)}().then(E=>{E&&this.register({[wn]:E})}).catch(Gi),this}qi(e){var r,s,i,n,a,o,l,u=performance.now(),d=T({},et.__defaultExtensionClasses,this.config.__extensionClasses),h=[];d.featureFlags&&this.Si.push(this.featureFlags=(r=this.featureFlags)!==null&&r!==void 0?r:new d.featureFlags(this)),d.exceptions&&this.Si.push(this.exceptions=(s=this.exceptions)!==null&&s!==void 0?s:new d.exceptions(this)),d.historyAutocapture&&this.Si.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Si.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Si.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Si.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Si.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Si.push(this.surveys=(i=this.surveys)!==null&&i!==void 0?i:new d.surveys(this)),d.logs&&this.Si.push(this.logs=(n=this.logs)!==null&&n!==void 0?n:new d.logs(this)),d.conversations&&this.Si.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new d.conversations(this)),d.productTours&&this.Si.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Si.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Si.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Uv)),d.toolbar&&this.Si.push(this.toolbar=(o=this.toolbar)!==null&&o!==void 0?o:new d.toolbar(this)),d.experiments&&this.Si.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new d.experiments(this)),this.Si.forEach(f=>{f.initialize&&h.push(()=>{f.initialize==null||f.initialize()})}),h.push(()=>
75{if(this.ji){var f=this.ji;this.ji=void 0,this.pr(f)}}),this.Hi(h,u)}Hi(e,r){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&e.length>0)return void setTimeout(()=>{this.Hi(e,r)},0);var s=e.shift();if(s)try{s()}catch(n){R.error("Error initializing extension:",n)}}var i=Math.round(performance.now()-r);this.register_for_session({[Ku]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Qu]:i}),this.config.__preview_deferred_init_extensions&&R.info("PostHog extensions initialized ("+i+"ms)")}pr(e){var r;if(!I||!I.body)return R.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.pr(e)},500);this.config.__preview_deferred_init_extensions&&(this.ji=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=B(e.supportedCompression,Ze.GZipJS)?Ze.GZipJS:B(e.supportedCompression,Ze.Base64)?Ze.Base64:void 0),(r=e.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:Ta}),this.Si.forEach(s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e))}Bi(){try{this.config.loaded(this)}catch(s){R.critical("`loaded` function failed",s)}if(this.zi(),this.config.internal_or_test_user_hostname&&Pe!=null&&Pe.hostname){var e=Pe.hostname,r=this.config.internal_or_test_user_hostname;(typeof r=="string"?e===r:r.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()},1),this.Wi=new wd(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.$i)==null||e.enable())}_dom_loaded(){this.is_capturing()&&ai(this.__request_queue,e=>this.Di(e)),this.__request_queue=[],this.zi()}_handle_unload(){var e,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(En),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.$i)==null||s.unload(),(i=this.Ni)==null||i.unload()):this.Gi()&&this.capture(En,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?Md?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=T({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(N(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(r=>{var s,i,n,a=T({},r);a.timeout=a.timeout||6e4,a.url=kl(a.url,a.compression);var o=(s=a.transport)!==null&&s!==void 0?s:"fetch",l=yi.filter(d=>!a.disableTransport||!d.transport||!a.disableTransport.includes(d.transport)),u=(i=(n=function(d,h){for(var f=0;d.length>f;f++)if(d[f].transport===o)return d[f]}(l))==null?void 0:n.method)!==null&&i!==void 0?i:l[0].method;if(!u)throw new Error("No available transport method");o!=="sendBeacon"&&a.data&&a.compression===Ze.GZipJS&&Pg&&typeof Promise<"u"&&!_i?am(a).then(d=>{u(d)}).catch(d=>{if(Qo(d))return _i=!0,void u(T({},a,{compression:void 0,url:kl(r.url,void 0)}));(h=>{if(!h||typeof h!="object")return!1;var f="name"in h?String(h.name):"";return Qo(h)||f===uu})(d)&&(_i=!0),u(a)}):u(a)})(T({},e,{callback:r=>{var s,i;this.rateLimiter.checkForLimiting(r),400>r.statusCode||(s=(i=this.config).on_request_error)==null||s.call(i,r),e.callback==null||e.callback(r)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){On++;try{var r,s=[],i=[],n=[];ai(e,o=>{if(o)if(Z(r=o[0]))n.push(o);else if(ht(o))try{o.call(this)}catch(l){R.error("Error executing queued PostHog call",o,l)}else Z(o)&&r==="alias"?s.push(o):Z(o)&&r.indexOf("capture")!==-1&&ht(this[r])?n.push(o):i.push(o)});var a=function(o,l){ai(o,function(u){try{if(Z(u[0])){var d=l;he(u,function(h){d=d[h[0]].apply(d,h.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(h){R.error("Error executing queued PostHog call",u,h)}})};a(s,this),a(i,this),a(n,this)}finally{On--}}push(e){if(On>0&&Z(e)&&ce(e[0])){var r=et.prototype[e[0]];ht(r)&&r.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,r,s){var i,n,a,o,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!N(e)&&ce(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var d=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(d==null||!d.isRateLimited){r!=null&&r.$current_url&&!ce(r==null?void 0:r.$current_url)&&(R.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),r==null||delete r.$current_url),e!=="$exception"||s!=null&&s.Zi||R.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,f=(s==null?void 0:s.timestamp)||h,p=tl(s==null?void 0:s.uuid,Nt),m={uuid:p,event:e,properties:this.calculateEventProperties(e,r||{},f,p)};e===Ir&&this.config.__preview_capture_bot_pageviews&&u&&(m.event="$bot_pageview",m.properties.$browser_type="bot"),d&&(m.properties.$lib_rate_limit_remaining_tokens=d.remainingTokens),s!=null&&s.$set&&(m.$set=s==null?void 0:s.$set);var g=s==null?void 0:s.$unset;g&&(m.$unset=g);var v,y,w,x=this.Qi(s==null?void 0:s.$set_once,e!==il,e===Sn);if(x&&(m.$set_once=x),s!=null&&s._noTruncate||(n=this.config.properties_string_max_length,a=m,o=A=>ce(A)?A.slice(0,n):A,l=new Set,m=function A(M,O){return M!==Object(M)?o?o(M):M:l.has(M)?void 0:(l.add(M),Z(M)?(H=[],ai(M,V=>{H.push(A(V))})):(H={},he(M,(V,re)=>{l.has(V)||(H[re]=A(V))})),H);var H}(a)),m.timestamp=f,N(s==null?void 0:s.timestamp)||(m.properties.$event_time_override_provided=!0,m.properties.$event_time_override_system_time=h),e===It.DISMISSED||e===It.SENT){var E=r==null?void 0:r[Rn.SURVEY_ID],j=r==null?void 0:r[Rn.SURVEY_ITERATION];Fd({id:E,current_iteration:j}),m.$set=T({},m.$set,{[(v={id:E,current_iteration:j},y=e===It.SENT?"responded":"dismissed",w="$survey_"+y+"/"+v.id,v.current_iteration&&v.current_iteration>0&&(w="$survey_"+y+"/"+v.id+"/"+v.current_iteration),w)]:!0})}else e===It.SHOWN&&(m.$set=T({},m.$set,{[Rn.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===Xv.SHOWN){var L=r==null?void 0:r[ml.TOUR_TYPE];L&&(m.$set=T({},m.$set,{[ml.TOUR_LAST_SEEN_DATE+"/"+L]:new Date().toISOString()}))}var P=T({},m.properties.$set,m.$set);if(Qt(P)||this.setPersonPropertiesForFlags(P),!Y(this.config.before_send)){var C=this.it(m);if(!C)return;(m=C).uuid=tl(m.uuid,Nt)}this.Ti.emit("eventCaptured",m);var k={method:"POST",url:(i=s==null?void 0:s._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:m,compression:"best-available",batchKey:s==null?void 0:s._batchKey,transport:s==null?void 0:s.transport};return!this.config.request_batching||s&&(s==null||!s._batchKey)||s!=null&&s.send_instantly?this.Di(k):this.$i.enqueue(k),m}R.critical("This capture call is ignored due to client rate limiting.")}}else R.error("No event name provided to posthog.capture")}else R.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",r=>e(r.event,r))}calculateEventProperties(e,r,s,i,n){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return r;var a=n?void 0:this.persistence.remove_event_timer(e),o=T({},r);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Ci()&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=T({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!ce(o.distinct_id)&&!Ie(o.distinct_id)||na(o.distinct_id))&&R.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,d=function(y,w,x,E){var j,L,P,C;if(E===void 0&&(E=!1),!qe)return{};var k,A,M,O,H,V,re,X,K,_e=y?[...es,...w||[]]:[],[z,ae]=function(ee){for(var ne=0;Zo.length>ne;ne++){var[De,ie]=Zo[ne],Re=De.exec(ee),Fe=Re&&(ht(ie)?ie(Re,ee):ie);if(Fe)return Fe}return["",""]}(qe),te=(k=typeof navigator<"u"?navigator:void 0)!=null&&k.brave?{brave:!0}:{},Q={detectGoogleSearchApp:x},q=fe(no({$os:z,$os_version:ae,$browser:Ou(qe,navigator.vendor,te,Q),$device:el(qe),$device_type:(M=qe,O={userAgentDataPlatform:(j=navigator)==null||(j=j.userAgentData)==null?void 0:j.platform,maxTouchPoints:(L=navigator)==null?void 0:L.maxTouchPoints,screenWidth:b==null||(P=b.screen)==null?void 0:P.width,screenHeight:b==null||(C=b.screen)==null?void 0:C.height,devicePixelRatio:b==null?void 0:b.devicePixelRatio},K=el(M),K===gu||K===fu||K==="Kobo"||K==="Kindle Fire"||K===Cu?Qr:K===Ds||K===zr||K===zs||K===oa?"Console":K===mu?"Wearable":K?Ye:(O==null?void 0:O.userAgentDataPlatform)==="Android"&&((H=O==null?void 0:O.maxTouchPoints)!==null&&H!==void 0?H:0)>0?600>Math.min((V=O==null?void 0:O.screenWidth)!==null&&V!==void 0?V:0,(re=O==null?void 0:O.screenHeight)!==null&&re!==void 0?re:0)/((X=O==null?void 0:O.devicePixelRatio)!==null&&X!==void 0?X:1)?Ye:Qr:"Desktop"),$timezone:xd(),$timezone_offset:Yv()}),{$current_url:qs(E?Xt(Pe==null?void 0:Pe.href):Pe==null?void 0:Pe.href,_e,Hs),$host:Pe==null?void 0:Pe.host,$pathname:Pe==null?void 0:Pe.pathname,$raw_user_agent:qe.length>1e3?qe.substring(0,997)+"...":qe,$browser_version:Hg(qe,navigator.vendor,te,Q),$browser_language:vl(),$browser_language_prefix:(A=vl(),typeof A=="string"?A.split("-")[0]:void 0),$screen_height:b==null?void 0:b.screen.height,$screen_width:b==null?void 0:b.screen.width,$viewport_height:b==null?void 0:b.innerHe
75ight,$viewport_width:b==null?void 0:b.innerWidth,$lib:ke.LIB_NAME,$lib_version:ke.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return ke.SDK_DIST_CHANNEL&&(q.$sdk_dist_channel=ke.SDK_DIST_CHANNEL),q}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var{sessionId:h,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,s.getTime());o.$session_id=h,o.$window_id=f}this.sessionPropsManager&&fe(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&fe(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.Ni)==null?void 0:p.length}catch(y){o.$sdk_debug_error_capturing_properties=String(y)}if(this.requestRouter.region===$a&&(o.$lib_custom_api_host=this.config.api_host),u=e!==Ir||n?e!==En||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,i),o=fe(o,u),e===Ir&&I&&(o.title=I.title),!N(a)){var m=s.getTime()-a;o.$duration=parseFloat((m/1e3).toFixed(3))}qe&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=fe({},d,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Z(this.config.property_denylist)?he(this.config.property_denylist,function(y){delete o[y]}):R.error(Ld+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(R.error(Nl),o=g(o,e));var v=this.Ji();return o.$process_person_profile=v,v&&!n&&this.Yi("_calculate_event_properties"),o}Qi(e,r,s){var i;if(r===void 0&&(r=!0),s===void 0&&(s=!1),!this.persistence||!this.Ji()||this.Ii&&!s)return e;var n=this.persistence.get_initial_props(),a=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),o=fe({},n,a||{},e||{}),l=this.config.sanitize_properties;return l&&(R.error(Nl),o=l(o,"$set_once")),r&&(this.Ii=!0),Qt(o)?void 0:o}register(e,r){var s;(s=this.persistence)==null||s.register(e,r)}register_once(e,r,s){var i;(i=this.persistence)==null||i.register_once(e,r,s)}register_for_session(e){var r;(r=this.sessionPersistence)==null||r.register(e)}unregister(e){var r;(r=this.persistence)==null||r.unregister(e)}unregister_for_session(e){var r;(r=this.sessionPersistence)==null||r.unregister(e)}Ki(e,r){this.register({[e]:r})}getFeatureFlag(e,r){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlag(e,r)}getFeatureFlagPayload(e){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagPayload(e)}getFeatureFlagResult(e,r){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlagResult(e,r)}getAllFeatureFlags(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,r){var s;return(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,r)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,r,s){var i;(i=this.featureFlags)==null||i.updateFlags(e,r,s)}updateEarlyAccessFeatureEnrollment(e,r,s){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(e,r,s)}getEarlyAccessFeatures(e,r,s){var i;return r===void 0&&(r=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(e,r,s)}on(e,r){return this.Ti.on(e,r)}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:ms}),()=>{})}onSessionId(e){var r,s;return(r=(s=this.sessionManager)==null?void 0:s.onSessionId(e))!==null&&r!==void 0?r:()=>{}}getSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getSurveys(e,r):e([],{isLoaded:!1,error:ms})}getActiveMatchingSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,r):e([],{isLoaded:!1,error:ms})}renderSurvey(e,r){var s;(s=this.surveys)==null||s.renderSurvey(e,r)}displaySurvey(e,r){var s;r===void 0&&(r=vm),(s=this.surveys)==null||s.displaySurvey(e,r)}cancelPendingSurvey(e){var r;(r=this.surveys)==null||r.cancelPendingSurvey(e)}canRenderSurvey(e){var r,s;return(r=(s=this.surveys)==null?void 0:s.canRenderSurvey(e))!==null&&r!==void 0?r:{visible:!1,disabledReason:ms}}canRenderSurveyAsync(e,r){var s,i;return r===void 0&&(r=!1),(s=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(e,r))!==null&&s!==void 0?s:Promise.resolve({visible:!1,disabledReason:ms})}Xi(e){return!e||na(e)?(R.critical("Unique user id has not been set in posthog.identify"),!1):e===ni?(R.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())||(R.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
75ot a hardcoded string.'),!1)}identify(e,r,s){if(!this.__loaded||!this.persistence)return R.uninitializedWarning("posthog.identify");if(Ie(e)&&(e=e.toString(),R.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Xi(e)&&this.Yi("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ii)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(ws)&&(this.unregister(ws),this.register({distinct_id:e}));var n,a=(this.persistence.get_property(lt)||Cr)===Cr;e!==i&&a?(this.persistence.set_property(lt,Tr),this.setPersonPropertiesForFlags({$set:r||{},$set_once:s||{}},!1),this.capture(Sn,{distinct_id:e,$anon_distinct_id:i},{$set:r||{},$set_once:s||{}}),this.Ri=Cl(e,r,s),(n=this.featureFlags)==null||n.setAnonymousDistinctId(i)):(r||s)&&this.setPersonProperties(r,s),e!==i&&(this.reloadFeatureFlags(),this.unregister(Ns))}}setPersonProperties(e,r){if((e||r)&&this.Yi("posthog.setPersonProperties")){var s=Cl(this.get_distinct_id(),e,r);this.Ri!==s?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!0),this.capture("$set",{$set:e||{},$set_once:r||{}}),this.Ri=s):R.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var r,s=(Z(e)?e:[e]).filter(i=>ce(i)&&i.length>0);s.length!==0&&this.Yi("posthog.unsetPersonProperties")&&((r=this.featureFlags)==null||r.unsetPersonPropertiesForFlags(s,!0),this.capture("$set",{$unset:s}),this.Ri=null)}group(e,r,s){if(e&&r){var i=this.getGroups(),n=i[e]!==r;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:T({},i,{[e]:r})}),n||s){var a={$group_type:e,$group_key:r};s&&(a.$group_set=s),this.capture(il,a)}s&&this.setGroupPropertiesForFlags({[e]:s}),n&&!s&&this.reloadFeatureFlags()}else R.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,r){var s;r===void 0&&(r=!0),(s=this.featureFlags)==null||s.setPersonPropertiesForFlags(e,r)}resetPersonPropertiesForFlags(e){var r;e===void 0&&(e=!0),(r=this.featureFlags)==null||r.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,r){var s;r===void 0&&(r=!0),this.Yi("posthog.setGroupPropertiesForFlags")&&((s=this.featureFlags)==null||s.setGroupPropertiesForFlags(e,r))}resetGroupPropertiesForFlags(e){var r;(r=this.featureFlags)==null||r.resetGroupPropertiesForFlags(e)}reset(e){var r,s,i,n,a,o,l,u,d;if(R.info("reset"),!this.__loaded)return R.uninitializedWarning("posthog.reset");var h,f=this.get_property(Ii),p=this.get_property(wn),m=this.get_property(pr);if(this.consent.reset(),(r=this.persistence)==null||r.clear(),(s=this.sessionPersistence)==null||s.clear(),N(m)||(h=this.persistence)==null||h.register({[pr]:m}),(i=this.surveys)==null||i.reset(),(n=this.Wi)==null||n.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(l=this.logs)==null||l.reset(),(u=this.persistence)==null||u.set_property(lt,Cr),(d=this.sessionManager)==null||d.resetSessionId(),this.Ri=null,this.config.cookieless_mode===Ot)this.register_once({distinct_id:ni,$device_id:null},"");else{var g=this.config.get_device_id(Nt());this.register_once({distinct_id:g,$device_id:e?g:f},""),e||N(p)||this.register({[wn]:p})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var r=this;return Ce(function*(){var s,i,n,a;r.__loaded?((s=r.logs)==null||s.flushLogs("sendBeacon"),(i=r.$i)==null||i.unload(),(n=r.Ni)==null||n.unload(),(a=r.featureFlags)==null||a.destroy()):R.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,r){var s;this.config.identity_distinct_id=e,this.config.identity_hash=r,this.alias(e),(s=this.conversations)==null||s.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.tn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,r;return(e=(r=this.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:r,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+r);if(e!=null&&e.withTimestamp&&s){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!s)return i;
75i+="?t="+Math.max(Math.floor((new Date().getTime()-s)/1e3)-a,0)}return i}alias(e,r){return e===this.get_property(Uu)?(R.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(N(r)&&(r=this.get_distinct_id()),e!==r?(this.Ki(ws,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(R.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var r=T({},this.config);if(ve(e)){var s,i,n,a,o,l,u,d,h,f,p;fe(this.config,Ol(e));var m=this.Ai();(s=this.persistence)==null||s.update_config(this.config,r,m),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Cn(T({},this.config,{persistence:"sessionStorage"}),m,!1);var g=this.Oi(this.config.debug);yt(g)&&(this.config.debug=g),yt(this.config.debug)&&(this.config.debug?(ke.DEBUG=!0,de.N()&&de.q("ph_debug",!0),R.info("set_config",{config:e,oldConfig:r,newConfig:T({},this.config)})):(ke.DEBUG=!1,de.N()&&de.P("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(n=this.exceptions)==null||n.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(l=this.autocapture)==null||l.startIfEnabled(),(u=this.heatmaps)==null||u.startIfEnabled(),(d=this.exceptionObserver)==null||d.startIfEnabledOrStop(),(h=this.deadClicksAutocapture)==null||h.startIfEnabledOrStop(),(f=this.surveys)==null||f.loadIfEnabled(),this.rn(),(p=this.externalIntegrations)==null||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,r){ke.LIB_NAME=e,ke.LIB_VERSION=r}startSessionRecording(e){var r,s,i,n,a,o=e===!0,l={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),l.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),l.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),l.url_trigger&&((n=this.sessionRecording)==null||n.overrideTrigger("url")),l.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,r){if(this.exceptions){var s=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:s});return this.exceptions.sendExceptionEvent(T({},i,r))}}addExceptionStep(e,r){var s;(s=this.exceptions)==null||s.addExceptionStep(e,r)}captureLog(e){var r;(r=this.logs)==null||r.captureLog(e)}get logger(){var e,r;return(e=(r=this.logs)==null?void 0:r.logger)!==null&&e!==void 0?e:et.nn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var r,s;return(r=(s=this.toolbar)==null?void 0:s.loadToolbar(e))!==null&&r!==void 0&&r}get_property(e){var r;return(r=this.persistence)==null?void 0:r.props[e]}getSessionProperty(e){var r;return(r=this.sessionPersistence)==null?void 0:r.props[e]}toString(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:Fr;return r!==Fr&&(r=Fr+"."+r),r}_isIdentified(){var e,r;return((e=this.persistence)==null?void 0:e.get_property(lt))===Tr||((r=this.sessionPersistence)==null?void 0:r.get_property(lt))===Tr}Ji(){var e,r;return!(this.config.person_profiles==="never"||this.config.person_profiles===Ta&&!this._isIdentified()&&Qt(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ws])&&((r=this.persistence)==null||(r=r.props)==null||!r[Mi]))}Gi(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return this.config.person_profiles==="never"?(R.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ki(Mi,!0),!0)}Ai(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ur)}rn(){var e,r,s,i,n=this.Ai();return((e=this.persistence)==null?void 0:e.Vt)!==n&&((s=this.persistence)==null||s.set_disabled(n)),((r=this.sessionPersistence)==null?void 0:r.Vt)!==n&&((i=this.sessionPersistence)==null||i.set_disabled(n)),n}opt_in_capturing(e){var r;if(this.config.cookieless_mode!==Ot){if(this.Ci()){var s,i,n,a,o;this.reset(!0),(s=this.sessionManager)==null||s.destroy(),(i=this.pageViewM
75anager)==null||i.destroy(),this.sessionManager=new jl(this),this.pageViewManager=new gl(this),this.persistence&&(this.sessionPropsManager=new Pl(this,this.sessionManager,this.persistence));var l,u=(n=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&n!==void 0?n:(o=et.__defaultExtensionClasses)==null?void 0:o.sessionRecording;u&&(this.sessionRecording=this.ki(this.sessionRecording,new u(this)),this.Ui&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.Ui)))}var d,h;this.consent.optInOut(!0),this.rn(),this.zi(),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),this.config.cookieless_mode==ur&&((d=this.surveys)==null||d.loadIfEnabled()),(N(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((h=e==null?void 0:e.captureEventName)!==null&&h!==void 0?h:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else R.warn(Rl)}opt_out_capturing(){var e,r,s;this.config.cookieless_mode!==Ot?(this.config.cookieless_mode===ur&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===ur&&(this.register({distinct_id:ni,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi())):R.warn(Rl)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Ot||(this.config.cookieless_mode===ur?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return Ue?Nd(Ue,this.config.custom_blocked_useragents):void 0}Vi(){I&&(I.visibilityState==="visible"?this.Ei||(this.Ei=!0,this.capture(Ir,{title:I.title},{send_instantly:!0}),this.Mi&&(I.removeEventListener($i,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),xe(I,$i,this.Mi)))}debug(e){e===!1?(b==null||b.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(b==null||b.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}))}mr(){var e,r,s,i,n,a,o=this.Li||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(R.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):(s="advanced_disable_decide",i=R,n=(r="advanced_disable_flags")in(e=o)&&!Y(e[r]),a=s in e&&!Y(e[s]),n?e[r]:!!a&&(i&&i.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),e[s]))}it(e){var r;if(Y(this.config.before_send))return e;var s=Object.keys((r=e.properties)!==null&&r!==void 0?r:{}).filter(Og),i=Z(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var a of i){if(n=a(n),Y(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Ag(e.event)?R.warn(o+". This can cause unexpected behavior."):R.info(o),null}n.properties&&!Qt(n.properties)||R.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var l of s)if(n.properties&&Y(n.properties[l]))return R.warn("Event '"+e.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var e;return(e=this.pageViewManager.Ot)==null?void 0:e.pageViewId}captureTraceFeedback(e,r){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:r})}captureTraceMetric(e,r,s){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:r,$ai_metric_value:String(s)})}Oi(e){var r=yt(e)&&!e,s=de.N()&&de.A("ph_debug")==="true";return!r&&(!!s||e)}}et.__defaultExtensionClasses={},et.nn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=bv(t.prototype[e[r]])}(et,["identify"]);class Il{constructor(e){this.disabled=e===!1;var r=ve(e)?e:{};this.thresholdPx=r.threshold_px||30,this.timeoutMs=r.timeout_ms||1e3,this.clickCount=r.click_count||3,this.clicks=[]}isRageClick(e,r,s){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(r-i.y)<this.thresholdPx&&this.timeoutMs>s-i.timestamp){if(this.clicks.push({x:e,y:r,timestamp:s}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:r,timestamp:s}];return!1}}var In="$copy_autocapture",Fn=we("[AutoCapture]");function Ln(t,e){return e.length>t?e.slice(0,t)+"...":e}function wm(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Zt(e));return e}function Em(t,e){var r,s,{e:i,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsC
75hainAsString:l,disableCaptureUrlHashes:u}=e;if(!Zt(t))return{props:{}};for(var d=[t],h=t;h.parentNode&&!We(h,"body");)if(rd(h.parentNode))d.push(h.parentNode.host),h=h.parentNode.host;else{if(!Zt(h.parentNode))break;d.push(h.parentNode),h=h.parentNode}var f,p,m=[],g={},v=!1,y=!1;if(he(d,L=>{var P=Na(L);if(We(L,"a")){var C=L.getAttribute("href");v=!!(P&&C&&As(C))&&(u?Xt(C):C)}B(Bi(L),"ph-no-capture")&&(y=!0),m.push(function(A,M,O,H,V){V===void 0&&(V=!1);var re=A.tagName.toLowerCase(),X={tag_name:re};oo.indexOf(re)>-1&&!O&&(X.$el_text=re.toLowerCase()==="a"||re.toLowerCase()==="button"?Ln(1024,hl(A)):Ln(1024,Us(A)));var K=Bi(A);K.length>0&&(X.classes=K.filter(function(te){return te!==""})),he(A.attributes,function(te){var Q;if((!od(A)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(H==null||!H.includes(te.name))&&!M&&As(te.value)&&(!ce(Q=te.name)||Q.substring(0,10)!=="_ngcontent"&&Q.substring(0,7)!=="_nghost")){var q=te.value;te.name==="class"&&(q=ao(q).join(" ")),X["attr__"+te.name]=Ln(1024,te.name==="href"&&V?Xt(q):q)}});for(var _e=1,z=1,ae=A;ae=wm(ae);)_e++,ae.tagName===A.tagName&&z++;return X.nth_child=_e,X.nth_of_type=z,X}(L,n,a,o,u));var k=function(A){if(!Na(A))return{};var M={};return he(A.attributes,function(O){if(O.name&&O.name.indexOf("data-ph-capture-attribute")===0){var H=O.name.replace("data-ph-capture-attribute-",""),V=O.value;H&&V&&As(V)&&(M[H]=V)}}),M}(L);fe(g,k)}),y)return{props:{},explicitNoCapture:y};if(a||(m[0].$el_text=We(t,"a")||We(t,"button")?hl(t):Us(t)),v){var w,x;m[0].attr__href=v;var E=(w=Vs(v))==null?void 0:w.host,j=b==null||(x=b.location)==null?void 0:x.host;E&&j&&E!==j&&(f=v)}return{props:fe({$event_type:i.type,$ce_version:1},l?{}:{$elements:m},{$elements_chain:(p=m,function(L){return L.map(P=>{var C,k,A="";if(P.tag_name&&(A+=P.tag_name),P.attr_class)for(var M of(P.attr_class.sort(),P.attr_class))A+="."+M.replace(/"/g,"");var O=T({},P.text?{text:P.text}:{},{"nth-child":(C=P.nth_child)!==null&&C!==void 0?C:0,"nth-of-type":(k=P.nth_of_type)!==null&&k!==void 0?k:0},P.href?{href:P.href}:{},P.attr_id?{attr_id:P.attr_id}:{},P.attributes),H={};return mi(O).sort((V,re)=>{var[X]=V,[K]=re;return X.localeCompare(K)}).forEach(V=>{var[re,X]=V;return H[pl(re.toString())]=pl(X.toString())}),(A+=":")+mi(H).map(V=>{var[re,X]=V;return re+'="'+X+'"'}).join("")}).join(";")}(function(L){return L.map(P=>{var C,k,A={text:(C=P.$el_text)==null?void 0:C.slice(0,400),tag_name:P.tag_name,href:(k=P.attr__href)==null?void 0:k.slice(0,2048),attr_class:zv(P),attr_id:P.attr__id,nth_child:P.nth_child,nth_of_type:P.nth_of_type,attributes:{}};return mi(P).filter(M=>{var[O]=M;return O.indexOf("attr__")===0}).forEach(M=>{var[O,H]=M;return A.attributes[O]=H}),A})}(p)))},(r=m[0])!=null&&r.$el_text?{$el_text:(s=m[0])==null?void 0:s.$el_text}:{},f&&i.type==="click"?{$external_click_url:f}:{},g)}}var _s=we("[ExceptionAutocapture]"),Fl=()=>{},Sm=we("[TracingHeaders]"),nr=we("[Web Vitals]"),Ll=9e5,Ml="disabled",$l="lazy_loading",ys="awaiting_config",hi="missing_config";we("[SessionRecording]"),we("[SessionRecording]");var za="[SessionRecording]",kt=we(za),km=we("[Heatmaps]");function Dl(t){return ve(t)&&"clientX"in t&&"clientY"in t&&Ie(t.clientX)&&Ie(t.clientY)}var Mn=we("[Product Tours]"),$n=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(so))},Pm=["$set_once","$set"],pt=we("[SiteApps]"),zl="Error while initializing PostHog app with config id ";function Ar(t,e,r){if(Y(t))return!1;switch(r){case"exact":return t===e;case"contains":var s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class jm{constructor(e){this.sn=new ho,this.an=(r,s)=>this.ln(r,s)&&this.un(r,s)&&this.hn(r,s)&&this.dn(r,s),this.ln=(r,s)=>s==null||!s.event||(r==null?void 0:r.event)===(s==null?void 0:s.event),this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e,r;N((e=this._instance)==null?void 0:e._addCaptureHook)||(r=this._instance)==null||r._addCaptureHook((s,i)=>{this.on(s,i)})}register(e){var r,s;if(!N((r=this._instance)==null?void 0:r._addCaptureHook)&&(e.forEach(a=>{var o,l;(o=this.vn)==null||o.add(a),(l=a.steps)==null||l.forEach(u=>{var d;(d=this.cn)==null||d.add((u==null?void 0:u.event)||"")})}),(s=this._instance)!=null&&s.autocapture)){var i,n=new Set;e.forEach(a=>{var o;(o=a.steps)==null||o.forEach(l=>{l!=null&&l.selector&&n.add(l==null?void 0:l.selector)})}),(i=this._instance)==null||i.autocapture.setElementSelectors(n)}}on(e,r){var s;r!=null&&e.length!=0&&(this.cn.has(e)||this.cn.has(r==null?void 0:r.event))&&this.vn&&((s=this.vn)==null?void 0:s.size)>
vendor: 4,186 bytes, line 75
750&&this.vn.forEach(i=>{this.fn(r,i)&&this.sn.emit("actionCaptured",i.name)})}pn(e){this.onAction("actionCaptured",r=>e(r))}fn(e,r){if((r==null?void 0:r.steps)==null)return!1;for(var s of r.steps)if(this.an(e,s))return!0;return!1}onAction(e,r){return this.sn.on(e,r)}un(e,r){if(r!=null&&r.url){var s,i=e==null||(s=e.properties)==null?void 0:s.$current_url;if(!i||typeof i!="string"||!Ar(i,r.url,r.url_matching||"contains"))return!1}return!0}hn(e,r){return!!this.gn(e,r)&&!!this.mn(e,r)&&!!this.yn(e,r)}gn(e,r){var s;if(r==null||!r.href)return!0;var i=this.bn(e);if(i.length>0)return i.some(o=>Ar(o.href,r.href,r.href_matching||"exact"));var n,a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!a&&Ar((n=a.match(/(?::|")href="(.*?)"/))?n[1]:"",r.href,r.href_matching||"exact")}mn(e,r){var s;if(r==null||!r.text)return!0;var i=this.bn(e);if(i.length>0)return i.some(u=>Ar(u.text,r.text,r.text_matching||"exact")||Ar(u.$el_text,r.text,r.text_matching||"exact"));var n,a,o,l=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!l&&(n=function(u){for(var d,h=[],f=/(?::|")text="(.*?)"/g;!Y(d=f.exec(u));)h.includes(d[1])||h.push(d[1]);return h}(l),a=r.text,o=r.text_matching||"exact",n.some(u=>Ar(u,a,o)))}yn(e,r){var s,i;if(r==null||!r.selector)return!0;var n=e==null||(s=e.properties)==null?void 0:s.$element_selectors;if(n!=null&&n.includes(r.selector))return!0;var a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(r.selector_regex&&a)try{return new RegExp(r.selector_regex).test(a)}catch{return!1}return!1}bn(e){var r;return(e==null||(r=e.properties)==null?void 0:r.$elements)==null?[]:e==null?void 0:e.properties.$elements}dn(e,r){return r==null||!r.properties||r.properties.length===0||Id(r.properties.reduce((s,i)=>{var n=Z(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return s[i.key]={values:n,operator:i.operator||"exact"},s},{}),e==null?void 0:e.properties)}}class Cm{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,r){return!!e&&Id(e.propertyFilters,r==null?void 0:r.properties)}Cn(e,r){var s=new Map;return e.forEach(i=>{var n;(n=i.conditions)==null||(n=n[r])==null||(n=n.values)==null||n.forEach(a=>{if(a!=null&&a.name){var o=s.get(a.name)||[];o.push(i.id),s.set(a.name,o)}})}),s}In(e,r,s){var i=(s===hs.Activation?this.wn:this.xn).get(e),n=[];return this.Tn(a=>{n=a.filter(o=>i==null?void 0:i.includes(o.id))}),n.filter(a=>{var o,l=(o=a.conditions)==null||(o=o[s])==null||(o=o.values)==null?void 0:o.find(u=>u.name===e);return this.Sn(l,r)})}register(e){var r;N((r=this._instance)==null?void 0:r._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(e){var r=e.filter(s=>{var i,n;return((i=s.conditions)==null?void 0:i.actions)&&((n=s.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0});r.length!==0&&(this.Pn==null&&(this.Pn=new jm(this._instance),this.Pn.init(),this.Pn.pn(s=>{this.onAction(s)})),r.forEach(s=>{var i,n,a,o,l;s.conditions&&(i=s.conditions)!=null&&i.actions&&(n=s.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=s.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.Pn)==null||o.register(s.conditions.actions.values),(l=s.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var d=this.kn.get(u.name);d&&d.push(s.id),this.kn.set(u.name,d||[s.id])}}))}))}En(e){var r,s=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}),i=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.cancelEvents)&&((o=n.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0});s.length===0&&i.length===0||((r=this._instance)==null||r._addCaptureHook((n,a)=>{this.onEvent(n,a)}),this.wn=this.Cn(e,hs.Activation),this.xn=this.Cn(e,hs.Cancellation))}onEvent(e,r){var s,i,n=this.Rn(),a=(r==null||(s=r.properties)==null?void 0:s.$survey_id)||(r==null||(i=r.properties)==null?void 0:i.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.On(e,a);if(o==="consume")return n.info("event consumed activated item, remov
75ing it",{event:e,itemId:a}),void this.Ln([a]);if(o==="persist")return n.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.Fn(a)}if(this.xn.has(e)){var l=this.In(e,r,hs.Cancellation);l.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:l.map(d=>d.id)}),this.Ln(l.map(d=>d.id)),l.forEach(d=>this.An(d.id)))}if(this.wn.has(e)){n.info("event name matched",{event:e,eventPayload:r,items:this.wn.get(e)});var u=this.In(e,r,hs.Activation);this.$n(u.map(d=>d.id))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){e.length!==0&&(this._n=[...new Set([...this._n,...e])],this.Rn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter(s=>s!==e);var r=this.Dn();r.includes(e)||this.Nn([...r,e])}Ln(e){var r=new Set(e);this._n=this._n.filter(n=>!r.has(n));var s=this.Dn(),i=s.filter(n=>!r.has(n));i.length!==s.length&&this.Nn(i)}Dn(){var e,r=this.qn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[r])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter(e=>!this.Bn(e))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}jn(){return this.Pn}}class Tm extends Cm{constructor(e){super(e)}qn(){return xa}Hn(){return It.SHOWN}Tn(e){var r;(r=this._instance)==null||r.getSurveys(e)}An(e){var r;(r=this._instance)==null||r.cancelPendingSurvey(e)}Rn(){return le}Nn(e){var r;(r=this._instance)==null||(r=r.persistence)==null||r.register({[xa]:e})}Bn(){return!1}On(e,r){var s;this.Tn(n=>{s=n.find(a=>a.id===r)});var i=!s||function(n){var a,o,l,u=((a=(o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)!==null&&a!==void 0?a:0)>0;return n.schedule===Jv.Always||!((l=n.conditions)==null||(l=l.events)==null||!l.repeatedActivation||!u)}(s);return i?e===It.SHOWN?"consume":"ignore":e===It.SHOWN?"persist":e===It.DISMISSED||e===It.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Dn="SDK is not enabled or survey functionality is not yet loaded",Bl="Disabled. Not loading surveys.",Rm=b!=null&&b.location?Ui(b.location.hash,"__posthog")||Ui(location.hash,"state"):null,Ul="_postHogToolbarParams",Vl=we("[Toolbar]"),je=we("[FeatureFlags]"),ar=we("[FeatureFlags]",{debugEnabled:!0}),zn=`" failed. Feature flags didn't load in time.`,ql=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},Hl=t=>{var e={};for(var[r,s]of mi(t||{}))s&&(e[r]=s);return e},Pt=we("[Error tracking]"),Gl="Refusing to render web experiment since the viewer is a likely bot",Nm={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Hi(e,t),not_regex:(t,e)=>!Hi(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Me{get Se(){return this._instance.config}constructor(e){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(s){s===void 0&&(s=!1),r.getWebExperiments(i=>{Me.Un("retrieved web experiments from the server"),r.zn=new Map,i.forEach(n=>{if(n.feature_flag_key){var a;r.zn&&(Me.Un("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=r.zn)==null||a.set(n.feature_flag_key,n));var o=r._instance.getFeatureFlag(n.feature_flag_key);ce(o)&&n.variants[o]&&r.Vn(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var u=n.variants[l];Me.Wn(u,r._instance)&&r.Vn(n.name,l,u.transforms)}})},s)},this._instance=e,this._instance.onFeatureFlags(s=>{this.onFeatureFlags(s)})}initialize(){}onFeatureFlags(e){if(this._is_bot())Me.Un(Gl);else if(!this.Se.disable_web_experiments){if(Y(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Me.Un("applying feature flags",e),e.forEach(r=>{var s;if(this.zn&&(s=this.zn)!=null&&s.has(r)){var i,n=this._instance.getFeatureFlag(r),a=(i=this.zn)==null?void 0:i.get(r);n&&a!=null&&a.variants[n]&&this.Vn(a.name,n,a.variants[n].transforms)}})}}previewWebExperiment(){var e=Me.getWindowLocation();if(e!=null&&e.search){var r=Zr(e==null?void 0:e.search,"__experiment_id"),s=Zr(e==null?void 0:e.search,"__experiment_variant");r&&s&&(Me.Un("previewing web experiments "+r+" && "+s),this.getWebExperiments(i=>{this.Gn(parseInt(r),s,i)},!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,r,s){if(this.Se.disable_web_experiments&&!s)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!r)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Se.token),method:"GET",callback:n=>e(n.statusCode===200&&n.json&&n.json.experiments||[])})}Gn(e,r,s){var i=s.filter(n=>n.id===e);i&&i.length>0&&(Me.Un("Previewing web experiment ["+i[0].name+"] with variant ["+r+"]"),this.Vn(i[0].name,r,i[0].variants[r].transforms))}static Wn(e,r){return!Y(e.conditions)&&Me.Zn(e,r)&&Me.Qn(e)}static Zn(e,r){var s;if(Y(e.conditions)||Y((s=e.conditions)==null?void 0:s.url))return!0;var i=Me.getWindowLocation();if(i){var n,a,o,l=ed(r,i.href);return(n=e.conditions)==null||!n.url||Nm[(a=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,l)}return!1}
75static getWindowLocation(){return b==null?void 0:b.location}static Qn(e){var r;if(Y(e.conditions)||Y((r=e.conditions)==null?void 0:r.utm))return!0;var s=gd();if(s.utm_source){var i,n,a,o,l,u,d,h,f=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==s.utm_campaign,p=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==s.utm_source,m=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==s.utm_medium,g=(d=e.conditions)==null||(d=d.utm)==null||!d.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==s.utm_term;return f&&m&&g&&p}return!1}static Un(e){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;r>i;i++)s[i-1]=arguments[i];R.info("[WebExperiments] "+e,s)}Vn(e,r,s){this._is_bot()?Me.Un(Gl):r!=="control"?s.forEach(i=>{if(i.selector){var n;Me.Un("applying transform of variant "+r+" for experiment "+e+" ",i);var a=(n=document)==null?void 0:n.querySelectorAll(i.selector);a==null||a.forEach(o=>{var l=o;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)})}}):Me.Un("Control variants leave the page unmodified.")}_is_bot(){return Ue&&this._instance?Nd(Ue,this.Se.custom_blocked_useragents):void 0}}var Je=we("[Conversations]"),or="Conversations not available yet.",Wl="console",tn={featureFlags:class{constructor(t){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=0,this.os=()=>{var e=this.ls();this.ss=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],b&&xe(b,"online",this.os)}destroy(){b==null||b.removeEventListener("online",this.os)}get Se(){return this._instance.config}get zr(){return this._instance.persistence}us(t){return this._instance.get_property(t)}hs(){var t,e;return(t=(e=this.zr)==null?void 0:e.Gt(this.Se.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}ds(){return!!this.hs()&&(this.ns||this.Kn||(this.ns=!0,je.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}cs(){var t,e=(t=this.Se.evaluation_contexts)!==null&&t!==void 0?t:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(je.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.rs=!0),e!=null&&e.length?e.filter(r=>{var s=r&&typeof r=="string"&&r.trim().length>0;return s||je.error("Invalid evaluation context found:",r,"Expected non-empty string"),s}):[]}vs(){return this.cs().length>0}fs(){var t=this.Se.flag_keys;if(!N(t)){if(Z(t))return t.filter(e=>{var r=e&&typeof e=="string"&&e.trim().length>0;return r||je.error("Invalid flag key found:",e,"Expected non-empty string"),r});je.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,{config:r}=this._instance,s=(t=(e=r.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(s).length){var i,n,a=(i=(n=r.bootstrap)==null?void 0:n.featureFlagPayloads)!==null&&i!==void 0?i:{},o=Object.keys(s).filter(u=>!!s[u]).reduce((u,d)=>(u[d]=s[d]||!1,u),{}),l=Object.keys(a).filter(u=>o[u]).reduce((u,d)=>(a[d]&&(u[d]=a[d]),u),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,r){var s,i,n=r!=null&&r.merge&&(s=this.us(hr))!==null&&s!==void 0?s:{},a=r!=null&&r.merge&&(i=this.us(vi))!==null&&i!==void 0?i:{},o=T({},n,t),l=T({},a,e),u={};for(var[d,h]of Object.entries(o))u[d]={key:d,enabled:Go(h),variant:Wo(h),reason:void 0,metadata:N(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}};this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.us(_a),e=this.us(Tt),r=this.us(Or);if(!r&&!e)return t||{};var s=fe({},t||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var n of i){var a,o,l=s[n],u=e==null?void 0:e[n],d=N(u)?(a=l==null?void 0:l.enabled)!==null&&a!==void 0&&a:!!u,h=N(u)?l.variant:typeof u=="string"?u:void 0,f=r==null?void 0:r[n],p=T({},l,{enabled:d,variant:d?h??(l==null?void 0:l.variant):void 0});d!==(l==null?void 0:l.enabled)&&(p.original_enabled=l==null?void 0:l.enabled),h!==(l==null?void 0:l.variant)&&(p.original_variant=l==null?void 0:l.variant),f&&(p.metadata=T({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(o=l.metadata)==null?void 0:o.payload})),s[n]=p}return this.Jn||(je.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:s}),this.Jn=!0),s}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(r=>{var s=t[r];return{key:r,enabled:Go(s),variant:Wo(s),payload:Ho(e[r])}})}getFlagVariants(){var t=this.us(hr),e=this.us(Tt);if(!e)return t||{};for(var r=fe({},t),s=Object.keys(e),i=0;s.length>i;i++)r[s[i]]=e[s[i]];return this.Jn||(je.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Jn=!0),r}getFlagPayloads(){var t=this.us(vi),e=this.us(Or);if(!e)return t||{};for(var r=fe({},t||{}),s=Object.keys(e),i=0;s.length>i;i++)r[s[i]]=e[s[i]];return this.Jn||(je.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Jn=!0),r}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.ls()||this.ps||(this._instance.Ti.emit("featureFlagsReloading",!0),this.ps=setTimeout(()=>{this.gs()},5))}ys(){clearTimeout(this.ps),this.ps=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.ps||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Xn=t}gs(t){var e;if(this.ys(),!this._instance.mr()&&!this.ls())if(this.Kn)this.es=!0;else{var r=this.Se.token,s=this.us(Ii),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:T({},((e=this.zr)==null?void 0:e.get_initial_props())||{},this.us(lr)||{}),group_properties:this.us(cr),timezone:xd()};Ve(s)||N(s)||(i.$device_id=s),(t!=null&&t.disableFlags||this.Se.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.vs()&&(i.evaluation_contexts=this.cs());var n=this.fs();N(n)||(i.flag_keys=n);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Kn=!0,this._instance._send_request({method:"POST",url:o,data:i,compression:this.Se.disable_compression?void 0:Ze.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:l=>{var u,d,h,f=!0;if(this.bs(l.statusCode),l.statusCode===200&&(this.es||(this.$anon_distinct_id=void 0),f=!1),this.Kn=!1,!i.disable_flags||this.es){this.ts=!f;var p=[];l.error?l.error instanceof Error?p.push(l.error.name==="AbortError"?"timeout":"connection_error"):p.push("unknown_error"):l.statusCode!==200&&p.push("api_error_"+l.statusCode),(u=l.json)!=null&&u.errorsWhileComputingFlags&&p.push("errors_while_computing_flags");var m,g=!((d=l.json)==null||(d=d.quotaLimited)==null||!d.includes("feature_flags"));g&&p.push("quota_limited"),(h=this.zr)==null||h.register({[Ea]:p}),g?je.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."):(i.disable_flags||this.receivedFeatureFlags((m=l.json)!==null&&m!==void 0?m:{},f,{partialResponse:a}),this.es&&(this.es=!1,this.gs()))}}})}}ls(){return pd(this.ss,3)}bs(t){this.ss=fd(t,this.ss,3,()=>je.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 r;if(e===void 0&&(e={}),!e.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){var s=this.getFeatureFlagResult(t,e);return(r=s==null?void 0:s.variant)!==null&&r!==void 0?r:s==null?void 0:s.enabled}}else je.warn('getFeatureFlag for key "'+t+zn)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){var r=this.getFlagVariants(),s=t in r,i=r[t],n=this.getFlagPayloads()[t],a=String(i),o=this.us(ya)||void 0,l=this.us(Bs)||void 0,u=this.us(Ns)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var d,h=this._instance.get_session_id(),f=this.us(wa);h&&h!==f&&(u={},(d=this.zr)==null||d.register({[Ns]:u,[wa]:h}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(a))){var p,m,g,v,y,w,x,E,j,L;Z(u[t])?u[t].push(a):u[t]=[a],(p=this.zr)==null||p.register({[Ns]:u});var P=this.getFeatureFlagDetails(t),C=[...(m=this.us(Ea))!==null&&m!==void 0?m:[]];N(i)&&C.push("flag_missing");var k={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((g=this.Se.bootstrap)==null||(g=g.featureFlags)==null?void 0:g[t])||null,$feature_flag_bootstrapped_payload:((v=this.Se.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[t])||null,$used_bootstrap_value:!this.ts};N(P==null||(y=P.metadata)==null?void 0:y.version)||(k.$feature_flag_version=P.metadata.version);var A,M=(w=P==null||(x=P.reason)==null?void 0:x.description)!==null&&w!==void 0?w:P==null||(E=P.reason)==null?void 0:E.
75code;M&&(k.$feature_flag_reason=M),P!=null&&(j=P.metadata)!=null&&j.id&&(k.$feature_flag_id=P.metadata.id),N(P==null?void 0:P.original_variant)&&N(P==null?void 0:P.original_enabled)||(k.$feature_flag_original_response=N(P.original_variant)?P.original_enabled:P.original_variant),P!=null&&(L=P.metadata)!=null&&L.original_payload&&(k.$feature_flag_original_payload=P==null||(A=P.metadata)==null?void 0:A.original_payload),C.length&&(k.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",k)}if(s)return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:Ho(n)}}}else je.warn('getFeatureFlagResult for key "'+t+zn)}getRemoteConfigPayload(t,e){var r=this.Se.token,s={distinct_id:this._instance.get_distinct_id(),token:r};this.vs()&&(s.evaluation_contexts=this.cs());var i=this.fs();N(i)||(s.flag_keys=i),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.Se.disable_compression?void 0:Ze.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(n){var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;e((o==null?void 0:o[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return N(r)?void 0:!!r}je.warn('isFeatureEnabled for key "'+t+zn)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,r){if(this.zr){this.Yn=!0;var s=this.getFlagVariants(),i=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,u,d,h){l===void 0&&(l={}),u===void 0&&(u={}),d===void 0&&(d={});var f=(C=>{var k=C.flags;return k?(C.featureFlags=Object.fromEntries(Object.keys(k).map(A=>{var M;return[A,(M=k[A].variant)!==null&&M!==void 0?M:k[A].enabled]})),C.featureFlagPayloads=Object.fromEntries(Object.keys(k).filter(A=>k[A].enabled).filter(A=>{var M;return(M=k[A].metadata)==null?void 0:M.payload}).map(A=>{var M;return[A,(M=k[A].metadata)==null?void 0:M.payload]}))):C.featureFlags&&je.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(a),p=f.flags,m=f.featureFlags,g=f.featureFlagPayloads;if(m){var v=a.requestId,y=a.evaluatedAt;if(Z(m)){je.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var w={};if(m)for(var x=0;m.length>x;x++)w[m[x]]=!0;o&&o.register({[gi]:m,[hr]:w})}else{var E=m,j=g,L=p;if(h!=null&&h.partialResponse)E=T({},l,E),j=T({},u,j),L=T({},d,L);else if(a.errorsWhileComputingFlags)if(p){var P=new Set(Object.keys(p).filter(C=>{var k;return!((k=p[C])!=null&&k.failed)}));E=T({},l,Object.fromEntries(Object.entries(E).filter(C=>{var[k]=C;return P.has(k)}))),j=T({},u,Object.fromEntries(Object.entries(j||{}).filter(C=>{var[k]=C;return P.has(k)}))),L=T({},d,Object.fromEntries(Object.entries(L||{}).filter(C=>{var[k]=C;return P.has(k)})))}else E=T({},l,E),j=T({},u,j),L=T({},d,L);o&&o.register(T({[gi]:Object.keys(Hl(E)),[hr]:E||{},[vi]:j||{},[_a]:L||{}},v?{[ya]:v}:{},y?{[Bs]:y}:{}))}}})(t,this.zr,s,i,n,r),e||(this.ns=!1),this._s(e)}}override(t,e){e===void 0&&(e=!1),je.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.zr)return je.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.zr.unregister(Tt),this.zr.unregister(Or),this._s(),ar.info("All overrides cleared");if(Z(t)){var e=ql(t);return this.zr.register({[Tt]:e}),this._s(),ar.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var r,s=t;if(this.Jn=!!((r=s.suppressWarning)!==null&&r!==void 0&&r),"flags"in s){if(s.flags===!1)this.zr.unregister(Tt),ar.info("Flag overrides cleared");else if(s.flags){if(Z(s.flags)){var i=ql(s.flags);this.zr.register({[Tt]:i})}else this.zr.register({[Tt]:s.flags});ar.info("Flag overrides set",{flags:s.flags})}}
75return"payloads"in s&&(s.payloads===!1?(this.zr.unregister(Or),ar.info("Payload overrides cleared")):s.payloads&&(this.zr.register({[Or]:s.payloads}),ar.info("Payload overrides set",{payloads:s.payloads}))),void this._s()}if(t&&typeof t=="object")return this.zr.register({[Tt]:t}),this._s(),ar.info("Flag overrides set",{flags:t});je.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Yn){var{flags:e,flagVariants:r}=this.ws();try{t(e,r)}catch(s){je.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var s,i=(this.us(Ss)||[]).find(l=>l.flagKey===t),n={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:n};i&&(a.$early_access_feature_name=i.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=T({},this.getFlagVariants(),{[t]:e});(s=this.zr)==null||s.register({[gi]:Object.keys(Hl(o)),[hr]:o}),this._s()}getEarlyAccessFeatures(t,e,r){e===void 0&&(e=!1);var s=this.us(Ss),i=r?"&"+r.map(n=>"stage="+n).join("&"):"";if(s&&!e)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+i),method:"GET",callback:n=>{var a,o;if(n.json){var l=n.json.earlyAccessFeatures;return(a=this.zr)==null||a.unregister(Ss),(o=this.zr)==null||o.register({[Ss]:l}),t(l)}}})}ws(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(r=>e[r]),flagVariants:Object.keys(e).filter(r=>e[r]).reduce((r,s)=>(r[s]=e[s],r),{})}}_s(t){var{flags:e,flagVariants:r}=this.ws();this.featureFlagEventHandlers.forEach(s=>{try{s(e,r,{errorsLoading:t})}catch(i){je.error("Error while running feature flags callback",i)}})}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this.us(lr)||{},s=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),i=t==null?void 0:t.$set_once,n={};if(i)for(var a in i)({}).hasOwnProperty.call(i,a)&&(a in r||(n[a]=i[a]));this._instance.register({[lr]:T({},r,n,s)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=T({},this.us(lr)||{});t.forEach(s=>{delete r[s]}),this._instance.register({[lr]:r}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(lr),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this.us(cr)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(s=>{r[s]=T({},r[s],t[s]),delete t[s]}),this._instance.register({[cr]:T({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.us(cr)||{};this._instance.register({[cr]:T({},e,{[t]:{}})})}else this._instance.unregister(cr)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.ys(),this.Jn=!1,this.ss=0}}},Am={sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var t;return!((t=this.xs)==null||!t.isStarted)}get status(){var t,e;return this.ks===ys||this.ks===hi?this.ks:(t=(e=this.xs)==null?void 0:e.status)!==null&&t!==void 0?t:this.ks}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.ks=Ml,this.Ss=void 0,this._instance=t,!this._instance.sessionManager)throw kt.error("started without valid sessionManager"),new Error(za+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===Ot)throw new Error(za+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Cs(){var t,e=!((t=this._instance.get_property(pr))==null||!t.enabled),r=!this.Se.disable_session_recording,s=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return b&&e&&r&&!s}startIfEnabledOrStop(t){var e;if(!this.Cs||(e=this.xs)==null||!e.isStarted){var r=!N(Object.assign)&&!N(Array.from);this.Cs&&r?(this.Is(t),kt.info("starting")):(this.ks=Ml,this.stopRecording())}}Is(t){var e,r,s;this.Cs&&(this.ks!==ys&&this.ks!==hi&&(this.ks=$l),$!=null&&(e=$.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(r=$.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Ts(t):(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.Es,i=>
75{if(i)return kt.error("could not load recorder",i);this.Ts(t)}))}stopRecording(){var t,e;(t=this.Ss)==null||t.call(this),this.Ss=void 0,(e=this.xs)==null||e.stop()}Ms(){var t,e;(t=this.Ss)==null||t.call(this),this.Ss=void 0,(e=this.xs)==null||e.discard()}Ps(){var t,e;(t=this.zr)==null||t.unregister(io),(e=this.zr)==null||e.unregister(Vu)}Rs(t,e){if(Y(t))return null;var r,s=Ie(t)?t:parseFloat(t);return typeof(r=s)!="number"||!Number.isFinite(r)||0>r||r>1?(kt.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):s}Os(t){if(this.zr){var e,r,s=this.zr,i=()=>{var n,a=t.sessionRecording===!1?void 0:t.sessionRecording,o=this.Rs((n=this.Se.session_recording)==null?void 0:n.sampleRate,"session_recording.sampleRate"),l=this.Rs(a==null?void 0:a.sampleRate,"remote config sampleRate"),u=o??l;Y(u)&&this.Ps();var d=a==null?void 0:a.minimumDurationMilliseconds;s.register({[pr]:T({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:T({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:u,minimumDurationMilliseconds:N(d)?null:d,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};i(),(e=this.Ss)==null||e.call(this),this.Ss=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(i)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.Os(t),void this.Ms()):(this.Os(t),void this.startIfEnabledOrStop()):(this.ks===ys&&(this.ks=hi,kt.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;e===void 0&&(e="log"),(r=this.xs)!=null&&r.log?this.xs.log(t,e):kt.warn("log called before recorder was ready")}get Es(){var t,e,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(pr);return(r==null||(e=r.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Ls(){var t,e,r=this._instance.get_property(pr);if(!r)return!1;try{e=typeof r=="object"?r:JSON.parse(r)}catch(i){return kt.warn("persisted remote config for session recording is invalid and will be ignored",i),!1}var s=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-s}Ts(t){var e,r;if((e=$.__PosthogExtensions__)==null||!e.initSessionRecording)return kt.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ju]:!0});if(this.xs||(this.xs=(r=$.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.xs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ls())return this.ks===hi||this.ks===ys?void 0:(this.ks=ys,kt.info("persisted remote config is stale, requesting fresh config before starting"),void new wd(this._instance).load());this.ks=$l,this.xs.start(t)}onRRwebEmit(t){var e;(e=this.xs)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.xs||(e=this.zr)==null||e.register({[Hu]:!0}),(t=this.xs)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.xs||(e=this.zr)==null||e.register({[qu]:!0}),(t=this.xs)==null||t.overrideSampling()}overrideTrigger(t){var e,r;this.xs||(r=this.zr)==null||r.register({[t==="url"?Gu:Wu]:!0}),(e=this.xs)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.xs)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!((r=this.xs)==null||!r.tryAddCustomEvent(t,e))}}},Om={autocapture:class{constructor(t){this.Fs=!1,this.As=null,this.$s=!1,this.instance=t,this.rageclicks=new Il(t.config.rageclick),this.Ds=null}initialize(){this.startIfEnabled()}get Se(){var t,e,r=ve(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)==null?void 0:t.map(s=>new RegExp(s)),r.url_ignorelist=(e=r.url_ignorelist)==null?void 0:e.map(s=>new RegExp(s)),r}
75Ns(){if(this.isBrowserSupported()){if(b&&I){var t=r=>{r=r||(b==null?void 0:b.event);try{this.qs(r)}catch(s){Fn.error("Failed to capture event",s)}};if(xe(I,"submit",t,{capture:!0}),xe(I,"change",t,{capture:!0}),xe(I,"click",t,{capture:!0}),this.Se.capture_copied_text){var e=r=>{r=r||(b==null?void 0:b.event);try{this.qs(r,In)}catch(s){Fn.error("Failed to capture copy/cut event",s)}};xe(I,"copy",e,{capture:!0}),xe(I,"cut",e,{capture:!0})}}}else Fn.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Fs&&(this.Ns(),this.Fs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.$s=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[da]:!!t.autocapture_opt_out}),this.As=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Ds=t}getElementSelectors(t){var e,r=[];return(e=this.Ds)==null||e.forEach(s=>{var i=I==null?void 0:I.querySelectorAll(s);i==null||i.forEach(n=>{t===n&&r.push(s)})}),r}get isEnabled(){var t,e,r=(t=this.instance.persistence)==null?void 0:t.props[da];if(Ve(this.As)&&!yt(r)&&!this.instance.mr())return!1;var s=(e=this.As)!==null&&e!==void 0?e:!!r;return!!this.instance.config.autocapture&&!s}qs(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var r,s=Pn(t);td(s)&&(s=s.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&dl(s,this.instance.config.rageclick)&&this.qs(t,"$rageclick");var i=e===In;if(s&&function(h,f,p,m,g,v){var y,w,x,E,j,L;if(p===void 0&&(p=void 0),!b||lo(h)||(y=p)!=null&&y.url_allowlist&&!ll(p.url_allowlist,v)||(w=p)!=null&&w.url_ignorelist&&ll(p.url_ignorelist,v))return!1;if((x=p)!=null&&x.dom_event_allowlist){var P=p.dom_event_allowlist;if(P&&!P.some(O=>f.type===O))return!1}var{parentIsUsefulElement:C,targetElementList:k}=ad(h,m);if(!function(O,H){var V=H==null?void 0:H.element_allowlist;if(N(V))return!0;var re,X=function(_e){if(V.some(z=>_e.tagName.toLowerCase()===z))return{v:!0}};for(var K of O)if(re=X(K))return re.v;return!1}(k,p)||!Ra(k,(E=p)==null?void 0:E.css_selector_allowlist)||Ra(k,(j=(L=p)==null?void 0:L.css_selector_ignorelist)!==null&&j!==void 0?j:Ov))return!1;try{var A=b.getComputedStyle(h);if(A&&A.getPropertyValue("cursor")==="pointer"&&f.type==="click")return!0}catch{}var M=h.tagName.toLowerCase();switch(M){case"html":return!1;case"form":return(g||["submit"]).indexOf(f.type)>=0;case"input":case"select":case"textarea":return(g||["change","click"]).indexOf(f.type)>=0;default:return C?(g||["click"]).indexOf(f.type)>=0:(g||["click"]).indexOf(f.type)>=0&&(oo.indexOf(M)>-1||h.getAttribute("contenteditable")==="true")}}(s,t,this.Se,i,i?["copy","cut"]:void 0,this.instance)){var{props:n,explicitNoCapture:a}=Em(s,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.$s,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(a)return!1;var o=this.getElementSelectors(s);if(o&&o.length>0&&(n.$element_selectors=o),e===In){var l,u=sd(b==null||(l=b.getSelection())==null?void 0:l.toString()),d=t.type||"clipboard";if(!u)return!1;n.$selected_content=u,n.$copy_type=d}return this.instance.capture(e,n),!0}}}isBrowserSupported(){return ht(I==null?void 0:I.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Bs=(b==null||(e=b.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(R.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.js&&this.js(),this.js=void 0,R.info("History API monitoring stopped")}monitorHistoryChanges(){b&&b.history&&(this.Hs("pushState"),this.Hs("replaceState"),this.Us())}Hs(t){var e;if(b&&((e=b.history[t])==null||!e.__posthog_wrapped__)){var r=this;(function(s,i,n){try{if(!(i in s))return Fl;var a={next:s[i]},o=n(function(){for(var l=arguments.length,u=new Array(l),d=0;l>d;d++)u[d]=arguments[d];return a.next.apply(this,u)});
75return ht(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),s[i]=o,()=>{if(s[i]!==o)for(var l=s[i];ht(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===o)return void(u.next=a.next);l=u.next}else s[i]=a.next}}catch{return Fl}})(b.history,t,s=>function(i,n,a){s.call(this,i,n,a),r.zs(t)})}}zs(t){try{var e,r=b==null||(e=b.location)==null?void 0:e.pathname;if(!r)return;r!==this.Bs&&this.isEnabled&&this._instance.capture(Ir,{navigation_type:t}),this.Bs=r}catch(s){R.error("Error capturing "+t+" pageview",s)}}Us(){if(!this.js){var t=()=>{this.zs("popstate")};xe(b,"popstate",t),this.js=()=>{b&&b.removeEventListener("popstate",t)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(t){var e;this.Vs=!1,this.Fs=!1,this.Ws=null,this.instance=t,this.Vs=!((e=this.instance.persistence)==null||!e.props[ha]),this.rageclicks=new Il(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return ve(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(t=this.Se.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Y(this.Se.capture_heatmaps)?Y(this.Se.enable_heatmaps)?this.Vs:this.Se.enable_heatmaps:this.Se.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Fs)return;km.info("starting..."),this.Gs(),this.ke()}else{var t;clearInterval((t=this.Ws)!==null&&t!==void 0?t:void 0),this.Zs(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ha]:e}),this.Vs=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Qs(t){this.fe(t.originalEvent,"deadclick")}ke(){this.Ws&&clearInterval(this.Ws),this.Ws=(I==null?void 0:I.visibilityState)==="visible"?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Gs(){b&&I&&(this.Js=this.Lr.bind(this),xe(b,Di,this.Js),this.Ys=t=>this.fe(t||(b==null?void 0:b.event)),xe(I,"click",this.Ys,{capture:!0}),this.Ks=t=>this.Xs(t||(b==null?void 0:b.event)),xe(I,"mousemove",this.Ks,{capture:!0}),this.eo=new fl(this.instance,Bv,this.Qs.bind(this)),this.eo.startIfEnabledOrStop(),this.ro=this.ke.bind(this),xe(I,$i,this.ro),this.Fs=!0)}Zs(){var t;b&&I&&(this.Js&&b.removeEventListener(Di,this.Js),this.Ys&&I.removeEventListener("click",this.Ys,{capture:!0}),this.Ks&&I.removeEventListener("mousemove",this.Ks,{capture:!0}),this.ro&&I.removeEventListener($i,this.ro),clearTimeout(this.io),(t=this.eo)==null||t.stop(),this.Fs=!1)}no(t,e){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),n=function(a,o,l){for(var u=a;u&&Zt(u)&&!We(u,"body");){if(u===l)return!1;var d=void 0;try{var h,f,p;d=(h=(f=(p=u.ownerDocument)==null?void 0:p.defaultView)!==null&&f!==void 0?f:b)==null?void 0:h.getComputedStyle(u).position}catch{return!1}if(B(o,d))return!0;u=id(u)}return!1}(Pn(t),["fixed","sticky"],i);return{x:t.clientX+(n?0:s),y:t.clientY+(n?0:r),target_fixed:n,type:e}}fe(t,e){var r;if(e===void 0&&(e="click"),!ol(t.target)&&Dl(t)){var s=this.no(t,e);(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&dl(Pn(t),this.instance.config.rageclick)&&this.so(T({},s,{type:"rageclick"})),this.so(s)}}Xs(t){!ol(t.target)&&Dl(t)&&(clearTimeout(this.io),this.io=setTimeout(()=>{this.so(this.no(t,"mousemove"))},500))}so(t){if(b){var e=this.Se.disable_capture_url_hashes?Xt(b.location.href):b.location.href,r=this.Se.custom_personal_data_properties,s=this.Se.mask_personal_data_properties?[...es,...r||[]]:[],i=qs(e,s,Hs);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(t)}}Lr(){this.R&&!Qt(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:fl,webVitalsAutocapture:class{constructor(t){var e;this.Vs=!1,this.Fs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.oo=()=>{clearTimeout(this.ao),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((r,s)=>T({},r,{["$web_vitals_"+s.name+"_event"]:T({},s),["$web_vitals_"+s.name+"_value"]:s.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lo=r=>{var s;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.uo();if(!N(i))if(Y(r==null?void 0:r.name)||Y(r==null?void 0:r.value))nr.error("Invalid metric received",r);else if(!this.ho||this.ho>r.value){this.R.url!==i&&(this.oo(),this.ao=setTimeout(this.oo,this.flushToCaptureTimeoutMs)),N(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=N(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0);var n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0),a=T({},r,{$current_url:i,timestamp:Date.now()});N(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.oo()}else nr.error("Ignoring metric with value >= "+this.ho,r)},this.do=()=>
75{if(!this.Fs){var r,s,i,n,a=$.__PosthogExtensions__;N(a)||N(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:s,onFCP:i,onINP:n}=a.postHogWebVitalsCallbacks),r&&s&&i&&n?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.lo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.lo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.lo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.lo.bind(this)),this.Fs=!0):nr.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Vs=!((e=this._instance.persistence)==null||!e.props[va]),this.startIfEnabled()}get co(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=ve(this.co)?(t=this.co)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Y(r)?((e=this._instance.persistence)==null?void 0:e.props[ma])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ve(this.co)?this.co.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=ve(this.co)?this.co.web_vitals_attribution:void 0;return t!=null&&t}get ho(){var t=ve(this.co)&&Ie(this.co.__web_vitals_max_value)?this.co.__web_vitals_max_value:Ll;return t>0&&6e4>=t?Ll:t}get isEnabled(){var t=Pe==null?void 0:Pe.protocol;if(t!=="http:"&&t!=="https:")return nr.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ve(this.co)?this.co.web_vitals:yt(this.co)?this.co:void 0;return yt(e)?e:this.Vs}startIfEnabled(){this.isEnabled&&!this.Fs&&(nr.info("enabled, starting..."),this.Mt(this.do))}onRemoteConfig(t){if("capturePerformance"in t){var e=ve(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=ve(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[va]:e}),this._instance.persistence.register({[ma]:r})),this.Vs=e,this.startIfEnabled()}}Mt(t){var e,r;(e=$.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(r=$.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",s=>{s?nr.error("failed to load script",s):t()})}uo(){var t=b?this._instance.config.disable_capture_url_hashes?Xt(b.location.href):b.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...es,...e||[]]:[];return qs(t,r,Hs)}nr.error("Could not determine current URL")}}},Im={exceptionObserver:class{constructor(t){var e,r,s;this.do=()=>{var i;if(b&&this.isEnabled&&(i=$.__PosthogExtensions__)!=null&&i.errorWrappingFunctions){var n=$.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=$.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=$.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.vo&&this.Se.capture_unhandled_errors&&(this.vo=n(this.captureException.bind(this))),!this.fo&&this.Se.capture_unhandled_rejections&&(this.fo=a(this.captureException.bind(this))),!this.po&&this.Se.capture_console_errors&&(this.po=o(this.captureException.bind(this)))}catch(l){_s.error("failed to start",l),this.mo()}}},this._instance=t,this.yo=!((e=this._instance.persistence)==null||!e.props[pa]),this.bo=new Lg({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,Ae:_s}),this.Se=this._o(),this.startIfEnabledOrStop()}_o(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ve(t)?e=T({},e,t):(N(t)?this.yo:t)&&(e=T({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(_s.info("enabled"),this.mo(),this.Mt(this.do)):this.mo()}Mt(t){var e,r;(e=$.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(r=$.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",s=>{if(s)return _s.error("failed to load script",s);t()})}mo(){var t,e,r;(t=this.vo)==null||t.call(this),this.vo=void 0,(e=this.fo)==null||e.call(this),this.fo=void 0,(r=this.po)==null||r.call(this),this.po=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.yo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[pa]:this.yo}),this.Se=this._o(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this._o()}captureException(t){var e,r,s,i=(e=t==null||(r=t.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&e!==void 0?e:"Exception";this.bo.consumeRateLimit(i)?_s.info("Skipping exception capture because of client rate limiting.",{exception:i}):(s=this._instance.exceptions)==null||s.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.wo=[],this.xo=new Xg([new av,new gv,new lv,new ov,new pv,new hv,new uv,new fv],function(s){for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;i>a;a++)n[a-1]=arguments[a];return function(o,l){l===void 0&&(l=0);for(var u=[],d=o.split(` 76`),h=l;d.length>h;h++){var f=d[h];if(1024>=f.length){var p=sl.test(f)?f.replace(sl,"$1"):f;if(!p.match(/\S*Error: /)){for(var m of n){var g=m(p,s);if(g){u.push(g);break}}if(u.length>=50)break}}}return function(v){if(!v.length)return[];var y=Array.from(v);return y.reverse(),y.slice(0,50).map(w=>{return T({},w,{filename:w.filename||(x=y,x[x.length-1]||{}).filename,function:w.function||Xr});var x})}(u)}}("web:javascript",rv,nv)),this._instance=t,this.wo=(e=(r=this._instance.persistence)==null?void 0:r.get_property(fa))!==null&&e!==void 0?e:[],this.ko=Oi(this.So()),this.Co=new mv(this.ko)}onConfigChange(){this.ko=Oi(this.So()),this.Co.setConfig(this.ko)}onRemoteConfig(t){var e,r,s;if("errorTracking"in t){var i=(e=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&e!==void 0?e:[],n=(s=t.errorTracking)==null?void 0:s.captureExtensionExceptions;this.wo=i,this._instance.persistence&&this._instance.persistence.register({[fa]:this.wo,[ga]:n})}}get Io(){var t,e=!!this._instance.get_property(ga),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.xo.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.ko.enabled)try{if(!ce(t)||t.trim().length===0)return void Pt.warn("Ignoring exception step because message must be a non-empty string");var r=this.To(e),{sanitizedProperties:s,droppedKeys:i}=function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(n).reduce((o,l)=>vv.has(l)?(a.push(l),o):(o[l]=n[l],o),{}),droppedKeys:a}}(r);i.length>0&&Pt.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.Co.add(T({[Ni]:t,[Ai]:new Date().toISOString()}
76,s))}catch(n){Pt.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Eo(e)){if(this.Mo(e))return this.Po("Exception dropped: matched a suppression rule"),void Pt.info("Skipping exception capture because a suppression rule matched");if(!this.Io&&this.Ro(e))return this.Po("Exception dropped: thrown by a browser extension"),void Pt.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Oo(e))return this.Po("Exception dropped: thrown by the PostHog SDK"),void Pt.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ko.enabled&&Y(t.$exception_steps)?this.Lo(t):t;try{var s=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Zi:!0});return s&&this.Co.clear(),s}catch(i){return Pt.error("Failed to capture exception event. Dropping this exception.",i),void this.Co.clear()}}catch(i){return void Pt.error("Failed to process exception event. Ignoring this exception.",i)}}Lo(t){try{var e=this.Co.getAttachable();return e.length===0?t:T({},t,{$exception_steps:e})}catch(r){return Pt.error("Failed to read buffered exception steps. Capturing exception without steps.",r),t}}Po(t){this.ko.enabled&&this.Co.add({[Ni]:t,[Ai]:new Date().toISOString()})}To(t){return ve(t)?T({},t):{}}So(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Mo(t){if(t.length===0)return!1;var e=t.reduce((r,s)=>{var{type:i,value:n}=s;return ce(i)&&i.length>0&&r.$exception_types.push(i),ce(n)&&n.length>0&&r.$exception_values.push(n),r},{$exception_types:[],$exception_values:[]});return this.wo.some(r=>{var s=r.values.map(i=>{var n,a=Od[i.operator],o=Z(i.value)?i.value:[i.value],l=(n=e[i.key])!==null&&n!==void 0?n:[];return o.length>0&&a(o,l)});return r.type==="OR"?s.some(Boolean):s.every(Boolean)})}Ro(t){return t.flatMap(e=>{var r,s;return(r=(s=e.stacktrace)==null?void 0:s.frames)!==null&&r!==void 0?r:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Oo(t){if(t.length>0){var e,r,s,i,n=(e=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&e!==void 0?e:[],a=n[n.length-1];return(s=a==null||(i=a.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Eo(t){return!Y(t)&&Z(t)}}},Fm=T({productTours:class{get zr(){return this._instance.persistence}constructor(t){this.Fo=null,this.Ao=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if("productTours"in t){var e,r;if(this.zr&&this.zr.register({[so]:!!t.productTours}),!$n(this._instance))return!this.Fo&&Y((e=this.zr)==null?void 0:e.props[ks])||Mn.info("product tours disabled; stopping and clearing cached tours"),(r=this.Fo)==null||r.stop(),this.Fo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Fo&&$n(this._instance)&&this.Mt(()=>this.$o())}Mt(t){var e,r;(e=$.__PosthogExtensions__)!=null&&e.generateProductTours?t():(r=$.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",s=>{s?Mn.error("Could not load product tours script",s):t()})}$o(){var t;!this.Fo&&(t=$.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.Fo=$.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!Z(this.Ao)||e){var r=this.zr;if(r){var s=r.props[ks];if(Z(s)&&!e)return this.Ao=s,void t(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:i=>{if($n(this._instance)){var n=i.statusCode;if(n!==200||!i.json){var a="Product Tours API could not be loaded, status: "+n;return Mn.error(a),void t([],{isLoaded:!1,error:a})}var o=Z(i.json.product_tours)?i.json.product_tours:[];this.Ao=o,r&&r.register({[ks]:o}),t(o,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Ao,{isLoaded:!0})}getActiveProductTours(t){Y(this.Fo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Fo.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Fo)==null||e.showTourById(t)}previewTour(t){this.Fo?this.Fo.previewTour(t):this.Mt(()=>{var e;this.$o(),(e=this.Fo)==null||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Fo)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Fo)==null||t.nextStep()}previousStep(){var t;(t=this.Fo)==null||t.previousStep()}clearCache(){var t;this.Ao=null,(t=this.zr)==null||t.unregister(ks)}resetTour(t){var e;(e=this.Fo)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.Fo)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Fo)==null||e.cancelPendingTour(t)}}},tn),Lm={siteApps:class{constructor(t){this.Do=0,this._instance=t,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qo(t,e){if(e){var r=this.globalsForEvent(e);this.No.push(r),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var t;return(t=$._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.qo.bind(this));this.Bo=()=>{t(),this.No=[],this.Bo=void 0}}}globalsForEvent(t){var e,r,s,i,n,a,o;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,f]of Object.entries(d))l[h]={id:u[h],type:h,properties:f};var{$set_once:p,$set:m}=t;return{event:T({},cu(t,Pm),{properties:T({},t.properties,m?{$set:T({},(e=(r=t.properties)==null?void 0:r.$set)!==null&&e!==void 0?e:{},m)}:{},p?{$set_once:T({},(s=(i=t.properties)==null?void 0:i.$set_once)!==null&&s!==void 0?s:{},p)}:{}),elements_chain:(n=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&n!==void 0?n:"",distinct_id:(o=t.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}jo(t){var e,r=(e=t.tagName)==null?void 0:e.toLowerCase();return r==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(pt.error("prepare_external_dependency_stylesheet returned null"),null):r==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(pt.error("prepare_external_dependency_script returned null"),null):t}Ho(){var t,e,r,s,i,n,a,o;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=I==null?void 0:I.defaultView,u=l==null||(t=l.Node)==null?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Do++,this.Uo)return this.zo();var d=[],h=this,f=new WeakSet,p=(v,y,w)=>{if(v!=null&&v[y]){var x=v[y];v[y]=w(x),d.push(()=>
76{v[y]=x})}},m=v=>{if(f.has(v))return v;var y=h.jo(v);return y&&f.add(y),y},g=v=>v.map(y=>typeof y=="string"?y:m(y)).filter(y=>!Ve(y));return p(u,"appendChild",v=>function(y){var w=m(y);return w?v.call(this,w):y}),p(u,"insertBefore",v=>function(y,w){var x=m(y);return x?v.call(this,x,w):y}),p(u,"replaceChild",v=>function(y,w){var x=m(y);return x?v.call(this,x,w):w}),[(e=l.Element)==null?void 0:e.prototype,(r=l.Document)==null?void 0:r.prototype,(s=l.DocumentFragment)==null?void 0:s.prototype].forEach(v=>{p(v,"append",y=>function(){for(var w=arguments.length,x=new Array(w),E=0;w>E;E++)x[E]=arguments[E];return y.apply(this,g(x))}),p(v,"prepend",y=>function(){for(var w=arguments.length,x=new Array(w),E=0;w>E;E++)x[E]=arguments[E];return y.apply(this,g(x))})}),[(i=l.Element)==null?void 0:i.prototype,(n=l.CharacterData)==null?void 0:n.prototype,(a=l.DocumentType)==null?void 0:a.prototype].forEach(v=>{p(v,"before",y=>function(){for(var w=arguments.length,x=new Array(w),E=0;w>E;E++)x[E]=arguments[E];return y.apply(this,g(x))}),p(v,"after",y=>function(){for(var w=arguments.length,x=new Array(w),E=0;w>E;E++)x[E]=arguments[E];return y.apply(this,g(x))}),p(v,"replaceWith",y=>function(){for(var w=arguments.length,x=new Array(w),E=0;w>E;E++)x[E]=arguments[E];var j=g(x);return x.length&&!j.length?void 0:y.apply(this,j)})}),p((o=l.Element)==null?void 0:o.prototype,"insertAdjacentElement",v=>function(y,w){var x=m(w);return x?v.call(this,y,x):null}),this.Uo=()=>{d.forEach(v=>v()),this.Uo=void 0},this.zo()}zo(){var t=!1;return()=>{var e;t||(t=!0,this.Do--,this.Do===0&&((e=this.Uo)==null||e.call(this)))}}Vo(t,e){e===void 0&&(e=!0);var r=this.Ho();try{var s=t(r);return e&&r(),s}catch(i){throw r(),i}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var a;!e.errored&&this.No.length&&(pt.info("Processing "+this.No.length+" events for site app with id "+t.id),this.No.forEach(o=>this.Vo(()=>e.processEvent==null?void 0:e.processEvent(o))),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((a=this.Bo)==null||a.call(this))},s=!1,i=a=>{e.errored=!a,e.loaded=!0,pt.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),s&&r()};try{var{processEvent:n}=this.Vo(a=>t.init({posthog:this._instance,callback(o){a(),i(o)}}),!1);n&&(e.processEvent=n),s=!0}catch(a){pt.error(zl+t.id,a),i(!1)}if(s&&e.loaded)try{r()}catch(a){pt.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}Wo(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}Go(t){var e=this;if(Object.keys(this.apps).length!==0){var r=this.globalsForEvent(t),s=function(n){try{e.Vo(()=>n.processEvent==null?void 0:n.processEvent(r))}catch(a){pt.error("Error while processing event "+t.event+" for site app "+n.id,a)}};for(var i of Object.values(this.apps))s(i)}}onRemoteConfig(t){var e,r,s,i=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Wo(),void this._instance.on("eventCaptured",l=>this.Go(l))):void pt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Bo)==null||r.call(this),(s=t.siteApps)!=null&&s.length)if(this.isEnabled){var n=function(l){var u;$["__$$ph_site_app_"+l]=i._instance,(u=$.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(i._instance,o,d=>{if(d)return pt.error(zl+l,d)})};for(var{id:a,url:o}of t.siteApps)n(a)}else pt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Mm={tracingHeaders:class{constructor(t){this.Zo=void 0,this.Qo=void 0,this.Jo=void 0,this.do=()=>{var e,r,s=this.Yo();s?(N(this.Zo)&&(this.Zo=(e=$.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(s,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),N(this.Qo)&&(this.Qo=(r=$.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null?void 0:r._patchFetch(s,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.mo()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Mt(t){var e,r;(e=$.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(r=$.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",s=>{if(s)return Sm.error("failed to load script",s);t()})}Ko(){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}Yo(){var t=this.Ko();return Z(t)?(Z(this.Jo)?this.Jo.splice(0,this.Jo.length,...t):this.Jo=[...t],t.length>0?this.Jo:void 0):(Z(this.Jo)&&this.Jo.splice(0),this.Jo=t||void 0,this.Jo)}mo(){var t,e;(t=this.Zo)==null||t.call(this),(e=this.Qo)==null||e.call(this),this.Zo=void 0,this.Qo=void 0}startIfEnabledOrStop(){this.Yo()?this.Mt(this.do):this.mo()}}},$m=T({surveys:class{get Se(){return this._instance.config}constructor(t){this.Xo=void 0,this._surveyManager=null,this.ea=!1,this.ta=[],this.ra=null,this.ia=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Se.disable_surveys){var e=t.surveys;if(Y(e))return le.warn("Flags not loaded yet. Not loading surveys.");var r=Z(e);this.Xo=r?e.length>
760:e,le.info("flags response received, isSurveysEnabled: "+this.Xo),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var s=localStorage.key(r);(s!=null&&s.startsWith(Da)||s!=null&&s.startsWith("inProgressSurvey_"))&&e.push(s)}e.forEach(i=>localStorage.removeItem(i))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.ea)le.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)le.info(Bl);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())le.info("Not loading surveys in cookieless mode without consent.");else{var t=$==null?void 0:$.__PosthogExtensions__;if(t){if(!N(this.Xo)||this.Se.advanced_enable_surveys){var e=this.Xo||this.Se.advanced_enable_surveys;this.ea=!0;try{var r=t.generateSurveys;if(r)return void this.na(r,e);var s=t.loadExternalDependency;if(!s)return void this.sa(Ca);s(this._instance,"surveys",i=>{i||!t.generateSurveys?this.sa("Could not load surveys script",i):this.na(t.generateSurveys,e)})}catch(i){throw this.sa("Error initializing surveys",i),i}finally{this.ea=!1}}}else le.error("PostHog Extensions not found.")}}na(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Tm(this._instance),le.info("Surveys loaded successfully"),this.oa({isLoaded:!0})}sa(t,e){le.error(t,e),this.oa({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ta.push(t),this._surveyManager&&this.oa({isLoaded:!0}),()=>{this.ta=this.ta.filter(e=>e!==t)}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Se.disable_surveys)return le.info(Bl),t([]);var r,s=this._instance.get_property(ba);if(s&&!e)return t(s,{isLoaded:!0}),void(this.aa()&&this.getSurveys(()=>{},!0));typeof Promise<"u"&&this.ra?this.ra.then(i=>{var{surveys:n,context:a}=i;return t(n,a)}):(typeof Promise<"u"&&(this.ra=new Promise(i=>{r=i})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:i=>{var n;this.ra=null;var a=i.statusCode;if(a!==200||!i.json){var o="Surveys API could not be loaded, status: "+a;le.error(o),this.ia=Date.now();var l={isLoaded:!1,error:o};return t([],l),void(r==null||r({surveys:[],context:l}))}this.ia=null;var u,d=i.json.surveys||[],h=d.filter(p=>function(m){return!(!m.start_date||m.end_date)}(p)&&(function(m){var g;return!((g=m.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)}(p)||function(m){var g;return!((g=m.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)}(p)));h.length>0&&((u=this._surveyEventReceiver)==null||u.register(h)),(n=this._instance.persistence)==null||n.register({[ba]:d,[Fi]:Date.now()});var f={isLoaded:!0};t(d,f),r==null||r({surveys:d,context:f})}}))}aa(){return this.la()&&!this.ra&&!this.ua()}la(){var t=this._instance.get_property(Fi);return Ie(t)&&Date.now()-t>3e5}ua(){return Ie(this.ia)&&3e5>Date.now()-this.ia}markSurveyAsSeen(t,e){var r,s={id:t,current_iteration:(r=e==null?void 0:e.iteration)!==null&&r!==void 0?r:null};Fd(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}oa(t){for(var e of this.ta)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(r){le.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Y(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);le.warn("init was not called")}ha(t){var e=null;return this.getSurveys(r=>{var s;e=(s=r.find(i=>i.id===t))!==null&&s!==void 0?s:null}),e}da(t){if(Y(this._surveyManager))return{eligible:!1,reason:Dn};var e=typeof t=="string"?this.ha(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Y(this._surveyManager))return le.warn("init was not called"),{visible:!1,disabledReason:Dn};var e=this.da(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Y(this._surveyManager)?(le.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Dn})):new Promise(r=>
76{this.getSurveys(s=>{var i,n=(i=s.find(o=>o.id===t))!==null&&i!==void 0?i:null;if(n){var a=this.da(n);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,r){var s;if(Y(this._surveyManager))le.warn("init was not called");else{var i=typeof t=="string"?this.ha(t):t;if(i!=null&&i.id)if(gm.includes(i.type)){var n=I==null?void 0:I.querySelector(e);if(n)return(s=i.appearance)!=null&&s.surveyPopupDelaySeconds?(le.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,o;le.info("Rendering survey "+i.id+" with delay of "+((a=i.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(i,n,r),le.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n,r);le.warn("Survey element not found")}else le.warn("Surveys of type "+i.type+" cannot be rendered in the app");else le.warn("Survey not found")}}displaySurvey(t,e){var r;if(Y(this._surveyManager))le.warn("init was not called");else{var s=this.ha(t);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=T({},s,{appearance:T({},s.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Aa.Popover&&e.initialResponses&&le.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var n=this.canRenderSurvey(s);if(!n.visible)return void le.warn("Survey is not eligible to be displayed: ",n.disabledReason)}e.displayType!==Aa.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}else le.warn("Survey not found")}}cancelPendingSurvey(t){Y(this._surveyManager)?le.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload()}}},tn),Dm={toolbar:class{constructor(t){this.instance=t}ca(t){$.ph_toolbar_state=t}va(){var t;return(t=$.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),Xu(this.instance.config)||!b||!I)return!1;t=t??b.location,r=r??b.history;try{if(!e){try{b.localStorage.setItem("test","test"),b.localStorage.removeItem("test")}catch{return!1}e=b==null?void 0:b.localStorage}var s,i=Rm||Ui(t.hash,"__posthog")||Ui(t.hash,"state"),n=i?nl(()=>JSON.parse(atob(decodeURIComponent(i))))||nl(()=>JSON.parse(decodeURIComponent(i))):null;return n&&n.action==="ph_authorize"?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?t.hash=n.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((s=JSON.parse(e.getItem(Ul)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch{return!1}}fa(t){var e=$.ph_load_toolbar||$.ph_load_editor;!Y(e)&&ht(e)?e(t,this.instance):Vl.warn("No toolbar load function found")}loadToolbar(t){var e=!(I==null||!I.getElementById(Yu));if(!b||e)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=T({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(b.localStorage.setItem(Ul,JSON.stringify(T({},s,{source:void 0}))),this.va()===2)this.fa(s);else if(this.va()===0){var i;this.ca(1),(i=$.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",n=>{if(n)return Vl.error("[Toolbar] Failed to load",n),void this.ca(0);this.ca(2),this.fa(s)}),xe(b,"turbolinks:load",()=>{this.ca(0),this.loadToolbar(s)})}return!0}pa(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},zm=T({experiments:Me},tn),Bm=T({},tn,Am,Om,Im,Fm,Lm,$m,Mm,Dm,zm,{conversations:class{constructor(t){this.ga=void 0,this._conversationsManager=null,this.ma=!1,this.ya=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;Y(e)||(yt(e)?this.ga=e:(this.ga=e.enabled,this.ya=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.ga=void 0,this.ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.ma||this._instance.config.disable_conversations||Xu(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=$==null?void 0:$.__PosthogExtensions__;if(t&&!N(this.ga)&&this.ga)if(this.ya&&this.ya.token){this.ma=!0;try{var e=t.initConversations;if(e)return this.ba(e),void(this.ma=!1);var r=t.loadExternalDependency;if(!r)return void this._a(Ca);r(this._instance,"conversations",s=>{s||!t.initConversations?this._a("Could not load conversations script",s):this.ba(t.initConversations),this.ma=!1})}catch(s){this._a("Error initializing conversations",s),this.ma=!1}}else Je.error("Conversations enabled but missing token in remote config.")}}ba(t){if(this.ya)try{this._conversationsManager=t(this.ya,this._instance),Je.info("Conversations loaded successfully")}catch(e){this._a("Error completing conversations initialization",e)}else Je.error("Cannot complete initialization: remote config is null")}_a(t,e){Je.error(t,e),this._conversationsManager=null,this.ma=!1}show(){this._conversationsManager?this._conversationsManager.show():Je.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.ga===!0&&!Ve(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,r){var s=this;return Ce(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(t,e,r):(Je.warn(or),null)})()}getMessages(t,e){var r=this;return Ce(function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,e):(Je.warn(or),null)})()}markAsRead(t){var e=this;return Ce(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Je.warn(or),null)})()}getTickets(t){var e=this;return Ce(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Je.warn(or),null)})()}requestRestoreLink(t){var e=this;return Ce(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Je.warn(or),null)})()}restoreFromToken(t){var e=this;return Ce(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Je.warn(or),null)})()}restoreFromUrlToken(){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Je.warn(or),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}en(){var t;(t=this._conversationsManager)==null||t.setIdentity()}tn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},{logs:class{constructor(t){var e;this.wa=!1,this.xa=!1,this.Ae=we("[logs]"),this._r=[],this.ka=[],this.ss=0,this.Sa=()=>{var r,s;this.ss=0,(r=this.Ca)==null||r.onReconnect(),(s=this.Ia)==null||s.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.wa=!0),b&&xe(b,"online",this.Sa)}Ta(t,e,r,s){var i,n=function(a,o){var l,u,d,h,f,p,m,g=(l=a==null?void 0:a.flushIntervalMs)!==null&&l!==void 0?l:3e3,v=(u=a==null?void 0:a.maxBufferSize)!==null&&u!==void 0?u:100,y=o!=null&&o.consoleCapture?void 0:(d=a==null?void 0:a.maxLogsPerInterval)!==null&&d!==void 0?d:1e3,w=N(y)?Math.max(v,2048):Math.max(v,y),x=a==null?void 0:a.resourceAttributes;return{serviceName:(h=(f=x==null?void 0:x["service.name"])!==null&&f!==void 0?f:a==null?void 0:a.serviceName)!==null&&h!==void 0?h:o==null?void 0:o.serviceNameDefault,serviceVersion:(p=x==null?void 0:x["service.version"])!==null&&p!==void 0?p:a==null?void 0:a.serviceVersion,environment:(m=x==null?void 0:x["deployment.environment"])!==null&&m!==void 0?m:a==null?void 0:a.environment,resourceAttributes:x,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:g,maxBufferSize:v,maxQueueSize:w,maxBatchRecordsPerPost:100,rateCapWindowMs:g,maxLogsPerInterval:y,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,r);return[new Qg(this.Ea(t,e),n,this.Ae,()=>this.Ma(),a=>a(),void 0,s),n]}Pa(){var t,e,r=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;return this.Ca&&this.Ra===r||((e=this.Ca)==null||e.reset(),this.Ra=r,[this.Ca,this.Oa]=this.Ta(()=>this._r,s=>{this._r=s})),this.Ca}La(){var t,e,r=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;return this.Ia&&this.Fa===r||((e=this.Ia)==null||e.reset(),this.Fa=r,[this.Ia,this.Aa]=this.Ta(()=>this.ka,s=>{this.ka=s},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Wl)),this.Ia}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=(e=t.logs)==null?void 0:e.captureConsoleLogs;!Y(r)&&r&&(this.wa=!0,this.loadIfEnabled())}reset(){var t,e;this._r=[],(t=this.Ca)==null||t.reset(),this.ka=[],(e=this.Ia)==null||e.reset(),this.ss=0}captureLog(t){this.Pa().captureLog(t)}le(t){this.La().captureLog(t)}get logger(){return this.$a||(this.$a={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.$a}flushLogs(t){t?this.Da(t):(this.Ca&&this.Ca.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)),this.Ia&&this.Ia.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.wa&&!this.xa){var t=$==null?void 0:$.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",r=>{var s;r||(s=t.logs)==null||!s.initializeLogs?this.Ae.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this.xa=!0)}):this.Ae.error(Ca)}else this.Ae.error("PostHog Extensions not found.")}}Ea(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:s=>s===Rt.LogsQueue?t():void 0,setPersistedProperty(s,i){var n;s===Rt.LogsQueue&&e((n=i)!==null&&n!==void 0?n:[])},ht:s=>this.ht(s),getLibraryId:()=>ke.LIB_NAME,getLibraryVersion:()=>ke.LIB_VERSION}}ht(t){return new Promise(e=>{if(pd(this.ss,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,s=n=>{r||(r=!0,clearTimeout(i),e(n))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.Na(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:n=>{var a=n.statusCode;if(this.qa(a),a>=200&&300>a)s({kind:"ok"});else if(a===413)s({kind:"too-large"});else if(a!==0&&a!==429&&500>a)s({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var o;s({kind:"retry-later",error:(o=n.error)!==null&&o!==void 0?o:new Error("logs request failed with status "+a)})}}})}})}qa(t){(t!==0||this._instance.__loaded)&&(this.ss=fd(t,this.ss,3,()=>
76this.Ae.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.")))}Da(t){this._r.length>0&&this.Ba(t,this._r,this.Oa,ke.LIB_NAME,e=>{this._r=e}),this.ka.length>0&&this.Ba(t,this.ka,this.Aa,Wl,e=>{this.ka=e})}Ba(t,e,r,s,i){if(e.length!==0){var n=e.map(o=>o.record);i([]);var a=$u(n,Mu(r,ke.LIB_NAME,ke.LIB_VERSION),s,ke.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Na(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Na(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ma(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r,windowId:s,sessionStartTimestamp:i,lastActivityTimestamp:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=r,e.windowId=s,Y(i)||(e.sessionStartTimestamp=i),Y(n)||(e.lastActivityTimestamp=n)}if($!=null&&(t=$.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Xt($.location.href):$.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}});et.__defaultExtensionClasses=T({},Bm);var Er=function(){ke.SDK_DIST_CHANNEL="npm";var t=Is[Fr]=new et;return function(){function e(){e.done||(e.done=!0,Md=!1,he(Is,function(r){r._dom_loaded()}))}I!=null&&I.addEventListener?I.readyState==="complete"?e():xe(I,"DOMContentLoaded",e,{capture:!1}):b&&R.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();const Um="phc_zPtvrqUif3sMTUvqQcLg3ViZ5cdLZ9cdQdPwgdgdKtvk",Yl=Um,Vm="https://eu.i.posthog.com";let er=!1;function $d(){er||!Yl||typeof window>"u"||(Er.init(Yl,{api_host:Vm,capture_pageview:!1,capture_pageleave:!0,autocapture:!0,disable_session_recording:!1,session_recording:{maskAllInputs:!0},persistence:"localStorage+cookie",opt_out_capturing_by_default:!0}),er=!0)}function qm(t){er||$d(),er&&(t?Er.opt_in_capturing():Er.opt_out_capturing())}function Hm(){er&&Er.capture("$pageview")}function Yy(t,e){er&&Er.capture(t,e)}function Gm(t,e){er&&Er.identify(t,e)}function Wm(){er&&Er.reset()}const Dd=_.createContext(void 0),Ym=({children:t})=>{const[e,r]=_.useState(null),[s,i]=_.useState(!0),[n,a]=_.useState(0),[o,l]=_.useState(0),[u,d]=_.useState(0),h=_.useCallback(async v=>{if(!(v!=null&&v.user)){a(0),l(0),d(0);return}const{data:y,error:w}=await dr.from("profiles").select("credits_remaining, trial_photos_remaining, trial_videos_remaining").eq("id",v.user.id).maybeSingle();if(w){console.error("[AuthContext] failed to load credits",w),a(0),l(0),d(0);return}a((y==null?void 0:y.credits_remaining)??0),l((y==null?void 0:y.trial_photos_remaining)??0),d((y==null?void 0:y.trial_videos_remaining)??0)},[]),f=_.useCallback(v=>{v==="video"?d(y=>Math.max(0,y-1)):l(y=>Math.max(0,y-1))},[]);_.useEffect(()=>{let v=!1;const{data:{subscription:y}}=dr.auth.onAuthStateChange((w,x)=>{v||(r(x),x!=null&&x.user?Gm(x.user.id,{email:x.user.email??void 0}):Wm(),h(x))});return dr.auth.getSession().then(({data:{session:w}})=>{v||(r(w),i(!1),h(w))}),()=>{v=!0,y.unsubscribe()}},[h]);const p=_.useCallback(async()=>{await dr.auth.signOut()},[]),m=_.useCallback(async()=>{const{data:{session:v}}=await dr.auth.getSession();await h(v)},[h]),g=_.useMemo(()=>({isAuthenticated:!!(e!=null&&e.user),loading:s,user:(e==null?void 0:e.user)??null,session:e,credits:n,trialPhotos:o,trialVideos:u,logout:p,refreshCredits:m,setCredits:a,decrementTrialLocal:f}),[e,s,n,o,u,p,m,f]);return c.jsx(Dd.Provider,{value:g,children:t})},Qs=()=>{const t=_.useContext(Dd);if(!t)throw new Error("useAuth must be used within AuthProvider");return t},Km=()=>{const{pathname:t,hash:e}=xt();return _.useEffect(()=>{Hm()},[t]),_.useEffect(()=>{if(e){const r=setTimeout(()=>{const s=document.querySelector(e);s?s.scrollIntoView({behavior:"smooth"}):window.scrollTo({top:0,left:0,behavior:"auto"})},50);return()=>clearTimeout(r)}window.scrollTo({top:0,left:0,behavior:"auto"})},[t,e]),null},Qm=()=>{const{isAuthenticated:t,loading:e}=Qs();return e?null:t?c.jsx(xr,{to:"/upgrade",replace:!0}):c.jsx(Wa,{})},Jm=()=>{const{user:t,loading:e}=Qs(),[r,s]=_.useState(null);return _.useEffect(()=>{if(e)return;if(!t){s(!1);return}let i=!1;return dr.rpc("is_admin").then(({data:n,error:a})=>{i||s(!a&&!!n)}),()=>{i=!0}},[e,t]),e||r===null?null:r?c.jsx(Wa,{}):c.jsx(xr,{to:"/app",replace:!0})},Xm=()=>{const{user:t,loading:e}=Qs(),[r,s]=_.useState(null);return _.useEffect(()=>{if(e)return;if(!t){s(!1);return}let i=!1;return dr.rpc("is_affiliate").then(({data:n,error:a})=>{i||s(!a&&n===!0)}),()=>{i=!0}},[e,t]),r},Zm=()=>{const{user:t,loading:e}=Qs(),r=Xm();return e||r===null?null:t?r?c.jsx(Wa,{}):c.jsx(xr,{to:"/app",replace:!0}):c.jsx(xr,{to:"/login",replace:!0})},e_=Yc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium font-sans ring-offset-background transition-all duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-hover hover:shadow-[0_0_24px_-4px_hsl(var(--primary)/0.55)]",secondary:"bg-transparent text-primary border border-primary hover:bg-primary/10 hover:text-primary",ghost:"bg-transparent text-foreground hover:text-text-secondary",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-border bg-transparent text-foreground hover:border-primary hover:text-primary",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-5 py-2",sm:"h-9 rounded-md px-3 text-xs",lg:"h-12 rounded-md px-8 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Oe=_.forwardRef(({className:t,variant:e,size:r,asChild:s=!1,...i},n)=>{const a=s?vh:"button";return c.jsx(a,{className:pe(e_({variant:e,size:r,className:t})),ref:n,...i})});Oe.displayName="Button";const t_=_h,Ky=bh,r_=yh,zd=_.forwardRef(({className:t,...e},r)=>c.jsx(wc,{ref:r,className:pe("fixed inset-0 z-50 bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));zd.displayName=wc.displayName;const Bd=_.forwardRef(({className:t,children:e,...r},s)=>c.jsxs(r_,{children:[c.jsx(zd,{}),c.jsxs(Ec,{ref:s,className:pe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 roun
76ded-lg border border-border bg-card p-6 shadow-[0_24px_48px_-16px_hsl(0_0%_0%/0.6)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",t),...r,children:[e,c.jsxs(mh,{className:"absolute right-4 top-4 rounded-sm text-text-secondary transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:pointer-events-none",children:[c.jsx(Ka,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bd.displayName=Ec.displayName;const Ud=({className:t,...e})=>c.jsx("div",{className:pe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Ud.displayName="DialogHeader";const Vd=({className:t,...e})=>c.jsx("div",{className:pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Vd.displayName="DialogFooter";const qd=_.forwardRef(({className:t,...e},r)=>c.jsx(Sc,{ref:r,className:pe("font-display text-xl font-bold leading-none tracking-tight",t),...e}));qd.displayName=Sc.displayName;const Hd=_.forwardRef(({className:t,...e},r)=>c.jsx(kc,{ref:r,className:pe("text-sm text-text-secondary",t),...e}));Hd.displayName=kc.displayName;const Gd=_.forwardRef(({className:t,...e},r)=>c.jsx(Pc,{className:pe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...e,ref:r,children:c.jsx(xh,{className:pe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Gd.displayName=Pc.displayName;const Gs=1,s_=13*30*24*60*60*1e3,bi="bemodel_cookie_consent_v2",Bn="bemodel_cookie_consent",i_={analytics:!1,marketing:!1},n_=t=>t.version===Gs&&Date.now()-t.timestamp<s_,a_=()=>{try{const t=localStorage.getItem(bi);if(t){const r=JSON.parse(t);if(n_(r))return r}const e=localStorage.getItem(Bn);if(e==="all"){const r={version:Gs,timestamp:Date.now(),analytics:!0,marketing:!0};return localStorage.setItem(bi,JSON.stringify(r)),localStorage.removeItem(Bn),r}if(e==="essential"){const r={version:Gs,timestamp:Date.now(),analytics:!1,marketing:!1};return localStorage.setItem(bi,JSON.stringify(r)),localStorage.removeItem(Bn),r}}catch{}return null},Kl=(t,e)=>{var r;typeof window>"u"||(qm(t),(r=window.gtag)==null||r.call(window,"consent","update",{analytics_storage:t?"granted":"denied",ad_storage:e?"granted":"denied",ad_user_data:e?"granted":"denied",ad_personalization:e?"granted":"denied"}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"consent_update",analytics_consent:t,marketing_consent:e}))},Ba=new Set;let Wd=0;const o_=()=>{Wd+=1,Ba.forEach(t=>t())},l_=()=>o_();function c_(){const[t,e]=_.useState(null),[r,s]=_.useState(!1),[i,n]=_.useState(Wd);_.useEffect(()=>{const u=a_();u?(e(u),Kl(u.analytics,u.marketing)):s(!0)},[]),_.useEffect(()=>{const u=()=>n(d=>d+1);return Ba.add(u),()=>{Ba.delete(u)}},[]);const a=_.useCallback((u,d)=>{const h={version:Gs,timestamp:Date.now(),analytics:u,marketing:d};try{localStorage.setItem(bi,JSON.stringify(h))}catch{}e(h),s(!1),Kl(u,d)},[]),o=_.useCallback(()=>a(!0,!0),[a]),l=_.useCallback(()=>a(!1,!1),[a]);return{consent:t??{...i_,version:Gs,timestamp:0},needsPrompt:r,externalOpenTick:i,save:a,acceptAll:o,rejectAll:l}}const u_=()=>{const{consent:t,needsPrompt:e,externalOpenTick:r,acceptAll:s,rejectAll:i,save:n}=c_(),[a,o]=_.useState(!1),[l,u]=_.useState(!1),[d,h]=_.useState(!1),[f,p]=_.useState(!1);_.useEffect(()=>{e&&o(!0)},[e]),_.useEffect(()=>{r!==0&&(h(t.analytics),p(t.marketing),u(!0),o(!0))},[r,t.analytics,t.marketing]);const m=()=>{s(),o(!1),u(!1)},g=()=>{i(),o(!1),u(!1)},v=()=>{n(d,f),o(!1),u(!1)},y=()=>{h(t.analytics),p(t.marketing),u(!0)};return a?c.jsxs(c.Fragment,{children:[c.jsx("div",{role:"dialog","aria-label":"Cookie consent","aria-modal":"false",className:pe("fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background/95 backdrop-blur-sm","animate-in slide-in-from-bottom duration-300"),children:c.jsxs("div",{className:"container flex flex-col gap-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6",children:[c.jsxs("p",{className:"font-sans text-sm leading-relaxed text-text-secondary",children:["We use cookies to keep you logged in, process payments securely, and â with your consent â to measure how the site is used and to show you relevant ads."," ",c.jsx(Ne,{to:"/privacy#cookies",className:"font-medium text-primary hover:underline",children:"Learn more"})]}),c.jsxs("div",{className:"flex shrink-0 flex-col gap-2 sm:flex-row sm:items-center",children:[c.jsx(Oe,{size:"sm",variant:"outline",className:"w-full sm:w-auto",onClick:g,children:"Reject all"}),c.jsx(Oe,{size:"sm",variant:"outline",className:"w-full sm:w-auto",onClick:y,children:"Customize"}),c.jsx(Oe,{size:"sm",className:"w-full sm:w-auto",onClick:m,children:"Accept all"})]})]})}),c.jsx(t_,{open:l,onOpenChange:u,children:c.jsxs(Bd,{className:"max-w-[520px]",children:[c.jsxs(Ud,{children:[c.jsx(qd,{children:"Cookie preferences"}),c.jsx(Hd,{children:"Choose which categories of cookies you allow. You can change this at any time from the link in the footer."})]}),c.jsxs("div",{className:"space-y-5 py-2",children:[c.jsx(Un,{title:"Str
76ictly necessary",description:"Required for login, payments and security. Cannot be disabled.",checked:!0,disabled:!0}),c.jsx(Un,{title:"Analytics",description:"Helps us understand how the site is used (Google Analytics 4). All data is aggregated.",checked:d,onChange:h}),c.jsx(Un,{title:"Marketing",description:"Used to measure ad performance and show you relevant ads on Google and Meta.",checked:f,onChange:p})]}),c.jsxs(Vd,{className:"gap-2 sm:gap-2",children:[c.jsx(Oe,{variant:"outline",onClick:g,children:"Reject all"}),c.jsx(Oe,{variant:"outline",onClick:m,children:"Accept all"}),c.jsx(Oe,{onClick:v,children:"Save preferences"})]})]})})]}):null},Un=({title:t,description:e,checked:r,disabled:s,onChange:i})=>c.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg border border-border bg-background-secondary p-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"font-sans text-sm font-semibold text-foreground",children:t}),c.jsx("p",{className:"font-sans text-xs leading-relaxed text-text-secondary",children:e})]}),c.jsx(Gd,{checked:r,disabled:s,onCheckedChange:i,"aria-label":t})]});class d_ extends _.Component{constructor(){super(...arguments);Zs(this,"state",{hasError:!1});Zs(this,"handleReload",()=>{window.location.reload()});Zs(this,"handleHome",()=>{window.location.assign("/")})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,s){}render(){return this.state.hasError?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-5",children:c.jsxs("div",{className:"max-w-md text-center",children:[c.jsx("h1",{className:"font-display text-[28px] font-bold tracking-tight text-foreground sm:text-[32px]",children:"Something went wrong"}),c.jsx("p",{className:"mt-3 font-sans text-sm text-text-secondary",children:"An unexpected error broke this page. Reload to try again, or head back to the home page."}),c.jsxs("div",{className:"mt-6 flex flex-col gap-2 sm:flex-row sm:justify-center",children:[c.jsx("button",{type:"button",onClick:this.handleReload,className:"inline-flex h-10 items-center justify-center rounded-md bg-primary px-5 font-sans text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",children:"Reload page"}),c.jsx("button",{type:"button",onClick:this.handleHome,className:"inline-flex h-10 items-center justify-center rounded-md border border-border bg-background px-5 font-sans text-sm font-medium text-foreground transition-colors hover:bg-background-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",children:"Go to home"})]})]})}):this.props.children}}const h_=[{to:"/",label:"Home"},{to:"/templates",label:"Templates"},{to:"/pricing",label:"Pricing"},{to:"/blog",label:"Blog"}],p_=[{to:"/about",label:"About"},{to:"/faq",label:"FAQ"},{to:"/glossary",label:"Glossary"},{to:"/press",label:"Press"}],f_=[{to:"/privacy",label:"Privacy Policy"},{to:"/terms",label:"Terms of Service"}],g_=()=>c.jsx("footer",{className:"border-t border-border bg-background",children:c.jsxs("div",{className:"container py-8 sm:py-12",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6 md:grid-cols-4 md:gap-10",children:[c.jsxs("div",{className:"col-span-2 md:col-span-1",children:[c.jsx(Ne,{to:"/",className:"font-brand text-3xl leading-none text-primary transition-opacity duration-200 hover:opacity-80","aria-label":"BeModel home",children:"BeModel"}),c.jsx("p",{className:"mt-2 max-w-xs text-sm text-text-secondary sm:mt-3",children:"Premium AI avatar image generation for creators and brands."})]}),c.jsxs("nav",{"aria-label":"Footer links",children:[c.jsx("h2",{className:"font-display text-xs font-semibold uppercase tracking-wider text-foreground sm:text-sm",children:"Links"}),c.jsx("ul",{className:"mt-2 space-y-1.5 sm:mt-4 sm:space-y-2",children:h_.map(t=>c.jsx("li",{children:c.jsx(Ne,{to:t.to,className:"text-sm text-text-secondary transition-colors duration-200 hover:text-primary",children:t.label})},t.to))})]}),c.jsxs("nav",{"aria-label":"Resources",children:[c.jsx("h2",{className:"font-display text-xs font-semibold uppercase tracking-wider text-foreground sm:text-sm",children:"Resources"}),c.jsx("ul",{className:"mt-2 space-y-1.5 sm:mt-4 sm:space-y-2",children:p_.map(t=>c.jsx("li",{children:c.jsx(Ne,{to:t.to,className:"text-sm text-text-secondary transition-colors duration-200 hover:text-primary",children:t.label})},t.to))})]}),c.jsxs("nav",{"aria-label":"Legal",children:[c.jsx("h2",{className:"font-display text-xs font-semibold uppercase tracking-wider text-foreground sm:text-sm",children:"Legal"}),c.jsxs("ul",{className:"mt-2 space-y-1.5 sm:mt-4 sm:space-y-2",children:[f_.map(t=>c.jsx("li",{children:c.jsx(Ne,{to:t.to,className:"text-sm text-text-secondary transition-colors duration-200 hover:text-primary",children:t.label})},t.to)),c.jsx("li",{children:c.jsx("button",{type:"button",onClick:l_,className:"text-left text-sm text-text-secondary transition-colors duration-200 hover:text-primary",children:"Manage cookies"})})]})]})]}),c.jsxs("div",{className:"mt-6 space-y-2 border-t border-border pt-4 sm:mt-12 sm:space-y-3 sm:pt-6",children:[c.jsxs("p",{className:"text-[11px] leading-relaxed text-text-secondary sm:text-xs",children:["All avatars and photos shown on this site are AI-generated fictional characters portrayed as adults aged 18 or older. No real, identifiable person is depicted. Outputs may incidentally contain third-party trademarks or unintended elements; see our"," ",c.jsx(Ne,{to:"/terms",className:"underline transition-colors hover:text-primary",children:"Terms of Service"})," ","for details on responsible use."]}),c.jsx("p",{className:"text-[11px] text-text-secondary sm:text-xs",children:"© 2026 BeModel. All rights reserved."})]})]})}),Ql=[{to:"/",label:"Home"},{to:"/watch?from=site",label:"Tutorial"},{to:"/templates",label:"Pictures"},{to:"/pricing",label:"Pricing"}],v_=()=>{const[t,e]=_.useState(!1),r=_.useRef(null);return _.useEffect(()=>{if(!t)return;const s=i=>{r.current&&!r.current.contains(i.target)&&e(!1)};return document.addEventListener("pointerdown",s),()=>document.removeEventListener("pointerdown",s)},[t]),_.useEffect(()=>{if(!t)return;const s=i=>{i.key==="Escape"&&e(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[t]),c.jsxs("header",{ref:r,className:"sticky top-0 z-40 w-full border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:[c.jsxs("div",{className:"container flex h-16 items-center justify-between",children:[c.jsx(Ne,{to:"/",className:"font-brand text-[28px] leading-none text-primary transition-opacity duration-200 hover:opacity-80","aria-label":"BeModel home",children:"BeModel"}),c.jsx("nav",{className:"hidden items-center gap-9 md:flex","aria-label":"Primary",children:Ql.map(s=>c.jsx(Oo,{to:s.to,end:s.to==="/",className:({isActive:i})=>pe("group relative font-sans text-[15px] font-semibold transition-colors duration-200",i?"text-foreground":"text-text-secondary hover:text-foreground"),children:({isActive:i})=>c.jsxs(c.Fragment,{children:[s.label,c.jsx("span",{className:pe("absolute -bottom-1.5 left-0 h-[2px] w-full origin-left rounded-full bg-primary transition-transform duration-300",i?"scale-x-100":"scale-x-0 group-hover:scale-x-100")})]})},s.to))}),c.jsxs("div",{className:"hidden items-center gap-4 md:flex",children:[c.jsx(Oe,{variant:"secondary",size:"sm",asChild:!0,children:c.jsx(Ne,{to:"/login",children:"Login"})}),c.jsx(Oe,{size:"sm",asChild:!0,children:c.jsx(Ne,{to:"/start-free",children:"Get Started"})})]}),c.jsx("button",{type:"button",className:"inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground transition-colors hover:text-primary md:hidden","aria-label":t?"Close menu":"Open menu","aria-expanded":t,onClick:()=>e(s=>!s),children:t?c.jsx(Ka,{className:"h-5 w-5"}):c.jsx($f,{className:"h-5 w-5"})})]}),c.jsx("div",{className:pe("grid overflow-hidden border-border bg-background transition-[grid-template-rows,opacity,border-top-width] duration-200 ease-out md:hidden",t?"grid-rows-[1fr] border-t opacity-100":"grid-rows-[0fr] opacity-0"),"aria-hidden":!t,children:c.jsx("div",{className:"overflow-hidden",children:c.jsxs("div",{className:"container flex flex-col gap-4 py-4",children:[Ql.map(s=>c.jsx(Oo,{to:s.to,end:s.to==="/",onClick:()=>e(!1),className:({isActive:i})=>pe("text-base font-medium font-sans transition-colors",i?"text-foreground":"text-text-secondary hover:text-foreground"),children:s.label},s.to)),c.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[c.jsx(Oe,{variant:"secondary",asChild:!0,onClick:()=>e(!1),children:c.jsx(Ne,{to:"/login",children:"Login"})}),c.jsx(Oe,{asChild:!0,onClick:()=>e(!1),children:c.jsx(Ne,{to:"/start-free",children:"Get Started"})})]})]})})})]})},Yd=({children:t})=>c.jsxs("div",{className:"flex min-h-screen flex-col bg-background text-foreground",children:[c.jsx(v_,{}),c.jsx("main",{className:"flex-1",children:t}),c.jsx(g_,{})]}),m_="/assets/casual-amber-lounge-1779240026798-Bx_cdkSx.webp",__="/assets/casual-big-smile-1779240469391-BTIapvhx.webp",y_="/assets/casual-festival-flash-1779067804352-aPbn2LZ6.webp",b_="/assets/casual-gym-sunset-1778801483017-D0G7_tC5.webp",x_="/assets/casual-jet-ski-girl-1778774415756-DdjeOpIr.webp",w_="/assets/casual-lime-lounge-1779239845057-DyVkcR2T.webp",E_="/assets/casual-lounge-elegance-1778797744798-D84dS1bR.webp",S_="/assets/casual-midnight-patio-1779239544249-C4qvAZW0.webp",k_="/assets/casual-night-entrance-1779149442365-B5_oJ5A-.webp",P_="/assets/casual-pink-princess-1778799770264-DADlNyNI.webp",j_="/assets/casual-private-jet-lounge-1779209856438-D-lsD9O5.webp",C_="/assets/casual-red-velocity-1779068045493-ODegFGud.webp",T_="/assets/casual-summer-glow-1778779414727-BFsH0pCi.webp",R_="/assets/casual-track-luxury-1778800062828-CTze2j3k.webp",N_="/assets/casual-yellow-baddie-1
76778777702437-iiqcWP-9.webp",A_="/assets/hot-hot-leopard-1778456972386-BSmjf1va.webp",O_="/assets/hot-motel-night-1778456138609-zAhYgpzH.webp",I_="/assets/hot-tropical-coco-1778803202177-BcFNhnfW.webp",F_="/assets/outdoor-city-glow-1779061208084-m2tdW4dO.webp",L_="/assets/outdoor-court-elegance-1779240315178-Dop8YHcm.webp",M_="/assets/outdoor-croissant-patio-1779183119893-EqF4CWj7.webp",$_="/assets/outdoor-desert-veil-1779208614014-BDN-lGRo.webp",D_="/assets/outdoor-emerald-sands-1779149756834-DxcAqnn8.webp",z_="/assets/outdoor-ferris-field-1779211223929-Bqr7jNdb.webp",B_="/assets/outdoor-lagoon-bow-1779212689378-VX3GQnwn.webp",U_="/assets/outdoor-lake-row-1779208955499-DjQFwtyL.webp",V_="/assets/outdoor-midnight-curb-1779277861085-C91mTg75.webp",q_="/assets/outdoor-night-rebel-1779058073691-COYJy4Ke.webp",H_="/assets/outdoor-ocean-flight-1779210487921-Db3Qm74M.webp",G_="/assets/outdoor-ocean-veil-1779277502691-Ch-ZUESF.webp",W_="/assets/outdoor-pool-peace-1779102820716-36sjEgYE.webp",Y_="/assets/outdoor-sky-knit-1779149198704-B47ontbH.webp",K_="/assets/outdoor-yellow-beach-1779103655758-5_BN_uaD.webp",Q_="/assets/selfie-brown-curve-1779103942386-wG6ToymT.webp",J_="/assets/selfie-cloud-journey-1779058613958-CIU62xE9.webp",X_="/assets/selfie-cop-girl-1778628199478-CQlXRooN.webp",Z_="/assets/selfie-gym-mirror-1779180692931-WrlAGiUB.webp",e0="/assets/selfie-gym-reflection-1778798029863-Di2GZszL.webp",t0="/assets/selfie-hot-nurse-1778705657063-Cq2b-_nn.webp",r0="/assets/selfie-luxury-boutique-1778800499529-CrWrZWcm.webp",s0="/assets/selfie-mirror-glow-1779029165202-CosxDuNM.webp",i0="/assets/selfie-modern-muse-1779067187132-CBfJwYiz.webp",n0="/assets/selfie-neon-glow-1779032468620-B6KE39K2.webp",a0="/assets/selfie-pink-bouquet-1779059641956-DDuEATVj.webp",o0="/assets/selfie-police-girl-1778627281412-CKVyZ_VB.webp",l0="/assets/selfie-pre-gym-1778714059554-ByWLp8kB.webp",c0="/assets/selfie-sexy-nurse-1778706653140-BCkoD9wY.webp",u0="/assets/selfie-wet-baddie-1778780234899-DUtRt-Lq.webp",Ps=[{id:"casual-amber-lounge",name:"Amber Lounge",url:m_,category:"casual"},{id:"casual-big-smile",name:"Big Smile",url:__,category:"casual"},{id:"casual-festival-flash",name:"Festival Flash",url:y_,category:"casual"},{id:"casual-gym-sunset",name:"Gym Sunset",url:b_,category:"casual"},{id:"casual-jet-ski-girl",name:"Jet Ski Girl",url:x_,category:"casual"},{id:"casual-lime-lounge",name:"Lime Lounge",url:w_,category:"casual"},{id:"casual-lounge-elegance",name:"Lounge Elegance",url:E_,category:"casual"},{id:"casual-midnight-patio",name:"Midnight Patio",url:S_,category:"casual"},{id:"casual-night-entrance",name:"Night Entrance",url:k_,category:"casual"},{id:"casual-pink-princess",name:"Pink Princess",url:P_,category:"casual"},{id:"casual-private-jet-lounge",name:"Private Jet Lounge",url:j_,category:"casual"},{id:"casual-red-velocity",name:"Red Velocity",url:C_,category:"casual"},{id:"casual-summer-glow",name:"Summer Glow",url:T_,category:"casual"},{id:"casual-track-luxury",name:"Track Luxury",url:R_,category:"casual"},{id:"casual-yellow-baddie",name:"Yellow Baddie",url:N_,category:"casual"},{id:"hot-hot-leopard",name:"Hot Leopard",url:A_,category:"hot"},{id:"hot-motel-night",name:"Motel Night",url:O_,category:"hot"},{id:"hot-tropical-coco",name:"Tropical Coco",url:I_,category:"hot"},{id:"outdoor-city-glow",name:"City Glow",url:F_,category:"outdoor"},{id:"outdoor-court-elegance",name:"Court Elegance",url:L_,category:"outdoor"},{id:"outdoor-croissant-patio",name:"Croissant Patio",url:M_,category:"outdoor"},{id:"outdoor-desert-veil",name:"Desert Veil",url:$_,category:"outdoor"},{id:"outdoor-emerald-sands",name:"Emerald Sands",url:D_,category:"outdoor"},{id:"outdoor-ferris-field",name:"Ferris Field",url:z_,category:"outdoor"},{id:"outdoor-lagoon-bow",name:"Lagoon Bow",url:B_,category:"outdoor"},{id:"outdoor-lake-row",name:"Lake Row",url:U_,category:"outdoor"},{id:"outdoor-midnight-curb",name:"Midnight Curb",url:V_,category:"outdoor"},{id:"outdoor-night-rebel",name:"Night Rebel",url:q_,category:"outdoor"},{id:"outdoor-ocean-flight",name:"Ocean Flight",url:H_,category:"outdoor"},{id:"outdoor-ocean-veil",name:"Ocean Veil",url:G_,category:"outdoor"},{id:"outdoor-pool-peace",name:"Pool Peace",url:W_,category:"outdoor"},{id:"outdoor-sky-knit",name:"Sky Knit",url:Y_,category:"outdoor"},{id:"outdoor-yellow-beach",name:"Yellow Beach",url:K_,category:"outdoor"},{id:"selfie-brown-curve",name:"Brown Curve",url:Q_,category:"selfie"},{id:"selfie-cloud-journey",name:"Cloud Journey",url:J_,category:"selfie"},{id:"selfie-cop-girl",name:"Cop Girl",url:X_,category:"selfie"},{id:"selfie-gym-mirror",name:"Gym Mirror",url:Z_,category:"selfie"},{id:"selfie-gym-reflection",name:"Gym Reflection",url:e0,category:"selfie"},{id:"selfie-hot-nurse",name:"Hot Nurse",url:t0,category:"selfie"},{id:"selfie-luxury-boutique",name:"Luxury Boutique",url:r0,category:"selfie"},{id:"selfie-mirror-glow",name:"Mirror Glow",url:s0,category:"selfie"},{id:"selfie-modern-muse",name:"Modern Muse",url:i0,category:"selfie"},{id:"selfie-neon-glow",name:"Neon Glow",url:n0,category:"selfie"},{id:"selfie-pink-bouquet",name:"Pink Bouquet",url:a0,category:"selfie"},{id:"selfie-police-girl",name:"Police Girl",url:o0,category:"selfie"}
76,{id:"selfie-pre-gym",name:"Pre Gym",url:l0,category:"selfie"},{id:"selfie-sexy-nurse",name:"Sexy Nurse",url:c0,category:"selfie"},{id:"selfie-wet-baddie",name:"Wet Baddie",url:u0,category:"selfie"}],d0={casual:Ps.find(t=>t.category==="casual"),hot:Ps.find(t=>t.category==="hot"),outdoor:Ps.find(t=>t.category==="outdoor"),selfie:Ps.find(t=>t.category==="selfie")},Jl=["casual","hot","selfie","outdoor"],h0=()=>{const t=_.useRef(null),{scrollYProgress:e}=hc({target:t,offset:["start start","end end"]}),r=d0,[s,i]=_.useState(0),n=dh(e,[0,1],["33.33vw","-66.66vw"]),a=[0,.333,.666,1];return pc(e,"change",o=>{let l=0,u=Math.abs(o-a[0]);for(let d=1;d<a.length;d++){const h=Math.abs(o-a[d]);h<u&&(u=h,l=d)}l!==s&&i(l)}),c.jsx("section",{ref:t,className:"relative bg-primary h-[300vh]",children:c.jsx("div",{className:"sticky top-16 h-[calc(100vh-4rem)] overflow-hidden",children:c.jsxs("div",{className:"relative flex h-full items-center justify-center text-primary-foreground",children:[c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(50% 50% at 50% 50%, hsl(0 0% 100% / 0.10), transparent 70%)"}}),c.jsx("p",{className:"absolute left-1/2 top-8 z-30 -translate-x-1/2 whitespace-nowrap font-sans text-xs font-semibold uppercase tracking-[0.3em] text-primary-foreground/85 sm:top-12 sm:text-sm",children:"Any vibe, any scene"}),c.jsxs("div",{className:"pointer-events-none absolute left-1/2 top-1/2 z-10 aspect-[9/16] w-[180px] -translate-x-1/2 -translate-y-1/2 sm:w-[220px] lg:w-[280px]",children:[c.jsx("div",{className:"relative h-full w-full",children:c.jsx(fc,{children:(()=>{const o=Jl[s],l=r[o];return c.jsx(ue.div,{initial:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.06},transition:{duration:.45,ease:[.22,1,.36,1]},className:"absolute inset-0 overflow-hidden rounded-2xl shadow-[0_30px_80px_-20px_rgba(0,0,0,0.55)] ring-1 ring-white/15",children:c.jsx("img",{src:l.url,alt:o,className:"absolute inset-0 h-full w-full object-cover",draggable:!1})},`photo-${s}-${l.id}`)})()})}),c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -bottom-8 left-1/2 h-14 w-3/4 -translate-x-1/2 rounded-full bg-white/20 blur-3xl"})]}),c.jsx("div",{className:"relative z-20 w-full overflow-visible",children:c.jsx(ue.div,{className:"flex w-max",style:{x:n,willChange:"transform"},children:Jl.map((o,l)=>c.jsx("div",{className:"flex w-[33.333vw] flex-shrink-0 items-center justify-center px-2 sm:px-6",children:c.jsx(ue.span,{animate:{opacity:l===s?1:.32,scale:l===s?1:.78},transition:{duration:.45},className:"block font-display font-bold uppercase tracking-tight text-primary-foreground",style:{fontSize:"clamp(22px, 5vw, 92px)",lineHeight:1,whiteSpace:"nowrap",textShadow:l===s?"0 4px 30px rgba(0,0,0,0.35)":"none"},children:o})},o))})})]})})})},Vn=({children:t,delay:e=0,className:r,as:s="div"})=>{const i=s,n=_.useRef(null),[a,o]=_.useState(!1);return _.useEffect(()=>{const l=n.current;if(!l)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){o(!0);return}const u=new IntersectionObserver(([d])=>{d.isIntersecting&&(o(!0),u.disconnect())},{threshold:.12});return u.observe(l),()=>u.disconnect()},[]),c.jsx(i,{ref:n,className:r,style:{opacity:a?1:0,transform:a?"translateY(0)":"translateY(28px)",transition:`opacity 700ms cubic-bezier(0.16, 1, 0.3, 1) ${e}ms, transform 700ms cubic-bezier(0.16, 1, 0.3, 1) ${e}ms`},children:t})},rn=()=>{const{isAuthenticated:t}=Qs();return t?"/app/templates":"/start-free"},p0=()=>{const t=rn();return c.jsx("section",{className:"relative isolate overflow-hidden bg-background py-14 lg:py-20","aria-labelledby":"final-cta-heading",children:c.jsxs("div",{className:"container flex flex-col items-center text-center",children:[c.jsx(Vn,{children:c.jsx("h2",{id:"final-cta-heading",className:"max-w-3xl font-display text-[40px] font-bold leading-[1.05] tracking-tight text-foreground sm:text-[56px] lg:text-[64px]",children:"Ready to build your AI influencer?"})}),c.jsx(Vn,{delay:100,children:c.jsx("p",{className:"mt-6 max-w-xl font-sans text-[18px] text-text-secondary",children:"Join thousands of creators already using BeModel."})}),c.jsx(Vn,{delay:180,children:c.jsx(Oe,{size:"lg",asChild:!0,className:"mt-10",children:c.jsx(Ne,{to:t,children:"Create Your Avatar Free"})})})]})})};function Wi({className:t,...e}){return c.jsx("div",{className:pe("rounded-md skeleton-shimmer",t),...e})}const f0=t=>{const e=[...t];for(let r=e.length-1;r>0;r--){const s=Math.floor(Math.random()*(r+1));[e[r],e[s]]=[e[s],e[r]]}return e},sn=t=>({photos:_.useMemo(()=>{const r=f0(Ps);return t>=r.length?r:r.slice(0,t)},[t]),loading:!1}),g0="/assets/ava-thompson-Da0DwdjL.webp",Kd="/assets/chloe-bennett-mnrIixH1.webp",Qd="/assets/emma-walker-CjvJAFUQ.webp",Jd="/assets/maya-brooks-9EUXpqvL.webp",v0="/assets/mia-lee-DYW5bgne.webp",js=6,Xd=8,m0=js*Xd,qn=[{name:"Emma Walker",followers:"814k",image:Qd},{name:"Maya Brooks",followers:"723k",image:Jd},{name:"Chloe Bennett",followers:"892k",image:Kd},{name:"Ava Thompson",followers:"645k",image:g0},{name:"Mia Lee",followers:"558k",image:v0}],_0=()=>{const t=rn(),{photos:e,loading:r}=sn(m0),s=_.useMemo(()=>
76{if(e.length===0)return Array.from({length:js},()=>[]);const i=Array.from({length:js},()=>[]);for(let n=0;n<js*Xd;n++)i[n%js].push(e[n%e.length]);return i},[e]);return c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"relative flex h-[calc(100svh-4rem)] flex-col overflow-hidden bg-background",children:[c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-[700px]",style:{background:"radial-gradient(60% 50% at 50% 0%, hsl(var(--primary) / 0.10), transparent 70%)"}}),c.jsxs("div",{className:"container relative flex min-h-0 flex-1 flex-col pb-4 pt-3 sm:pb-6 sm:pt-5",children:[c.jsxs("div",{className:"mx-auto flex w-full max-w-5xl items-center justify-center gap-5 lg:gap-12",children:[c.jsx(ue.p,{initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{duration:.55,delay:.25},className:"hidden w-44 shrink-0 text-right font-sans text-sm font-medium leading-snug text-text-secondary lg:block lg:text-base",children:"Create your personalized avatar in seconds."}),c.jsxs(ue.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:.05},className:"whitespace-nowrap text-center font-display font-bold tracking-tight text-foreground",style:{fontSize:"clamp(32px, 4.8vw, 60px)",lineHeight:1.02},children:[c.jsx("span",{className:"font-script font-bold text-primary",style:{fontSize:"1.18em",lineHeight:.85},children:"Y"}),c.jsx("span",{children:"OUR AI"}),c.jsx("br",{}),c.jsx("span",{children:"CONTENT STUDIO"})]}),c.jsx(ue.p,{initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{duration:.55,delay:.3},className:"hidden w-44 shrink-0 text-left font-sans text-sm font-medium leading-snug text-text-secondary lg:block lg:text-base",children:"Generate your avatar in any pose, outfit or scene â photo or video."})]}),c.jsxs(ue.div,{initial:{opacity:0}
76,animate:{opacity:1},transition:{duration:.9,delay:.3},className:"relative mx-auto mt-3 min-h-0 w-full max-w-[1100px] flex-1 overflow-hidden rounded-[28px] sm:mt-4",children:[c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 z-10 h-20 bg-gradient-to-b from-background to-transparent sm:h-24"}),c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-20 bg-gradient-to-t from-background to-transparent sm:h-24"}),c.jsx("div",{className:"grid h-full grid-cols-3 gap-2 sm:grid-cols-6 sm:gap-3",children:s.map((i,n)=>c.jsx(y0,{photos:i,loading:r,direction:n%2===0?"up":"down",durationSec:32+n*3,className:n>=3?"hidden sm:flex":void 0},n))}),c.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center px-4",children:c.jsx(ue.div,{initial:{opacity:0,scale:.94},animate:{opacity:1,scale:1},transition:{duration:.6,delay:.55},className:"pointer-events-auto",children:c.jsx(Oe,{asChild:!0,size:"lg",className:"h-12 px-7 text-sm font-bold tracking-wide shadow-[0_20px_60px_-10px_hsl(var(--primary)/0.65),0_0_0_6px_hsl(var(--background)/0.65)] transition-transform duration-200 hover:scale-[1.04] sm:h-14 sm:px-9 sm:text-base",children:c.jsx(Ne,{to:t,children:"START FOR FREE"})})})})]})]})]}),c.jsx("section",{className:"hidden bg-background sm:block sm:pb-16 sm:pt-14",children:c.jsxs("div",{className:"container",children:[c.jsx("p",{className:"text-center font-sans text-xs font-semibold uppercase tracking-[0.22em] text-text-secondary",children:"Loved by creators worldwide"}),c.jsx("div",{className:"mt-6",children:c.jsx(b0,{})})]})})]})},y0=({photos:t,loading:e,direction:r,durationSec:s,className:i})=>{if(e||t.length===0)return c.jsx("div",{className:pe("flex flex-col gap-2 sm:gap-3",i),children:Array.from({length:4}).map((o,l)=>c.jsx(Wi,{className:"aspect-[9/16] w-full rounded-xl"},l))});const n=[...t,...t],a=r==="up"?{y:["0%","-50%"]}:{y:["-50%","0%"]};return c.jsx(ue.div,{className:pe("flex flex-col gap-2 sm:gap-3",i),animate:a,transition:{duration:s,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:n.map((o,l)=>c.jsx("div",{className:"relative aspect-[9/16] w-full overflow-hidden rounded-lg bg-background-secondary shadow-[0_8px_30px_-15px_rgba(15,29,48,0.35)]",children:c.jsx("img",{src:o.url,alt:o.name,loading:l<3?"eager":"lazy",fetchPriority:l<3?"high":"low",decoding:"async",className:"absolute inset-0 h-full w-full object-cover",draggable:!1})},`${o.id}-${l}`))})},b0=()=>{const t=[...qn,...qn,...qn];return c.jsx("div",{className:"relative overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_6%,black_94%,transparent)]",children:c.jsx(ue.div,{className:"flex w-max gap-4",animate:{x:["0%",`-${100/3}%`]},transition:{duration:45,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:t.map((e,r)=>c.jsx(x0,{chip:e},r))})})},x0=({chip:t})=>c.jsxs("div",{className:"flex w-44 shrink-0 flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-[0_12px_30px_-12px_rgba(15,29,48,0.18)] sm:w-52",children:[c.jsx("div",{className:"relative aspect-[4/5] w-full overflow-hidden bg-background-tertiary",children:t.image?c.jsx("img",{src:t.image,alt:t.name,className:"absolute inset-0 h-full w-full object-cover",style:{objectPosition:"center 22%"},loading:"lazy",draggable:!1}):c.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c.jsx("span",{className:"font-sans text-xs text-text-secondary",children:"coming soon"})})}),c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-3",children:[t.image?c.jsx("img",{src:t.image,alt:"",className:"h-9 w-9 shrink-0 rounded-full object-cover",style:{objectPosition:"center top"},"aria-hidden":!0,draggable:!1}):c.jsx("div",{className:"h-9 w-9 shrink-0 rounded-full bg-background-tertiary","aria-hidden":!0}),c.jsxs("div",{className:"flex min-w-0 flex-col",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"truncate font-sans text-sm font-semibold text-foreground",children:t.name}),c.jsx(Ya,{className:"h-3 w-3 shrink-0 text-primary",strokeWidth:2.5})]}),c.jsxs("span",{className:"font-sans text-xs text-text-secondary",children:[t.followers," followers"]})]})]})]}),Xl=[{number:"01",title:"Create your avatar",body:c.jsx(c.Fragment,{children:"Upload 3 photos (face, torso, body) â or design every detail from scratch: ethnicity, body type, breast size, facial features, scars, freckles, birthmarks. Ready fast."})},{number:"02",title:"Pick a scene",body:c.jsx(c.Fragment,{children:"Browse 500+ templates across casual, hot, selfie and outdoor. One click â no prompts, no editing."})},{number:"03",title:"Generate photo or video",body:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-semibold text-primary",children:"Nano Banana Pro"})," +"," ",c.jsx("span",{className:"font-semibold text-primary",children:"Kling v2.6 Pro"})," â photos render in seconds (1 credit), 5-second videos in a moment (5 credits). Download in high-res. Your avatar identity stays locked across every generation."]})}],w0=()=>{const t=_.useRef(null),e=rn(),{scrollYProgress:r}=hc({target:t,offset:["start start","end end"]}),[s,i]=_.useState(0),{photos:n}=sn(10),a=[0,.5,1];return pc(r,"change",o=>{let l=0,u=Math.abs(o-a[0]);for(let d=1;d<a.length;d++){const h=Math.abs(o-a[d]);h<u&&(u=h,l=d)}l!==s&&i(l)}),c.jsxs(c.Fragment,{children:[c.jsx("section",{ref:t,className:"relative hidden h-[260vh] bg-background lg:block",children:c.jsx("div",{className:"sticky top-16 h-[calc(100vh-4rem)] overflow-hidden",children:c.jsxs("div",{className:"container flex h-full min-h-0 flex-col py-4 lg:py-6",children:[c.jsxs("div",{className:"shrink-0 text-center",children:[c.jsx("h2",{className:"font-display font-bold tracking-tight text-foreground",style:{fontSize:"clamp(28px, 3.6vw, 48px)",lineHeight:1.05},children:"How it works."}),c.jsx("p",{className:"mt-2 font-sans text-xs text-text-secondary sm:text-sm",children:"Your first photo in seconds. Video in moments."})]}),c.jsxs("div",{className:"mt-4 grid min-h-0 flex-1 grid-cols-[1fr_1fr] items-center gap-8 overflow-hidden lg:mt-6 lg:gap-10",children:[c.jsx("div",{className:"flex h-full flex-col justify-center gap-3 overflow-hidden lg:gap-4",children:Xl.map((o,l)=>c.jsx(Zl,{step:o,isActive:l===s,onClick:()=>i(l)},l))}),c.jsx("div",{className:"relative mx-auto flex h-full w-full max-w-md items-center justify-center overflow-hidden",children:c.jsxs(fc,{mode:"wait",children:[s===0&&c.jsx(ec,{photo:n[9]},"create"),s===1&&c.jsx(tc,{photos:n.slice(0,9)},"pick"),s===2&&c.jsx(rc,{photo:n[0]},"generate")]})})]}),c.jsx("div",{className:"mt-3 flex shrink-0 justify-center lg:mt-4",children:c.jsx(Oe,{asChild:!0,size:"lg",className:"h-11 px-7 text-sm font-bold sm:h-12",children:c.jsx(Ne,{to:e,children:"Start free trial â"})})})]})})}),c.jsx("section",{className:"bg-background py-14 lg:hidden",children:c.jsxs("div",{className:"container",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h2",{className:"font-display font-bold tracking-tight text-foreground",style:{fontSize:"clamp(30px, 7vw, 44px)",lineHeight:1.05},children:"How it works."}),c.jsx("p",{className:"mt-3 font-sans text-sm text-text-secondary sm:text-base",children:"Your first photo in seconds. Video in moments."})]}),c.jsx("div",{className:"mt-10 flex flex-col gap-12",children:Xl.map((o,l)=>c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx(Zl,{step:o,isActive:!0}),c.jsxs("div",{className:"mx-auto flex aspect-square w-full max-w-sm items-center justify-center",children:[l===0&&c.jsx(ec,{photo:n[9]}),l===1&&c.jsx(tc,{photos:n.slice(0,9)}),l===2&&c.jsx(rc,{photo:n[0]})]})]},l))}),c.jsx("div",{className:"mt-12 flex justify-center",children:c.jsx(Oe,{asChild:!0,size:"lg",className:"h-12 px-8 text-sm font-bold",children:c.jsx(Ne,{to:e,children:"Start free trial â"})})})]})})]})},Zl=({step:t,isActive:e,onClick:r})=>
76c.jsxs(ue.button,{type:"button",onClick:r,animate:{opacity:e?1:.4,scale:e?1:.96},transition:{duration:.4,ease:[.22,1,.36,1]},className:"flex w-full gap-3 text-left lg:gap-4",style:{transformOrigin:"left center"},children:[c.jsx("span",{className:"font-script font-bold leading-none text-primary",style:{fontSize:"clamp(40px, 3.6vw, 60px)",lineHeight:.85},children:t.number}),c.jsxs("div",{className:"flex-1 pt-0.5",children:[c.jsx("h3",{className:"font-display text-base font-bold uppercase tracking-tight text-foreground sm:text-lg lg:text-xl",children:t.title}),c.jsx("p",{className:"mt-1.5 font-sans text-xs leading-snug text-text-secondary sm:text-sm",children:t.body})]})]}),po={initial:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.04},transition:{duration:.45,ease:[.22,1,.36,1]}},E0=[{label:"Ethnicity: Latina",pos:{top:"5%",left:"2%"}},{label:"Body: Athletic",pos:{top:"26%",right:"2%"}},{label:"Breast: Medium",pos:{top:"48%",left:"2%"}},{label:"Hair: Black wavy",pos:{top:"68%",right:"2%"}},{label:"Freckles",pos:{bottom:"5%",left:"35%"}}],ec=({photo:t})=>c.jsxs(ue.div,{...po,className:"relative flex h-full max-h-full w-full items-center justify-center",children:[c.jsx("div",{className:"relative aspect-[9/16] h-[80%
76] max-h-full overflow-hidden rounded-2xl shadow-[0_30px_80px_-20px_rgba(15,29,48,0.35)] ring-1 ring-border",children:t!=null&&t.url?c.jsx("img",{src:t.url,alt:"",className:"absolute inset-0 h-full w-full object-cover",style:{objectPosition:"center top"},"aria-hidden":!0}):c.jsx("div",{className:"absolute inset-0 bg-background-secondary"})}),E0.map((e,r)=>c.jsxs(ue.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.45,delay:.25+r*.08},className:"absolute flex items-center gap-1 whitespace-nowrap rounded-full border border-border bg-card px-2 py-1 shadow-[0_8px_24px_-10px_rgba(15,29,48,0.25)]",style:e.pos,children:[c.jsx(Qc,{className:"h-2.5 w-2.5 text-primary",strokeWidth:2.5}),c.jsx("span",{className:"font-sans text-[10px] font-medium text-foreground sm:text-[11px]",children:e.label})]},e.label))]}),tc=({photos:t})=>{const e=Array.from({length:9},(s,i)=>t[i%Math.max(t.length,1)]),r=4;return c.jsx(ue.div,{...po,className:"grid h-[80%] max-h-full w-auto max-w-full grid-cols-3 gap-2",style:{aspectRatio:"1 / 1"},children:e.map((s,i)=>c.jsxs("div",{className:pe("relative aspect-square overflow-hidden rounded-lg bg-background-secondary",i===r?"shadow-[0_0_0_3px_hsl(var(--primary)),0_15px_40px_-10px_hsl(var(--primary)/0.45)] z-10":"shadow-sm"),children:[(s==null?void 0:s.url)&&c.jsx("img",{src:s.url,alt:"",className:"absolute inset-0 h-full w-full object-cover","aria-hidden":!0}),i===r&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-primary/15",children:c.jsx(Ya,{className:"h-8 w-8 text-primary",strokeWidth:2.5,fill:"white"})})]},i))})},rc=({photo:t})=>c.jsxs(ue.div,{...po,className:"relative flex h-full max-h-full w-full flex-col items-center justify-center gap-2 sm:gap-3",children:[c.jsxs(ue.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},className:"flex max-w-full shrink-0 items-center gap-1 rounded-full bg-primary px-2.5 py-1 text-primary-foreground shadow-[0_10px_30px_-10px_hsl(var(--primary)/0.6)]",children:[c.jsx(Qc,{className:"h-3 w-3 shrink-0",strokeWidth:2.5}),c.jsx("span",{className:"truncate font-sans text-[10px] font-bold uppercase tracking-wider sm:text-[11px]",children:"Powered by Nano Banana Pro"})]}),c.jsx("div",{className:"relative aspect-[9/16] min-h-0 flex-1 overflow-hidden rounded-2xl shadow-[0_30px_80px_-20px_rgba(15,29,48,0.45)] ring-1 ring-border",children:t!=null&&t.url?c.jsx("img",{src:t.url,alt:"",className:"absolute inset-0 h-full w-full object-cover","aria-hidden":!0}):c.jsx("div",{className:"absolute inset-0 bg-background-secondary"})}),c.jsxs(ue.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.5,delay:.45},className:"flex shrink-0 items-center gap-2",children:[c.jsx("span",{className:"rounded-full border border-border bg-card px-3 py-1.5 font-sans text-xs font-semibold text-text-secondary",children:"4:5"}),c.jsx("span",{className:"rounded-full border border-primary bg-primary/10 px-3 py-1.5 font-sans text-xs font-bold text-primary",children:"9:16"}),c.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-foreground px-3 py-1.5 text-background",children:[c.jsx(Mf,{className:"h-3 w-3",strokeWidth:2.5}),c.jsx("span",{className:"font-sans text-xs font-bold uppercase tracking-wider",children:"PNG"})]})]})]}),fo=[{quote:"My feed looks like a magazine.",quoteLong:"Honestly insane. My feed looks like a magazine now.",name:"Emma Walker",followers:"814k",image:Qd},{quote:"Idea to post in seconds.",quoteLong:"From idea to post in seconds.",name:"Chloe Bennett",followers:"892k",image:Kd},{quote:"Easiest tool I've ever used.",quoteLong:"This is the easiest content tool I've ever used.",name:"Maya Brooks",followers:"723k",image:Jd}],S0=24,bs=8,k0=()=>{const{photos:t,loading:e}
76=sn(S0),r=P0(t.slice(0,bs)),s=j0(t.slice(bs,bs*2)),i=C0(t.slice(bs*2,bs*3));return c.jsxs("section",{className:"relative bg-background py-14 lg:py-20",children:[c.jsxs("div",{className:"container mb-8 text-center lg:mb-12",children:[c.jsx(ue.h2,{initial:{opacity:0,y:18},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.4},transition:{duration:.6},className:"font-display font-bold tracking-tight text-foreground",style:{fontSize:"clamp(28px, 4vw, 48px)",lineHeight:1.05},children:"Look what your avatar can do."}),c.jsx(ue.p,{initial:{opacity:0,y:14},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.4},transition:{duration:.55,delay:.15},className:"mx-auto mt-3 hidden max-w-xl font-sans text-sm text-text-secondary sm:block sm:text-base",children:"Hundreds of styles. Endless scenes. Real outputs from real BeModel avatars."})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[c.jsx(Hn,{tiles:r,loading:e,direction:"left",durationSec:60}),c.jsx(Hn,{tiles:s,loading:e,direction:"right",durationSec:75}),c.jsx(Hn,{tiles:i,loading:e,direction:"left",durationSec:90,className:"hidden md:block"})]})]})},P0=t=>[{kind:"photo",photo:t[0]},{kind:"photo",photo:t[1]},{kind:"tag",category:"casual"},{kind:"photo",photo:t[2]},{kind:"photo",photo:t[3]},{kind:"testimonial",testimonial:fo[0]},{kind:"photo",photo:t[4]},{kind:"photo",photo:t[5]},{kind:"tag",category:"hot"},{kind:"photo",photo:t[6]},{kind:"photo",photo:t[7]}],j0=t=>[{kind:"photo",photo:t[0]},{kind:"testimonial",testimonial:fo[1]},{kind:"photo",photo:t[1]},{kind:"photo",photo:t[2]},{kind:"tag",category:"selfie"},{kind:"photo",photo:t[3]},{kind:"photo",photo:t[4]},{kind:"photo",photo:t[5]},{kind:"photo",photo:t[6]},{kind:"photo",photo:t[7]}],C0=t=>[{kind:"photo",photo:t[0]},{kind:"photo",photo:t[1]},{kind:"photo",photo:t[2]},{kind:"tag",category:"outdoor"},{kind:"photo",photo:t[3]},{kind:"testimonial",testimonial:fo[2]},{kind:"photo",photo:t[4]},{kind:"photo",photo:t[5]},{kind:"photo",photo:t[6]},{kind:"photo",photo:t[7]}],Hn=({tiles:t,loading:e,direction:r,durationSec:s,className:i})=>{if(e||t.some(o=>o.kind==="photo"&&!o.photo))return c.jsx("div",{className:pe("relative h-52 overflow-hidden sm:h-56 [mask-image:linear-gradient(to_right,transparent,black_4%,black_96%,transparent)]",i),children:c.jsx("div",{className:"flex h-full gap-3 px-3 sm:gap-4 sm:px-4",children:Array.from({length:10}).map((o,l)=>c.jsx(Wi,{className:"aspect-[9/16] h-full shrink-0 rounded-xl"},l))})});const n=[...t,...t],a=r==="left"?{x:["0%","-50%"]}:{x:["-50%","0%"]};return c.jsx("div",{className:pe("relative h-52 overflow-hidden sm:h-56 [mask-image:linear-gradient(to_right,transparent,black_4%,black_96%,transparent)]",i),children:c.jsx(ue.div,{className:"flex h-full w-max gap-3 sm:gap-4",animate:a,transition:{duration:s,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:n.map((o,l)=>c.jsx(T0,{tile:o},l))})})},T0=({tile:t})=>t.kind==="photo"?c.jsx(R0,{photo:t.photo}):t.kind==="testimonial"?c.jsx(N0,{testimonial:t.testimonial}):c.jsx(A0,{category:t.category}),R0=({photo:t})=>c.jsx("div",{className:"group relative aspect-[9/16] h-full shrink-0 overflow-hidden rounded-xl bg-background-secondary shadow-[0_8px_30px_-15px_rgba(15,29,48,0.25)]",children:c.jsx("img",{src:t.url,alt:t.name,loading:"lazy",className:"absolute inset-0 h-full w-full object-cover transition-transform duration-500 ease-out group-hover:scale-[1.04]",draggable:!1})}),N0=({testimonial:t})=>c.jsxs("div",{className:"flex aspect-[3/2] h-full shrink-0 flex-col justify-between overflow-hidden rounded-xl bg-primary p-3 text-primary-foreground shadow-[0_12px_40px_-15px_hsl(var(--primary)/0.5)] sm:aspect-[2/1] sm:p-5",children:[c.jsxs("p",{className:"font-display text-sm font-bold leading-snug sm:text-base lg:text-lg",style:{textWrap:"balance"},children:[c.jsxs("span",{className:"sm:hidden",children:["â",t.quote,"â"]}),c.jsxs("span",{className:"hidden sm:inline",children:["â",t.quoteLong,"â"]})]}),c.jsxs("div",{className:"mt-3 flex items-center gap-2.5",children:[c.jsx("img",{src:t.image,alt:"",className:"h-8 w-8 shrink-0 rounded-full object-cover ring-2 ring-white/30",style:{objectPosition:"center top"},"aria-hidden":!0,draggable:!1}),c.jsxs("div",{className:"flex min-w-0 flex-col",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"truncate font-sans text-xs font-semibold sm:text-sm",children:t.name}),c.jsx(Ya,{className:"h-3 w-3 shrink-0 text-white",strokeWidth:2.5})]}),c.jsxs("span",{className:"font-sans text-[11px] text-white/80 sm:text-xs",children:[t.followers," followers"]})]})]})]}),A0=({category:t})=>c.jsx("div",{className:"relative flex aspect-[3/4] h-full shrink-0 items-center justify-center overflow-hidden rounded-xl bg-primary p-3 shadow-[0_10px_36px_-15px_hsl(var(--primary)/0.55)] sm:aspect-square",children:c.jsx("span",{className:"text-center font-display font-bold uppercase tracking-tight text-primary-foreground",style:{fontSize:"clamp(18px, 2vw, 28px)",lineHeight:.95},children:t})}),O0=[{x:6,y:8,size:20,delay:0},{x:22,y:28,size:14,delay:.5},{x:92,y:6,size:22,delay:.9},{x:96,y:38,size:16,delay:1.4},{x:4,y:46,size:18,delay:.3},{x:14,y:70,size:24,delay:1.1},{x:88,y:64,size:18,delay:.7},{x:98,y:88,size:14,delay:1.6},{x:50,y:96,size:20,delay:1},{x:30,y:90,size:16,delay:.4},{x:72,y:32,size:12,delay:1.8},{x:60,y:4,size:16,delay:1.2}],I0=()=>{const t=rn(),{photos:e,loading:r}=sn(2);return c.jsxs("section",{className:"relative flex min-h-[100svh] flex-col justify-center overflow-hidden bg-primary py-6 text-primary-foreground sm:block sm:min-h-0 sm:py-20 lg:py-28",children:[c.jsx("div",{"aria-hidden":!0,
76className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(60% 60% at 70% 50%, hsl(0 0% 100% / 0.12), transparent 70%)"}}),c.jsxs("div",{className:"container relative grid items-center gap-6 sm:gap-14 lg:grid-cols-[1fr_1fr] lg:gap-16",children:[c.jsxs("div",{className:"text-center lg:text-left",children:[c.jsxs(ue.h2,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.3},transition:{duration:.7},className:"font-script font-bold tracking-tight text-primary-foreground leading-[0.95] sm:leading-[0.92]",style:{fontSize:"clamp(44px, 9vw, 124px)"},children:["Ready, set,",c.jsx("br",{}),"generate."]}),c.jsx(ue.p,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.3},transition:{duration:.55,delay:.2},className:"mx-auto mt-3 max-w-md font-sans text-sm text-primary-foreground/90 sm:mt-6 sm:text-lg lg:mx-0",children:"Pose, outfit, scene â photo or video, done in one tap."}),c.jsx(ue.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.3},transition:{duration:.55,delay:.35},className:"mt-4 flex justify-center sm:mt-8 lg:justify-start",children:c.jsx(Oe,{asChild:!0,size:"lg",className:"h-11 bg-foreground px-6 text-sm font-bold tracking-wide text-background shadow-[0_20px_60px_-15px_rgba(0,0,0,0.45)] transition-transform duration-200 hover:scale-[1.04] hover:bg-foreground
76/90 sm:h-14 sm:px-9 sm:text-base",children:c.jsx(Ne,{to:t,children:"START FOR FREE"})})})]}),c.jsxs("div",{className:"relative mx-auto w-full max-w-[280px] sm:max-w-md lg:max-w-lg",children:[c.jsx(F0,{photos:e,loading:r}),c.jsx("div",{className:"pointer-events-none absolute inset-0",children:O0.map((s,i)=>c.jsx(L0,{spec:s},i))})]})]})]})},F0=({photos:t,loading:e})=>c.jsxs("div",{className:"relative flex flex-col items-stretch",children:[c.jsx("div",{className:"w-[55%] self-start",style:{transform:"translateX(-4%) rotate(-3deg)"},children:c.jsx(ue.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.3},transition:{duration:.7,delay:.1},className:"relative aspect-[4/5] overflow-hidden rounded-2xl bg-white/10 shadow-[0_30px_80px_-20px_rgba(0,0,0,0.55)] ring-1 ring-white/15",children:e||!t[0]?c.jsx(Wi,{className:"h-full w-full bg-white/15"}):c.jsx(ue.img,{src:t[0].url,alt:"",className:"absolute inset-0 h-full w-full object-cover",animate:{y:[0,-6,0]},transition:{duration:5.5,repeat:1/0,ease:"easeInOut"},draggable:!1,"aria-hidden":!0})})}),c.jsx("div",{className:"w-[68%] self-end",style:{marginTop:"-14%",transform:"translateX(6%) rotate(4deg)"},children:c.jsx(ue.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.3},transition:{duration:.7,delay:.3},className:"relative aspect-[4/5] overflow-hidden rounded-2xl bg-white/10 shadow-[0_36px_90px_-20px_rgba(0,0,0,0.6)] ring-1 ring-white/15",children:e||!t[1]?c.jsx(Wi,{className:"h-full w-full bg-white/15"}):c.jsx(ue.img,{src:t[1].url,alt:"",className:"absolute inset-0 h-full w-full object-cover",animate:{y:[0,8,0]},transition:{duration:6,repeat:1/0,ease:"easeInOut",delay:.4},draggable:!1,"aria-hidden":!0})})}),c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -bottom-6 left-1/2 h-14 w-3/4 -translate-x-1/2 rounded-full bg-white/25 blur-3xl"})]}),L0=({spec:t})=>c.jsx(ue.svg,{initial:{opacity:0,scale:.3},animate:{opacity:[0,1,0],scale:[.4,1,.4],rotate:[0,45,0]},transition:{duration:2.2,repeat:1/0,delay:t.delay,ease:"easeInOut"},width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"white",className:"pointer-events-none absolute",style:{left:`${t.x}%`,top:`${t.y}%`,marginLeft:`-${t.size/2}px`,marginTop:`-${t.size/2}px`,filter:"drop-shadow(0 0 6px rgba(255,255,255,0.55))"},children:c.jsx("path",{d:"M12 0 L13.7 10.3 L24 12 L13.7 13.7 L12 24 L10.3 13.7 L0 12 L10.3 10.3 Z"})}),M0=({title:t,description:e,canonical:r,ogImage:s,noindex:i})=>(_.useEffect(()=>{document.title=t;const n=(a,o)=>{let l=document.head.querySelector(a);l||(l=document.createElement("meta"),Object.entries(o).forEach(([u,d])=>{u!=="content"&&l.setAttribute(u,d)}),document.head.appendChild(l)),l.setAttribute("content",o.content)};if(n('meta[name="description"]',{name:"description",content:e}),n('meta[property="og:title"]',{property:"og:title",content:t}),n('meta[property="og:description"]',{property:"og:description",content:e}),n('meta[property="og:type"]',{property:"og:type",content:"website"}),n('meta[name="twitter:title"]',{name:"twitter:title",content:t}),n('meta[name="twitter:description"]',{name:"twitter:description",content:e}),r){n('meta[property="og:url"]',{property:"og:url",content:r});let a=document.head.querySelector('link[rel="canonical"]');a||(a=document.createElement("link"),a.setAttribute("rel","canonical"),document.head.appendChild(a)),a.setAttribute("href",r)}s&&(n('meta[property="og:image"]',{property:"og:image",content:s}),n('meta[name="twitter:image"]',{name:"twitter:image",content:s})),n('meta[name="robots"]',{name:"robots",content:i?"noindex, nofollow":"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"})},[t,e,r,s,i]),null),$0=()=>c.jsxs(Yd,{children:[c.jsx(M0,{title:"BeModel â AI Influencer Generator: Photos & Videos in One Click",description:"Create your own AI influencer in one click: design a custom AI avatar, then generate hyper-realistic photos and videos of it from 500+ templates or your own prompt. Made for Instagram & TikTok creators â no AI skills needed.",canonical:"https://bemodel.ai/"}),c.jsx(_0,{}),c.jsx(k0,{}),c.jsx(I0,{}),c.jsx(w0,{}),c.jsx(h0,{}),c.jsx(p0,{})]}),D0=()=>{const t=xt();return _.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),c.jsx(Yd,{children:c.jsxs("section",{className:"container flex min-h-[60vh] flex-col items-center justify-center py-24 text-center",children:[c.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.2em] text-text-secondary",children:"Error 404"}),c.jsx("h1",{className:"mt-4 font-display text-5xl font-bold tracking-tight text-foreground",children:"Page not found"}),c.jsx("p",{className:"mt-4 max-w-md text-text-secondary",children:"The page you are looking for does not exist or has been moved."}),c.jsx(Oe,{asChild:!0,className:"mt-8",children:c.jsx(Ne,{to:"/",children:"Return home"})})]})})},sc=({to:t})=>{const e=xt();return c.jsx(xr,{to:{pathname:t,search:e.search,hash:e.hash},replace:!0})},z0=_.lazy(()=>U(()=>import("./Pricing-CaGzto4r.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),B0=_.lazy(()=>U(()=>import("./Templates-hzjjGpVW.js"),__vite__mapDeps([10,1,11,12,13,14,15,16,17,18,8,9]))),U0=_.lazy(()=>U(()=>import("./Login-dgnmimPN.js"),__vite__mapDeps([19,1,20,21,22,23,24,8,9]))),V0=_.lazy(()=>U(()=>import("./Register-XVFmFS2I.js"),__vite__mapDeps([25,1,20,21,22,26,23,24,8,9]))),q0=_.lazy(()=>U(()=>import("./ForgotPassword-DIEyaeaH.js"),__vite__mapDeps([27,1,20,21,26,23,24,8,9]))),H0=_.lazy(()=>U(()=>import("./StartFree-Bh-COuIw.js"),__vite__mapDeps([28,1,29,8,9]))),G0=_.lazy(()=>U(()=>import("./Watch-BmVrOEkB.js"),__vite__mapDeps([30,1,21,8,9]))),W0=_.lazy(()=>U(()=>import("./RefLanding-DthRtg7d.js"),__vite__mapDeps([31,1,32,8,9]))),Y0=_.lazy(()=>U(()=>import("./Privacy-B7A4JPxw.js"),__vite__mapDeps([33,1,8,9]))),K0=_.lazy(()=>U(()=>import("./Terms-DKhgqWBf.js"),__vite__mapDeps([34,1,8,9]))),Q0=_.lazy(()=>U(()=>import("./AppUpgrade-9K5oy-KR.js"),__vite__mapDeps([35,1,2,3,4,36,37,38,18,29,39,40,41,32,6,8,9]))),J0=_.lazy(()=>U(()=>import("./AffiliateDashboard-CHGkleI7.js"),__vite__mapDeps([42,1,43,44,45,6,46,47,8,9]))),X0=_.lazy(()=>U(()=>import("./AppLayout-BMTbM_ub.js"),__vite__mapDeps([48,1,16,38,18,49,8,39,40,4,9]))),Z0=_.lazy(()=>U(()=>import("./AppAvatar-4MTfFYFP.js"),__vite__mapDeps([50,1,38,18,4,51,15,6,8,29,52,53,54,21,9]))
76),ey=_.lazy(()=>U(()=>import("./AppGallery-Y5hFbAKs.js"),__vite__mapDeps([55,1,16,13,56,12,14,57,58,8,5,59,6,38,18,4,9]))),ty=_.lazy(()=>U(()=>import("./AppProfile-xeCOfnFo.js"),__vite__mapDeps([60,1,14,53,15,8,9]))),ry=_.lazy(()=>U(()=>import("./AppSubscriptionPage-BUEIWqdP.js"),__vite__mapDeps([61,1,62,21,4,2,3,36,37,38,18,8,63,41,39,40,5,6,9]))),sy=_.lazy(()=>U(()=>import("./AppAccountPage-CV-5cXv_.js"),__vite__mapDeps([64,1,49,8,38,18,62,21,45,56,4,9]))),iy=_.lazy(()=>U(()=>import("./AppSupportPage-BCYrz1zF.js"),__vite__mapDeps([65,1,62,21,23,66,6,4,7,8,5,9]))),ny=_.lazy(()=>U(()=>import("./AppCreate-CK5_8lHi.js"),__vite__mapDeps([67,1,38,18,4,68,8,9]))),ay=_.lazy(()=>U(()=>import("./AppTemplates-BxZFpMey.js"),__vite__mapDeps([69,1,16,13,8,41,14,68,57,38,18,17,63,53,54,9]))),oy=_.lazy(()=>U(()=>import("./AdminLayout-gK7gbXeq.js"),__vite__mapDeps([70,1,47,53,16,71,21,8,9]))),ly=_.lazy(()=>U(()=>import("./AdminOverview-DR6zXaBi.js"),__vite__mapDeps([72,1,4,73,40,74,23,43,44,37,16,8,9]))),cy=_.lazy(()=>U(()=>import("./AdminPrompts-S2UHF7ZL.js"),__vite__mapDeps([75,1,66,76,5,71,8,9]))),uy=_.lazy(()=>U(()=>import("./AdminTemplates-shIDLzli.js"),__vite__mapDeps([77,1,8,49,11,12,13,14,15,16,23,24,66,58,5,59,6,51,4,52,76,56,9]))),dy=_.lazy(()=>U(()=>import("./AdminUsers-B-t8RnOp.js"),__vite__mapDeps([78,1,23,43,44,79,59,5,8,9]))),hy=_.lazy(()=>U(()=>import("./AdminSubscribers-YGa_knSD.js"),__vite__mapDeps([80,1,74,23,43,44,79,5,14,4,46,59,8,9]))),py=_.lazy(()=>U(()=>import("./AdminAffiliates-CIpnFlGn.js"),__vite__mapDeps([81,1,23,43,44,52,6,46,8,9]))),fy=_.lazy(()=>U(()=>import("./AdminWatch-CnveYK_a.js"),__vite__mapDeps([82,1,74,44,4,73,40,8,9]))),gy=_.lazy(()=>U(()=>import("./AdminRevenue-CC71pBK4.js"),__vite__mapDeps([83,1,74,3,43,4,73,40,8,9]))),vy=_.lazy(()=>U(()=>import("./AdminRefunds-BrFbUPuI.js"),__vite__mapDeps([84,1,74,4,8,9]))),my=_.lazy(()=>U(()=>import("./BlogIndex-vKVdf7JE.js"),__vite__mapDeps([85,1,86,8,9]))),_y=_.lazy(()=>U(()=>import("./BestAiAvatarGenerators2026-Bqd4G_WC.js"),__vite__mapDeps([87,1,88,86,21,8,9]))),yy=_.lazy(()=>U(()=>import("./AiAvatarVsPhotoshootCost-DgDGRzf4.js"),__vite__mapDeps([89,1,88,86,21,8,9]))),by=_.lazy(()=>U(()=>import("./CreateFirstAiAvatar-DEB70JGO.js"),__vite__mapDeps([90,1,88,86,21,8,9]))),xy=_.lazy(()=>U(()=>import("./AiAvatarPrivacyCreators-ChQblthZ.js"),__vite__mapDeps([91,1,88,86,21,8,9]))),wy=_.lazy(()=>U(()=>import("./AiPhotosInstagramSafely-DxhteAdR.js"),__vite__mapDeps([92,1,88,86,21,8,9]))),Ey=_.lazy(()=>U(()=>import("./HyperRealisticAiPhotosTips-CwAyLlqY.js"),__vite__mapDeps([93,1,88,86,21,8,9]))),Sy=_.lazy(()=>U(()=>import("./CreatorEconomy2026Ai-D18rJVwx.js"),__vite__mapDeps([94,1,88,86,21,8,9]))),ky=_.lazy(()=>U(()=>import("./StableDiffusionVsBeModel-V5gZkBPU.js"),__vite__mapDeps([95,1,88,86,21,8,9]))),Py=_.lazy(()=>U(()=>import("./BeModelVsLensa-Ci222GWM.js"),__vite__mapDeps([96,1,88,86,21,8,9]))),jy=_.lazy(()=>U(()=>import("./BeModelVsMidjourney-Dn5O4Zsn.js"),__vite__mapDeps([97,1,88,86,21,8,9]))),Cy=_.lazy(()=>U(()=>import("./BeModelVsPhotoAi-BaC7PM-v.js"),__vite__mapDeps([98,1,88,86,21,8,9]))),Ty=_.lazy(()=>U(()=>import("./About-BumtXKFR.js"),__vite__mapDeps([99,1,8,9]))),Ry=_.lazy(()=>U(()=>import("./Faq-CdaDmkhE.js"),__vite__mapDeps([100,1,8,9]))),Ny=_.lazy(()=>U(()=>import("./Glossary-RAR5OxPj.js"),__vite__mapDeps([101,1,8,9]))),Ay=_.lazy(()=>U(()=>import("./Press-BQfXanuS.js"),__vite__mapDeps([102,1,8,9]))),Oy=new Wh,Iy=()=>c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background","aria-label":"Loading",children:c.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-border border-t-primary"})}),Fy=()=>(_.useEffect(()=>{document.documentElement.classList.remove("app-boot")},[]),c.jsx(Yh,{client:Oy,children:c.jsx(Ym,{children:c.jsxs(xg,{children:[c.jsx(bg,{}),c.jsx(jf,{}),c.jsxs(Wp,{children:[c.jsx(Km,{}),c.jsx(u_,{}),c.jsx(d_,{children:c.jsx(_.Suspense,{fallback:c.jsx(Iy,{}),children:c.jsxs($p,{children:[c.jsxs(D,{element:c.jsx(Qm,{}),children:[c.jsx(D,{path:"/",element:c.jsx($0,{})}),c.jsx(D,{path:"/pricing",element:c.jsx(z0,{})}),c.jsx(D,{path:"/templates",element:c.jsx(B0,{})})]}),c.jsx(D,{path:"/login",element:c.jsx(U0,{})}),c.jsx(D,{path:"/register",element:c.jsx(V0,{})}),c.jsx(D,{path:"/forgot-password",element:c.jsx(q0,{})}),c.jsx(D,{path:"/start",element:c.jsx(xr,{to:"/start-free",replace:!0})}),c.jsx(D,{path:"/start-free",element:c.jsx(H0,{})}),c.jsx(D,{path:"/watch",element:c.jsx(G0,{})}),c.jsx(D,{path:"/r/:code",element:c.jsx(W0,{})}),c.jsx(D,{path:"/upgrade",element:c.jsx(Q0,{})}),c.jsx(D,{element:c.jsx(Zm,{}),children:c.jsx(D,{path:"/affiliate",element:c.jsx(J0,{})})}),c.jsxs(D,{path:"/app",element:c.jsx(X0,{}),children:[c.jsx(D,{index:!0,element:c.jsx(xr,{to:"/app/templates",replace:!0})}),c.jsx(D,{path:"templates",element:c.jsx(ay,{})}),c.jsx(D,{path:"create",element:c.jsx(ny,{})}),c.jsx(D,{path:"gallery",element:c.jsx(ey,{})}),c.jsx(D,{path:"avatar",element:c.jsx(Z0,{})}),c.jsx(D,{path:"subscription",element:c.jsx(sc,{to:"/app/profile/subscription"})}),c.jsx(D,{path:"support",element:c.jsx(sc,{to:"/app/profile/support"})}),c.jsxs(D,{path:"profile",children:[c.jsx(D,{index:!0,element:c.jsx(ty,{})}),c.jsx(D,{path:"subscription",element:c.jsx(ry,{})}),c.jsx(D,{path:"account",element:c.jsx(sy,{})}),c.jsx(D,{path:"support",element:c.jsx(iy,{})})]})]}),c.jsx(D,{element:c.jsx(Jm,{}),children:c.jsxs(D,{path:"/admin",element:c.jsx(oy,{}),children:[c.jsx(D,{index:!0,element:c.jsx(ly,{})}),c.jsx(D,{path:"users",element:c.jsx(dy,{})}),c.jsx(D,{path:"subscribers",element:c.jsx(hy,{})}),c.jsx(D,{path:"watch",element:c.jsx(fy,{})}),c.jsx(D,{path:"affiliates",element:c.jsx(py,{})}),c.jsx(D,{path:"revenue",element:c.jsx(gy,{})}),c.jsx(D,{path:"templates",element:c.jsx(uy,{})}),c.jsx(D,{path:"prompts",element:c.jsx(cy,{})}),c.jsx(D,{path:"refunds",element:c.jsx(vy,{})})]})}),c.jsx(D,{path:"/privacy",element:c.jsx(Y0,{})}),c.jsx(D,{path:"/terms",element:c.jsx(K0,{})}),c.jsx(D,{path:"/blog",element:c.jsx(my,{})}),c.jsx(D,{path:"/blog/best-ai-avatar-generators-2026",element:c.jsx(_y,{})}),c.jsx(D,{path:"/blog/ai-avatar-vs-photoshoot-cost",element:c.jsx(yy,{})}),c.jsx(D,{path:"/blog/create-first-ai-avatar",element:c.jsx(by,{})}),c.jsx(D,{path:"/blog/ai-avatar-privacy-creators",element:c.jsx(xy,{})}),c.jsx(D,{path:"/blog/ai-photos-instagram-safely",element:c.jsx(wy,{})}),c.jsx(D,{path:"/blog/hyper-realistic-ai-photos-tips",element:c.jsx(Ey,{})}),c.jsx(D,{path:"/blog/creator-economy-2026-ai",element:c.jsx(Sy,{})}),c.jsx(D,{path:"/blog/stable-diffusion-vs-bemodel",element:c.jsx(ky,{})}),c.jsx(D,{path:"/blog/bemodel-vs-lensa",element:c.jsx(Py,{})}),c.jsx(D,{path:"/blog/bemodel-vs-midjourney",element:c.jsx(jy,{})}),c.jsx(D,{path:"/blog/bemodel-vs-photoai",element:c.jsx(Cy,{})}),c.jsx(D,{path:"/about",element:c.jsx(Ty,{})}),c.jsx(D,{path:"/faq",element:c.jsx(Ry,{})}),c.jsx(D,{path:"/glossary",element:c.jsx(Ny,{})}),c.jsx(D,{path:"/press",element:c.jsx(Ay,{})}),c.jsx(D,{path:"*",element:c.jsx(D0,{})})]})})})]})]})})}));$d();jc(document.getElementById("root")).render(c.jsx(Fy,{}));export{zy as A,Oe as B,Ya as C,t_ as D,Gn as E,ct as F,Ki as G,Ph as H,jh as I,Rc as J,zh as K,Ne as L,Rh as M,xr as N,Wa as O,Be as P,By as Q,Vn as R,M0 as S,Hd as T,Vd as U,Gd as V,Yc as W,Ka as X,e_ as Y,Wc as Z,U as _,rn as a,Yd as b,pe as c,Wi as d,Ga as e,Of as f,qy as g,
76Ks as h,Vy as i,Qc as j,Oo as k,Gy as l,Xm as m,Bd as n,Ud as o,qd as p,Wy as q,Mf as r,dr as s,Yy as t,Qs as u,Ky as v,Uy as w,Yi as x,Fh as y,Ch as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.