1import{n as e}from"./rolldown-runtime-DWdDZTNf.js";import{i as t,n,r,t as i}from"./config-DdUAZnIP.js";function a(){return typeof window>`u`?void 0:window.posthog}function o(){try{a()?.opt_in_capturing?.()}catch{}}function s(){try{a()?.opt_out_capturing?.()}catch{}}function c(e,t){try{a()?.capture?.(e,t)}catch{}}function l(e){try{a()?.identify?.(e)}catch{}}function u(){try{a()?.reset?.()}catch{}}var d=`sprag_cookie_consent`;function f(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(d);return e===`accepted`||e===`rejected`?e:null}catch{return null}}function p(){return f()===`accepted`}function m(e){if(!(typeof window>`u`))try{window.localStorage.setItem(d,e)}catch{}}var h=3e3,g=1500;function _(e){if(typeof window>`u`){e();return}let t=window;typeof t.requestIdleCallback==`function`?t.requestIdleCallback(e,{timeout:h}):setTimeout(e,g)}var v=e({events:()=>S,grantAnalyticsConsent:()=>V,identifyUser:()=>q,initAnalytics:()=>L,rejectAnalyticsConsent:()=>W,resetAnalyticsIdentity:()=>G,track:()=>K,trackPageView:()=>X}),y=`sprag-google-tag-loader`,b=new Set([`stripe_setup`,`setup`,`session_id`,`token`,`handoff`]),x=/^\/invite\/[^/?#]+/,S={SIGN_UP:`sign_up`,LOGIN:`login`,CONSENT_GRANTED:`consent_granted`},C={[S.SIGN_UP]:r.signUp},w=`idle`,T=!1,E=!1,D=!1,O=null,k=[];function A(){return t&&p()}function j(){if(!(typeof window>`u`))return window.dataLayer??=[],window.gtag??=function(){window.dataLayer?.push(arguments)},window.gtag}function M(){let e=j();if(!e)return;let t={analytics_storage:`granted`};
1n&&(t.ad_storage=`granted`,t.ad_user_data=`granted`,t.ad_personalization=`denied`),e(`consent`,`update`,t)}function N(){let e=j();e&&e(`consent`,`update`,{analytics_storage:`denied`,ad_storage:`denied`,ad_user_data:`denied`,ad_personalization:`denied`})}function P(){let e=j();!e||E||(e(`consent`,`default`,{analytics_storage:`denied`,ad_storage:`denied`,ad_user_data:`denied`,ad_personalization:`denied`,wait_for_update:500}),E=!0,p()&&M())}function F(){if(!D||!A())return;let e=O;O=null;let t=k;k=[],e&&q(e),t.forEach(({event:e,params:t})=>{B(e,t)})}function I(){P();let e=i||n;if(!e||!t||!p()||typeof document>`u`)return;let r=j();if(!r||(T||=(r(`js`,new Date),i&&r(`config`,i,{send_page_view:!1}),n&&r(`config`,n),!0),w===`loaded`||w===`loading`))return;if(document.getElementById(y)){w=`loaded`;return}let a=document.createElement(`script`);a.id=y,a.async=!0,a.defer=!0,a.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,a.onload=()=>{w=`loaded`},a.onerror=()=>{console.error(`[analytics] Failed to load Google tag script`,a.src),a.remove(),w=`error`},(document.body??document.head).appendChild(a),w=`loading`}function L(){D=!0,t&&(P(),p()&&_(()=>{I(),o(),F()}))}function R(e,t){if(!i||typeof window>`u`)return;I();let n=j();n&&n(`event`,e,t??{})}function z(e,t){let r=C[e];if(!n||!r||typeof window>`u`)return;I();let i=j();if(!i)return;let a={send_to:`${n}/${r}`};typeof t?.value==`number`&&(a.value=t.value),typeof t?.currency==`string`&&(a.currency=t.currency),typeof t?.transaction_id==`string`&&(a.transaction_id=t.transaction_id),i(`event`,`conversion`,a)}function B(e,t){if(!D){if(!A())return;k.push({event:e,params:t});return}A()&&(R(e,t),z(e,t),c(e,t))}function V(e){m(`accepted`),window.dispatchEvent(new Event(`sprag:analytics-consent-granted`)),D=!0,P(),M(),e&&q(e),I(),o(),F(),B(S.CONSENT_GRANTED),X(window.location.pathname+window.location.search,document.title)}var H=[`_ga`,`_gcl`,`ph_`];function U(){if(typeof document>`u`)return;let e=window.location.hostname,t=[``,e,`.${e}`],n=e.split(`.`);n.length>2&&t.push(`.${n.slice(-2).join(`.`)}`);for(let e of document.cookie.split(`;`)){let n=e.split(`=`)[0]?.trim();if(!(!n||!H.some(e=>n.startsWith(e))))for(let e of t)document.cookie=`${n}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/${e?`; domain=${e}`:``}`}try{let e=[];for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);n?.startsWith(`ph_`)&&e.push(n)}e.forEach(e=>window.localStorage.removeItem(e))}catch{}}function W(){m(`rejected`),N(),s(),U()}function G(){O=null,u()}function K(e,t){B(e,t)}function q(e){if(!D){if(!A())return;O=e;return}A()&&l(e)}var J=`Sprag`;function Y(e){let t=e.split(`/`).filter(Boolean);return t.length===0?`Home â ${J}`:`${t[t.length-1].replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())} â ${J}`}function X(e,t){let[n,r=``]=e.split(`?`),i=n.replace(x,`/invite/:token`),a=new URLSearchParams(r);b.forEach(e=>a.delete(e));let o=i+(a.toString()?`?${a.toString()}`:``),s=t===J?Y(i):t;B(`page_view`,{page_path:o,page_location:typeof window<`u`?`${window.location.origin}${o}`:o,page_title:s})}export{W as a,X as c,f as d,c as f,q as i,_ as l,S as n,G as o,V as r,K as s,v as t,p as u};
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.