window.__REP_INGEST__=window.__REP_INGEST__||"https://collect.rejoin.app";
(()=>{var{defineProperty:C,getOwnPropertyNames:L,getOwnPropertyDescriptor:N}=Object,O=Object.prototype.hasOwnProperty;function P(j){return this[j]}var Q=(j)=>{var q=(G??=new WeakMap).get(j),x;if(q)return q;if(q=C({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var z of L(j))if(!O.call(q,z))C(q,z,{get:P.bind(j,z),enumerable:!(x=N(j,z))||x.enumerable})}return G.set(j,q),q},G;var V=(j)=>j;function W(j,q){this[j]=V.bind(null,q)}var X=(j,q)=>{for(var x in q)C(j,x,{get:q[x],enumerable:!0,configurable:!0,set:W.bind(q,x)})};var F={};X(F,{buildBeacon:()=>H,boot:()=>J});var Z=["source","medium","campaign","term","content"];function $(){let q=document.currentScript?.src||f();if(!q)return"";let x=q.match(/\/([A-Za-z0-9_-]+)\.js(?:$|\?)/);return x?x[1]:""}function f(){let j=document.getElementsByTagName("script");for(let q=0;q<j.length;q++){let x=j[q].src||"";if(/pixel\.rejoin\.app\/[A-Za-z0-9_-]+\.js/.test(x))return x}return""}function A(j){let q=new URLSearchParams(j),x={};for(let z of Z){let D=q.get("utm_"+z);if(D)x[z[0]]=D.slice(0,200)}return x}function B(){try{let q=localStorage.getItem("__rep_vid__");if(!q)q=crypto.randomUUID&&crypto.randomUUID()||Math.random().toString(36).slice(2)+Date.now().toString(36),localStorage.setItem("__rep_vid__",q);return q}catch{return""}}function E(j,q){let x=j.replace(/\/$/,"")+"/e",z=JSON.stringify(q);try{if(navigator.sendBeacon){navigator.sendBeacon(x,new Blob([z],{type:"text/plain;charset=UTF-8"}));return}}catch{}try{fetch(x,{method:"POST",body:z,keepalive:!0,mode:"no-cors",headers:{"Content-Type":"text/plain;charset=UTF-8"}})}catch{}}function H(j){let q=A(j.search);return{c:j.creator,t:"visit",vid:j.vid,utm:Object.keys(q).length?q:void 0,ref:j.referrer?j.referrer.slice(0,1024):void 0,lp:j.href.slice(0,1024),pu:j.href.slice(0,1024),sw:j.screenW,sh:j.screenH,n:`${j.creator}:${j.vid}:${j.minute}`}}function J(j=window){if(j.__rep_loaded__)return;j.__rep_loaded__=!0;let q=$();if(!q)return;let x=j.__REP_INGEST__||"https://collect.rejoin.app",z=H({creator:q,href:j.location.href,search:j.location.search,referrer:document.referrer,vid:B(),screenW:j.screen?.width,screenH:j.screen?.height,minute:Math.floor(Date.now()/60000)});E(x,z)}if(typeof document<"u")try{J()}catch{}})();
