const t=()=>(new Date).toISOString();function r(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function e(t){return function e(n){return 0===arguments.length||r(n)?e:t.apply(this,arguments)}}function n(t){return function n(o,a){switch(arguments.length){case 0:return n;case 1:return r(o)?n:e((function(r){return t(o,r)}));default:return r(o)&&r(a)?n:r(o)?e((function(r){return t(r,a)})):r(a)?e((function(r){return t(o,r)})):t(o,a)}}}function o(t){return function o(a,i,u){switch(arguments.length){case 0:return o;case 1:return r(a)?o:n((function(r,e){return t(a,r,e)}));case 2:return r(a)&&r(i)?o:r(a)?n((function(r,e){return t(r,i,e)})):r(i)?n((function(r,e){return t(a,r,e)})):e((function(r){return t(a,i,r)}));default:return r(a)&&r(i)&&r(u)?o:r(a)&&r(i)?n((function(r,e){return t(r,e,u)})):r(a)&&r(u)?n((function(r,e){return t(r,i,e)})):r(i)&&r(u)?n((function(r,e){return t(a,r,e)})):r(a)?e((function(r){return t(r,i,u)})):r(i)?e((function(r){return t(a,r,u)})):r(u)?e((function(r){return t(a,i,r)})):t(a,i,u)}}}function a(t,r){return Object.prototype.hasOwnProperty.call(r,t)}var i=e((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function u(t){return"[object Object]"===Object.prototype.toString.call(t)}function c(t,r,e){if(e||(e=new s),function(t){var r=typeof t;return null==t||"object"!=r&&"function"!=r}(t))return t;var n,o=function(r){var n=e.get(t);if(n)return n;for(var o in e.set(t,r),t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=c(t[o],!0,e));return r};switch(i(t)){case"Object":return o(Object.create(Object.getPrototypeOf(t)));case"Array":return o(Array(t.length));case"Date":return new Date(t.valueOf());case"RegExp":return n=t,new RegExp(n.source,n.flags?n.flags:(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":"")+(n.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return t.slice();default:return t}}var s=function(){function t(){this.map={},this.length=0}return t.prototype.set=function(t,r){var e=this.hash(t),n=this.map[e];n||(this.map[e]=n=[]),n.push([t,r]),this.length+=1},t.prototype.hash=function(t){var r=[];for(var e in t)r.push(Object.prototype.toString.call(t[e]));return r.join()},t.prototype.get=function(t){if(this.length<=180)for(var r in this.map)for(var e=this.map[r],n=0;n"function"==typeof t&&Boolean(t.constructor&&t.call&&t.apply),g=t=>"string"==typeof t,b=t=>null===t,d=t=>void 0===t,v=t=>b(t)||d(t),O=t=>!d(t),m=t=>!v(t),j=t=>!b(t)&&"[object Object]"===Object.prototype.toString.call(t),w=(t,r)=>{if(!Array.isArray(t)||!Array.isArray(r))return l(r);const e=l(t);return r.forEach(((t,r)=>{e[r]=Array.isArray(t)||(t=>!b(t)&&"object"==typeof t&&!Array.isArray(t))(t)?A(e[r],t):t})),e},A=(t,r)=>y(w,t,r),S=t=>j(t)&&Object.keys(t).length>0,P="cookieStorage",$="localStorage",x="memoryStorage",E="js-integrations",U=t=>t.replace(/\/{2,}/g,"/");for(var D,N=[],T=0;T<256;T++)N[T]=(T+256).toString(16).substring(1);function C(){var t;(!D||T+16>4096)&&(t=4096,D=crypto.getRandomValues(new Uint8Array(t)),T=0);for(var r,e=0,n="";e<16;e++)r=D[T+e],n+=6==e?N[15&r|64]:8==e?N[63&r|128]:N[r],1&e&&e>1&&e<11&&(n+="-");return T+=16,n}for(var k,R=256,z=[];R--;)z[R]=(R+256).toString(16).substring(1);const I=()=>!v(globalThis.crypto)&&h(globalThis.crypto.getRandomValues)?C():function(){var t,r=0,e="";if(!k||R+16>256){for(k=Array(r=256);r--;)k[r]=256*Math.random()|0;r=R=0}for(;r<16;r++)t=k[R+r],e+=6==r?z[15&t|64]:8==r?z[63&t|128]:z[t],1&r&&r>1&&r<11&&(e+="-");return R++,e}(),J=t=>{let r=!1;if(null!=t&&t.error&&null!=t&&t.xhr){const e=t.xhr.status;r=429===e||e>=500&&e<600}return r},B=t=>{let r=t;if(!g(t)&&!v(t))try{r=JSON.stringify(t)}catch(t){r=null}return r},F=t=>(t=>{const r=Array.from(t,(t=>String.fromCodePoint(t))).join("");return globalThis.btoa(r)})((new TextEncoder).encode(t)),_=t=>(new TextDecoder).decode((t=>{const r=globalThis.atob(t).split("").map((t=>t.charCodeAt(0)));return new Uint8Array(r)})(t)),M=":: ",V=(t,r,e)=>{const n=[];return function(o,a){if(!(null!=r&&r.includes(o)||t&&v(a))){if("object"!=typeof a||b(a))return a;for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(a)?(null==e||e.warn(((t,r)=>`${t}${M}A circular reference has been detected in the object and the property "${r}" has been dropped from the output.`)("JSONStringify",o)),"[Circular Reference]"):(n.push(a),a)}}},q=(t,r,e,n)=>{try{return JSON.stringify(t,V(r,e,n))}catch(t){return null==n||n.warn("Failed to convert the value to a JSON string.",t),null}},L="RS_ENC_v3_";function Q(t,r,e){return(r=function(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function W(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function G(t){for(var r=1;r`${L}${F(t)}`,K=t=>null!=t&&t.startsWith(L)?_(t.substring(10)):t,X="QueueUtilities",Y=(t,r)=>q(t,!0,void 0,r),Z=(t,r)=>q(t,!0,void 0,r),tt=(t,r)=>{const e=Y(t,r);if(e){const t=e.length;t>32768&&(null==r||r.warn(((t,r,e)=>`${t}${M}The size of the event payload (${r} bytes) exceeds the maximum limit of ${e} bytes. Events with large payloads may be dropped in the future. Please review your instrumentation to ensure that event payloads are within the size limit.`)(X,t,32768)))}else null==r||r.warn(`${X}${M}Failed to validate event payload size. Please make sure that the event payload is within the size limit and is a valid JSON object.`)},rt=(t,r)=>{const e=l(t);return e.sentAt=r,e};export{I as A,Q as B,P as C,$ as L,x as M,G as _,j as a,g as b,O as c,l as d,m as e,b as f,d as g,H as h,h as i,K as j,M as k,v as l,A as m,t as n,rt as o,E as p,S as q,U as r,q as s,B as t,Z as u,tt as v,J as w,_ as x,Y as y,F as z}; //# sourceMappingURL=rsa-plugins-common.min.js.map