posthog-js 1.376.2 → 1.376.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e="1.376.2",r="web";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;arguments.length>r;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},t.apply(null,arguments)}function n(e,r){return-1!==e.indexOf(r)}var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,u=Array.isArray||function(e){return"[object Array]"===a.call(e)},l=e=>e===Object(e)&&!u(e),s=e=>{if(l(e)){for(var r in e)if(o.call(e,r))return!1;return!0}return!1},c=e=>void 0===e,d=e=>c(e)||(e=>null===e)(e),f=e=>"[object Number]"==a.call(e)&&e==e,v=e=>e instanceof FormData;function h(e,r,t,n,i){return r>t&&(n.warn("min cannot be greater than max."),r=t),f(e)?e>t?(n.warn(" cannot be greater than max: "+t+". Using max value instead."),t):r>e?(n.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(n.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+i),h(t,r,t,n))}class p{constructor(e){this.$t={},this.zt=e.zt,this.Zt=h(e.bucketSize,0,100,e.Gt),this.Qt=h(e.refillRate,0,this.Zt,e.Gt),this.Jt=h(e.refillInterval,0,864e5,e.Gt)}Kt(e,r){var t=Math.floor((r-e.lastAccess)/this.Jt);t>0&&(e.tokens=Math.min(e.tokens+t*this.Qt,this.Zt),e.lastAccess=e.lastAccess+t*this.Jt)}consumeRateLimit(e){var r,t=Date.now(),n=String(e),i=this.$t[n];return i?this.Kt(i,t):this.$t[n]=i={tokens:this.Zt,lastAccess:t},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.zt)||r.call(this,e)),0===i.tokens)}stop(){this.$t={}}}var g="Mobile",w="iOS",m="Android",_="Tablet",b=m+" "+_,x="iPad",E="Apple",y=E+" Watch",R="Safari",M="BlackBerry",S="Samsung",P=S+"Browser",k=S+" Internet",O="Chrome",A=O+" OS",B=O+" "+w,U="Internet Explorer",I=U+" "+g,T="Opera",D=T+" Mini",N="Edge",C="Microsoft "+N,F="Firefox",W=F+" "+w,j="Nintendo",z="PlayStation",L="Xbox",K=m+" "+g,H=g+" "+R,G="Windows",V=G+" Phone",X="Nokia",q="Ouya",Y="Generic",J=Y+" "+g.toLowerCase(),Q=Y+" "+_.toLowerCase(),Z="Konqueror",ee="Oculus Browser",re="(\\d+(\\.\\d+)?)",te=new RegExp("Version/"+re),ne=new RegExp(L,"i"),ie=new RegExp(z+" \\w+","i"),oe=new RegExp(j+" \\w+","i"),ae=new RegExp(M+"|PlayBook|BB10","i"),ue={"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"},le=function(e,r){return r=r||"",n(e," OPR/")&&n(e,"Mini")?D:n(e," OPR/")?T:ae.test(e)?M:n(e,"IE"+g)||n(e,"WPDesktop")?I:n(e,"OculusBrowser")?ee:n(e,P)?k:n(e,N)||n(e,"Edg/")?C:n(e,"FBIOS")?"Facebook "+g:n(e,"UCWEB")||n(e,"UCBrowser")?"UC Browser":n(e,"CriOS")?B:n(e,"CrMo")||n(e,O)?O:n(e,m)&&n(e,R)?K:n(e,"FxiOS")?W:n(e.toLowerCase(),Z.toLowerCase())?Z:((e,r)=>r&&n(r,E)||function(e){return n(e,R)&&!n(e,O)&&!n(e,m)}(e))(e,r)?n(e,g)?H:R:n(e,F)?F:n(e,"MSIE")||n(e,"Trident/")?U:n(e,"Gecko")?F:""},se={[I]:[new RegExp("rv:"+re)],[C]:[new RegExp(N+"?\\/"+re)],[O]:[new RegExp("("+O+"|CrMo)\\/"+re)],[B]:[new RegExp("CriOS\\/"+re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+re)],[R]:[te],[H]:[te],[T]:[new RegExp("(Opera|OPR)\\/"+re)],[F]:[new RegExp(F+"\\/"+re)],[W]:[new RegExp("FxiOS\\/"+re)],[Z]:[new RegExp("Konqueror[:/]?"+re,"i")],[M]:[new RegExp(M+" "+re),te],[K]:[new RegExp("android\\s"+re,"i")],[k]:[new RegExp(P+"\\/"+re)],[ee]:[new RegExp("OculusBrowser\\/"+re)],[U]:[new RegExp("(rv:|MSIE )"+re)],Mozilla:[new RegExp("rv:"+re)]},ce=function(e,r){var t=le(e,r),n=se[t];if(c(n))return null;for(var i=0;n.length>i;i++){var o=e.match(n[i]);if(o)return parseFloat(o[o.length-2])}return null},de=[[new RegExp(L+"; "+L+" (.*?)[);]","i"),e=>[L,e&&e[1]||""]],[new RegExp(j,"i"),[j,""]],[new RegExp(z,"i"),[z,""]],[ae,[M,""]],[new RegExp(G,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[V,""];if(new RegExp(g).test(r)&&!/IEMobile\b/.test(r))return[G+" "+g,""];var t=/Windows NT ([0-9.]+)/i.exec(r);if(t&&t[1]){var n=ue[t[1]]||"";return/arm/i.test(r)&&(n="RT"),[G,n]}return[G,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[w,[e[3],e[4],e[5]||"0"].join(".")]:[w,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=c(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+m+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+m+")","i"),e=>e&&e[2]?[m,[e[2],e[3],e[4]||"0"].join(".")]:[m,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];return e&&e[1]&&(r[1]=[e[1],e[2],e[3]||"0"].join(".")),r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[A,""]],[/Linux|debian/i,["Linux",""]]],fe=function(e){return oe.test(e)?j:ie.test(e)?z:ne.test(e)?L:new RegExp(q,"i").test(e)?q:new RegExp("("+V+"|WPDesktop)","i").test(e)?V:/iPad/.test(e)?x:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?y:ae.test(e)?M:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(X,"i").test(e)?X:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(g).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?m:b:new RegExp("(pda|"+g+")","i").test(e)?J:new RegExp(_,"i").test(e)&&!new RegExp(_+" pc","i").test(e)?Q:""},ve="undefined"!=typeof window?window:void 0,he="undefined"!=typeof globalThis?globalThis:ve;"undefined"==typeof self&&(he.self=he),"undefined"==typeof File&&(he.File=function(){});var pe=null==he?void 0:he.navigator,ge=null==he?void 0:he.document,we=null==he?void 0:he.location;null!=he&&he.XMLHttpRequest&&new he.XMLHttpRequest;var me=null==pe?void 0:pe.userAgent,_e=null!=ve?ve:{},be=function(e,r){var{debugEnabled:t}=void 0===r?{}:r,n={k(r){if(ve&&(_e.POSTHOG_DEBUG||t)&&!c(ve.console)&&ve.console){for(var n=("__rrweb_original__"in ve.console[r]?ve.console[r].__rrweb_original__:ve.console[r]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;i>a;a++)o[a-1]=arguments[a];n(e,...o)}},debug(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("debug",...r)},info(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("log",...r)},warn(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("warn",...r)},error(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("error",...r)},critical(){for(var r=arguments.length,t=new Array(r),n=0;r>n;n++)t[n]=arguments[n];console.error(e,...t)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(r,t)=>be(e+" "+r,t)};return n},xe=be("[PostHog.js]"),Ee=xe.createLogger;function ye(e,r){if(!d(e))if(u(e))e.forEach(r);else if(v(e))e.forEach(((e,t)=>r(e,t)));else for(var t in e)o.call(e,t)&&r(e[t],t)}var Re=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;r>n;n++)t[n-1]=arguments[n];for(var i of t)for(var o in i)void 0!==i[o]&&(e[o]=i[o]);return e},$e=e=>{var r=null==ge?void 0:ge.createElement("a");return c(r)?null:(r.href=e,r)},Me=function(e,r,t){if(!e||!r||!r.length)return e;for(var n=e.split("#"),i=n[1],o=(n[0]||"").split("?"),a=o[1],l=o[0],s=(a||"").split("&"),c=[],d=0;s.length>d;d++){var f=s[d].split("=");u(f)&&(r.includes(f[0])?c.push(f[0]+"="+t):c.push(s[d]))}var v=l;return null!=a&&(v+="?"+c.join("&")),null!=i&&(v+="#"+i),v};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return f(e)&&isFinite(e)&&Math.floor(e)===e});class Se{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,t,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(t)||!Number.isInteger(n)||0>e||0>r||0>t||0>n||e>0xffffffffffff||r>4095||t>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|r>>>8,i[7]=r,i[8]=128|t>>>24,i[9]=t>>>16,i[10]=t>>>8,i[11]=t,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new Se(i)}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),3!==r&&5!==r&&7!==r&&9!==r||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Se(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;16>r;r++){var t=this.bytes[r]-e.bytes[r];if(0!==t)return Math.sign(t)}return 0}}class Pe{constructor(){this.S=0,this.C=0,this.I=new Ae}generate(){var e=this.generateOrAbort();if(c(e)){this.S=0;var r=this.generateOrAbort();if(c(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.T();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return Se.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var ke,Oe=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;e.length>r;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ve&&!c(ve.crypto)&&crypto.getRandomValues&&(Oe=e=>crypto.getRandomValues(e));class Ae{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Oe(this.M),this.O=0),this.M[this.O++]}}var Be=()=>(ke||(ke=new Pe)).generate(),Ue="",Ie=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Te(e,r){if(r){var t=function(e,r){if(void 0===r&&(r=ge),Ue)return Ue;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var t=e.split("."),n=Math.min(t.length,8),i="dmn_chk_"+Be().toString();!Ue&&n--;){var o=t.slice(n).join("."),a=i+"=1;domain=."+o+";path=/";r.cookie=a+";max-age=3",r.cookie.includes(i)&&(r.cookie=a+";max-age=0",Ue=o)}return Ue}(e);if(!t){var n=(e=>{var r=e.match(Ie);return r?r[0]:""})(e);n!==t&&xe.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}var De={R:()=>!!ge,D(e){xe.error("cookieStore error: "+e)},A(e){if(ge){try{for(var r=e+"=",t=ge.cookie.split(";").filter((e=>e.length)),n=0;t.length>n;n++){for(var i=t[n];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(r))return decodeURIComponent(i.substring(r.length,i.length))}}catch(e){}return null}},F(e){var r;try{r=JSON.parse(De.A(e))||{}}catch(e){}return r},N(e,r,t,n,i){if(ge)try{var o="",a="",u=Te(ge.location.hostname,n);if(t){var l=new Date;l.setTime(l.getTime()+864e5*t),o="; expires="+l.toUTCString()}i&&(a="; secure");var s=e+"="+encodeURIComponent(JSON.stringify(r))+o+"; SameSite=Lax; path=/"+u+a;return s.length>3686.4&&xe.warn("cookieStore warning: large cookie, len="+s.length),ge.cookie=s,s}catch(e){return}},q(e,r){if(null!=ge&&ge.cookie)try{De.N(e,"",-1,r)}catch(e){return}}},Ne=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ce=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ne],Fe=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer","$screen_height","$screen_width","$viewport_height","$viewport_width","$raw_user_agent"],We="<masked>",je=["li_fat_id"];function ze(e,r,t){if(!ge)return{};var n,i,o,a=r?[...Ne,...t||[]]:[],l=(n=Me(ge.URL,a,We),i=Ce.concat(e||[]),o={},ye(i,(function(e){var r=function(e,r){for(var t,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;n.length>i;i++){var o=n[i].split("=");if(o[0]===r){t=o;break}}if(!u(t)||2>t.length)return"";var a=t[1];try{a=decodeURIComponent(a)}catch(e){xe.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")}(n,e);o[e]=r||null})),o),s=function(){var e={};return ye(je,(function(r){var t=De.A(r);e[r]=t||null})),e}();return Re(s,l)}function Le(){return navigator.language||navigator.userLanguage}var Ke="$direct";function He(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ge(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Ve(t,n){var i,o,u,l;if(!me)return{};var s,c,d,v,h,p,w,m,E,R,M=t?[...Ne,...n||[]]:[],[S,P]=function(e){for(var r=0;de.length>r;r++){var[t,n]=de[r],i=t.exec(e),o=i&&("function"==typeof n?n(i,e):n);if(o)return o}return["",""]}(me);return Re((E={$os:S,$os_version:P,$browser:le(me,navigator.vendor),$device:fe(me),$device_type:(c=me,d={userAgentDataPlatform:null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,maxTouchPoints:null==(o=navigator)?void 0:o.maxTouchPoints,screenWidth:null==ve||null==(u=ve.screen)?void 0:u.width,screenHeight:null==ve||null==(l=ve.screen)?void 0:l.height,devicePixelRatio:null==ve?void 0:ve.devicePixelRatio},m=fe(c),m===x||m===b||"Kobo"===m||"Kindle Fire"===m||m===Q?_:m===j||m===L||m===z||m===q?"Console":m===y?"Wearable":m?g:"Android"===(null==d?void 0:d.userAgentDataPlatform)&&(null!==(v=null==d?void 0:d.maxTouchPoints)&&void 0!==v?v:0)>0?600>Math.min(null!==(h=null==d?void 0:d.screenWidth)&&void 0!==h?h:0,null!==(p=null==d?void 0:d.screenHeight)&&void 0!==p?p:0)/(null!==(w=null==d?void 0:d.devicePixelRatio)&&void 0!==w?w:1)?g:_:"Desktop"),$timezone:He(),$timezone_offset:Ge()},R={},ye(E,(function(e,r){("[object String]"==a.call(e)&&e.length>0||f(e))&&(R[r]=e)})),R),{$current_url:Me(null==we?void 0:we.href,M,We),$host:null==we?void 0:we.host,$pathname:null==we?void 0:we.pathname,$raw_user_agent:me.length>1e3?me.substring(0,997)+"...":me,$browser_version:ce(me,navigator.vendor),$browser_language:Le(),$browser_language_prefix:(s=Le(),"string"==typeof s?s.split("-")[0]:void 0),$screen_height:null==ve?void 0:ve.screen.height,$screen_width:null==ve?void 0:ve.screen.width,$viewport_height:null==ve?void 0:ve.innerHeight,$viewport_width:null==ve?void 0:ve.innerWidth,$lib:r,$lib_version:e,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}function Xe(e,r){return[...e||[],...u(r)?r:[r]]}function qe(e,r){return(c(e)?1:e)*r}function Ye(e,r){return function(e){for(var r=0,t=0;e.length>t;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return Math.abs(r)}(e)%100<h(100*r,0,100,xe)}var Je=["type"];function Qe(e){var{type:r,executionTimeMs:t}=e;return r+(d(t)?"":" ("+t.toFixed(2)+"ms)")}var Ze=Ee("[PostHog Action RateLimiting]");function er(e,r){console.log(e,r)}function rr(e,r,t){if(void 0===t&&(t=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var n={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],u=r[o];if(c(a))n[o]=u;else if(c(u))n[o]=a;else if(!(a===u||d(a)&&d(u)))if(l(a)&&l(u))if(t>1){var f=rr(a,u,t-1);s(f)||(n[o]=f)}else n[o]="max depth reached, checking for changed value";else n[o]=u}return n}var tr,nr,ir,or=(tr=null,nr=0,ir=null,{info(e){ir!==e&&(nr=0,ir=e),nr++,tr&&clearTimeout(tr),tr=setTimeout((()=>{Ze.info(1===nr?'action "'+e+'" has been rate limited':'action "'+e+'" has been rate limited ('+nr+" times)"),nr=0,tr=null}),1e3)}});function ar(e){void 0===e&&(e={});var{maskAction:r,maskState:t,titleFunction:n=Qe,logger:i=er,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:u=10,__stateComparisonDepth:l}=e,s=new p({refillRate:a,bucketSize:u,refillInterval:1e3,Gt:Ze});return e=>a=>u=>{var c=u,d=e.getState(),f=performance.now(),v=a(c),h=performance.now()-f,p=e.getState(),g=r?r(c):c;if(!g)return v;if(s.consumeRateLimit(c.type))or.info(c.type);else try{var w=t?t(d,g):d,m=t?t(p,g):p,_=o.changedState?rr(w,m,null!=l?l:5):void 0,{type:b}=g,x={type:b,payload:function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(g,Je),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},E=n(x);i(E,x)}catch(e){Ze.error("Error logging state:",e)}return v}}_e.posthogCustomizations=Object.freeze({__proto__:null,browserConsoleLogger:er,posthogKeaLogger(e){void 0===e&&(e={});var r=ar(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}},posthogReduxLogger:ar,printAndDropEverything:e=>(console.log("Would have sent event:",e),null),sampleByDistinctId:e=>r=>r&&Ye(r.properties.distinct_id,e)?t({},r,{properties:t({},r.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null,sampleByEvent:(e,r)=>i=>{var o,a,u;return i?n(e,i.event)?100*Math.random()<h(100*r,0,100,xe)?t({},i,{properties:t({},i.properties,{$sample_type:Xe(null==(o=i.properties)?void 0:o.$sample_type,"sampleByEvent"),$sample_threshold:qe(null==(a=i.properties)?void 0:a.$sample_threshold,r),$sampled_events:Xe(null==(u=i.properties)?void 0:u.$sampled_events,e)})}):null:i:null},sampleBySessionId:e=>r=>r&&Ye(r.properties.$session_id,e)?t({},r,{properties:t({},r.properties,{$sample_type:Xe(r.properties.$sample_type,"sampleBySessionId"),$sample_threshold:qe(r.properties.$sample_threshold,e)})}):null,sessionRecordingLoggerForPostHogInstance:e=>(r,t)=>{var n;null==e||null==(n=e.sessionRecording)||n.tryAddCustomEvent("app-state",{title:r,stateEvent:t})},setAllPersonProfilePropertiesAsPersonPropertiesForFlags(e){var r,t=Re({},Ve(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),ze(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==ge?void 0:ge.referrer)||Ke,$referring_domain:null!=ge&&ge.referrer&&(null==(r=$e(ge.referrer))?void 0:r.host)||Ke}),i={};ye(t,(function(e,r){(n(Ce,r)||n(Fe,r))&&(i[r]=e)})),e.setPersonPropertiesForFlags(i)}})}();
1
+ !function(){"use strict";var e="1.376.3",r="web";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;arguments.length>r;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},t.apply(null,arguments)}function n(e,r){return-1!==e.indexOf(r)}var i=Object.prototype,o=i.hasOwnProperty,a=i.toString,u=Array.isArray||function(e){return"[object Array]"===a.call(e)},l=e=>e===Object(e)&&!u(e),s=e=>{if(l(e)){for(var r in e)if(o.call(e,r))return!1;return!0}return!1},c=e=>void 0===e,d=e=>c(e)||(e=>null===e)(e),f=e=>"[object Number]"==a.call(e)&&e==e,v=e=>e instanceof FormData;function h(e,r,t,n,i){return r>t&&(n.warn("min cannot be greater than max."),r=t),f(e)?e>t?(n.warn(" cannot be greater than max: "+t+". Using max value instead."),t):r>e?(n.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(n.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+i),h(t,r,t,n))}class p{constructor(e){this.$t={},this.zt=e.zt,this.Zt=h(e.bucketSize,0,100,e.Gt),this.Qt=h(e.refillRate,0,this.Zt,e.Gt),this.Jt=h(e.refillInterval,0,864e5,e.Gt)}Kt(e,r){var t=Math.floor((r-e.lastAccess)/this.Jt);t>0&&(e.tokens=Math.min(e.tokens+t*this.Qt,this.Zt),e.lastAccess=e.lastAccess+t*this.Jt)}consumeRateLimit(e){var r,t=Date.now(),n=String(e),i=this.$t[n];return i?this.Kt(i,t):this.$t[n]=i={tokens:this.Zt,lastAccess:t},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.zt)||r.call(this,e)),0===i.tokens)}stop(){this.$t={}}}var g="Mobile",w="iOS",m="Android",_="Tablet",b=m+" "+_,x="iPad",E="Apple",y=E+" Watch",R="Safari",M="BlackBerry",S="Samsung",P=S+"Browser",k=S+" Internet",O="Chrome",A=O+" OS",B=O+" "+w,U="Internet Explorer",I=U+" "+g,T="Opera",D=T+" Mini",N="Edge",C="Microsoft "+N,F="Firefox",W=F+" "+w,j="Nintendo",z="PlayStation",L="Xbox",K=m+" "+g,H=g+" "+R,G="Windows",V=G+" Phone",X="Nokia",q="Ouya",Y="Generic",J=Y+" "+g.toLowerCase(),Q=Y+" "+_.toLowerCase(),Z="Konqueror",ee="Oculus Browser",re="(\\d+(\\.\\d+)?)",te=new RegExp("Version/"+re),ne=new RegExp(L,"i"),ie=new RegExp(z+" \\w+","i"),oe=new RegExp(j+" \\w+","i"),ae=new RegExp(M+"|PlayBook|BB10","i"),ue={"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"},le=function(e,r){return r=r||"",n(e," OPR/")&&n(e,"Mini")?D:n(e," OPR/")?T:ae.test(e)?M:n(e,"IE"+g)||n(e,"WPDesktop")?I:n(e,"OculusBrowser")?ee:n(e,P)?k:n(e,N)||n(e,"Edg/")?C:n(e,"FBIOS")?"Facebook "+g:n(e,"UCWEB")||n(e,"UCBrowser")?"UC Browser":n(e,"CriOS")?B:n(e,"CrMo")||n(e,O)?O:n(e,m)&&n(e,R)?K:n(e,"FxiOS")?W:n(e.toLowerCase(),Z.toLowerCase())?Z:((e,r)=>r&&n(r,E)||function(e){return n(e,R)&&!n(e,O)&&!n(e,m)}(e))(e,r)?n(e,g)?H:R:n(e,F)?F:n(e,"MSIE")||n(e,"Trident/")?U:n(e,"Gecko")?F:""},se={[I]:[new RegExp("rv:"+re)],[C]:[new RegExp(N+"?\\/"+re)],[O]:[new RegExp("("+O+"|CrMo)\\/"+re)],[B]:[new RegExp("CriOS\\/"+re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+re)],[R]:[te],[H]:[te],[T]:[new RegExp("(Opera|OPR)\\/"+re)],[F]:[new RegExp(F+"\\/"+re)],[W]:[new RegExp("FxiOS\\/"+re)],[Z]:[new RegExp("Konqueror[:/]?"+re,"i")],[M]:[new RegExp(M+" "+re),te],[K]:[new RegExp("android\\s"+re,"i")],[k]:[new RegExp(P+"\\/"+re)],[ee]:[new RegExp("OculusBrowser\\/"+re)],[U]:[new RegExp("(rv:|MSIE )"+re)],Mozilla:[new RegExp("rv:"+re)]},ce=function(e,r){var t=le(e,r),n=se[t];if(c(n))return null;for(var i=0;n.length>i;i++){var o=e.match(n[i]);if(o)return parseFloat(o[o.length-2])}return null},de=[[new RegExp(L+"; "+L+" (.*?)[);]","i"),e=>[L,e&&e[1]||""]],[new RegExp(j,"i"),[j,""]],[new RegExp(z,"i"),[z,""]],[ae,[M,""]],[new RegExp(G,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[V,""];if(new RegExp(g).test(r)&&!/IEMobile\b/.test(r))return[G+" "+g,""];var t=/Windows NT ([0-9.]+)/i.exec(r);if(t&&t[1]){var n=ue[t[1]]||"";return/arm/i.test(r)&&(n="RT"),[G,n]}return[G,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[w,[e[3],e[4],e[5]||"0"].join(".")]:[w,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=c(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+m+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+m+")","i"),e=>e&&e[2]?[m,[e[2],e[3],e[4]||"0"].join(".")]:[m,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];return e&&e[1]&&(r[1]=[e[1],e[2],e[3]||"0"].join(".")),r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[A,""]],[/Linux|debian/i,["Linux",""]]],fe=function(e){return oe.test(e)?j:ie.test(e)?z:ne.test(e)?L:new RegExp(q,"i").test(e)?q:new RegExp("("+V+"|WPDesktop)","i").test(e)?V:/iPad/.test(e)?x:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?y:ae.test(e)?M:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(X,"i").test(e)?X:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(g).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?m:b:new RegExp("(pda|"+g+")","i").test(e)?J:new RegExp(_,"i").test(e)&&!new RegExp(_+" pc","i").test(e)?Q:""},ve="undefined"!=typeof window?window:void 0,he="undefined"!=typeof globalThis?globalThis:ve;"undefined"==typeof self&&(he.self=he),"undefined"==typeof File&&(he.File=function(){});var pe=null==he?void 0:he.navigator,ge=null==he?void 0:he.document,we=null==he?void 0:he.location;null!=he&&he.XMLHttpRequest&&new he.XMLHttpRequest;var me=null==pe?void 0:pe.userAgent,_e=null!=ve?ve:{},be=function(e,r){var{debugEnabled:t}=void 0===r?{}:r,n={k(r){if(ve&&(_e.POSTHOG_DEBUG||t)&&!c(ve.console)&&ve.console){for(var n=("__rrweb_original__"in ve.console[r]?ve.console[r].__rrweb_original__:ve.console[r]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;i>a;a++)o[a-1]=arguments[a];n(e,...o)}},debug(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("debug",...r)},info(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("log",...r)},warn(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("warn",...r)},error(){for(var e=arguments.length,r=new Array(e),t=0;e>t;t++)r[t]=arguments[t];n.k("error",...r)},critical(){for(var r=arguments.length,t=new Array(r),n=0;r>n;n++)t[n]=arguments[n];console.error(e,...t)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(r,t)=>be(e+" "+r,t)};return n},xe=be("[PostHog.js]"),Ee=xe.createLogger;function ye(e,r){if(!d(e))if(u(e))e.forEach(r);else if(v(e))e.forEach(((e,t)=>r(e,t)));else for(var t in e)o.call(e,t)&&r(e[t],t)}var Re=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;r>n;n++)t[n-1]=arguments[n];for(var i of t)for(var o in i)void 0!==i[o]&&(e[o]=i[o]);return e},$e=e=>{var r=null==ge?void 0:ge.createElement("a");return c(r)?null:(r.href=e,r)},Me=function(e,r,t){if(!e||!r||!r.length)return e;for(var n=e.split("#"),i=n[1],o=(n[0]||"").split("?"),a=o[1],l=o[0],s=(a||"").split("&"),c=[],d=0;s.length>d;d++){var f=s[d].split("=");u(f)&&(r.includes(f[0])?c.push(f[0]+"="+t):c.push(s[d]))}var v=l;return null!=a&&(v+="?"+c.join("&")),null!=i&&(v+="#"+i),v};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return f(e)&&isFinite(e)&&Math.floor(e)===e});class Se{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,t,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(t)||!Number.isInteger(n)||0>e||0>r||0>t||0>n||e>0xffffffffffff||r>4095||t>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|r>>>8,i[7]=r,i[8]=128|t>>>24,i[9]=t>>>16,i[10]=t>>>8,i[11]=t,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new Se(i)}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),3!==r&&5!==r&&7!==r&&9!==r||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Se(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;16>r;r++){var t=this.bytes[r]-e.bytes[r];if(0!==t)return Math.sign(t)}return 0}}class Pe{constructor(){this.S=0,this.C=0,this.I=new Ae}generate(){var e=this.generateOrAbort();if(c(e)){this.S=0;var r=this.generateOrAbort();if(c(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.T();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return Se.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var ke,Oe=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;e.length>r;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ve&&!c(ve.crypto)&&crypto.getRandomValues&&(Oe=e=>crypto.getRandomValues(e));class Ae{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Oe(this.M),this.O=0),this.M[this.O++]}}var Be=()=>(ke||(ke=new Pe)).generate(),Ue="",Ie=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Te(e,r){if(r){var t=function(e,r){if(void 0===r&&(r=ge),Ue)return Ue;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var t=e.split("."),n=Math.min(t.length,8),i="dmn_chk_"+Be().toString();!Ue&&n--;){var o=t.slice(n).join("."),a=i+"=1;domain=."+o+";path=/";r.cookie=a+";max-age=3",r.cookie.includes(i)&&(r.cookie=a+";max-age=0",Ue=o)}return Ue}(e);if(!t){var n=(e=>{var r=e.match(Ie);return r?r[0]:""})(e);n!==t&&xe.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}var De={R:()=>!!ge,D(e){xe.error("cookieStore error: "+e)},A(e){if(ge){try{for(var r=e+"=",t=ge.cookie.split(";").filter((e=>e.length)),n=0;t.length>n;n++){for(var i=t[n];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(r))return decodeURIComponent(i.substring(r.length,i.length))}}catch(e){}return null}},F(e){var r;try{r=JSON.parse(De.A(e))||{}}catch(e){}return r},N(e,r,t,n,i){if(ge)try{var o="",a="",u=Te(ge.location.hostname,n);if(t){var l=new Date;l.setTime(l.getTime()+864e5*t),o="; expires="+l.toUTCString()}i&&(a="; secure");var s=e+"="+encodeURIComponent(JSON.stringify(r))+o+"; SameSite=Lax; path=/"+u+a;return s.length>3686.4&&xe.warn("cookieStore warning: large cookie, len="+s.length),ge.cookie=s,s}catch(e){return}},q(e,r){if(null!=ge&&ge.cookie)try{De.N(e,"",-1,r)}catch(e){return}}},Ne=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ce=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ne],Fe=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer","$screen_height","$screen_width","$viewport_height","$viewport_width","$raw_user_agent"],We="<masked>",je=["li_fat_id"];function ze(e,r,t){if(!ge)return{};var n,i,o,a=r?[...Ne,...t||[]]:[],l=(n=Me(ge.URL,a,We),i=Ce.concat(e||[]),o={},ye(i,(function(e){var r=function(e,r){for(var t,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;n.length>i;i++){var o=n[i].split("=");if(o[0]===r){t=o;break}}if(!u(t)||2>t.length)return"";var a=t[1];try{a=decodeURIComponent(a)}catch(e){xe.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")}(n,e);o[e]=r||null})),o),s=function(){var e={};return ye(je,(function(r){var t=De.A(r);e[r]=t||null})),e}();return Re(s,l)}function Le(){return navigator.language||navigator.userLanguage}var Ke="$direct";function He(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ge(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Ve(t,n){var i,o,u,l;if(!me)return{};var s,c,d,v,h,p,w,m,E,R,M=t?[...Ne,...n||[]]:[],[S,P]=function(e){for(var r=0;de.length>r;r++){var[t,n]=de[r],i=t.exec(e),o=i&&("function"==typeof n?n(i,e):n);if(o)return o}return["",""]}(me);return Re((E={$os:S,$os_version:P,$browser:le(me,navigator.vendor),$device:fe(me),$device_type:(c=me,d={userAgentDataPlatform:null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,maxTouchPoints:null==(o=navigator)?void 0:o.maxTouchPoints,screenWidth:null==ve||null==(u=ve.screen)?void 0:u.width,screenHeight:null==ve||null==(l=ve.screen)?void 0:l.height,devicePixelRatio:null==ve?void 0:ve.devicePixelRatio},m=fe(c),m===x||m===b||"Kobo"===m||"Kindle Fire"===m||m===Q?_:m===j||m===L||m===z||m===q?"Console":m===y?"Wearable":m?g:"Android"===(null==d?void 0:d.userAgentDataPlatform)&&(null!==(v=null==d?void 0:d.maxTouchPoints)&&void 0!==v?v:0)>0?600>Math.min(null!==(h=null==d?void 0:d.screenWidth)&&void 0!==h?h:0,null!==(p=null==d?void 0:d.screenHeight)&&void 0!==p?p:0)/(null!==(w=null==d?void 0:d.devicePixelRatio)&&void 0!==w?w:1)?g:_:"Desktop"),$timezone:He(),$timezone_offset:Ge()},R={},ye(E,(function(e,r){("[object String]"==a.call(e)&&e.length>0||f(e))&&(R[r]=e)})),R),{$current_url:Me(null==we?void 0:we.href,M,We),$host:null==we?void 0:we.host,$pathname:null==we?void 0:we.pathname,$raw_user_agent:me.length>1e3?me.substring(0,997)+"...":me,$browser_version:ce(me,navigator.vendor),$browser_language:Le(),$browser_language_prefix:(s=Le(),"string"==typeof s?s.split("-")[0]:void 0),$screen_height:null==ve?void 0:ve.screen.height,$screen_width:null==ve?void 0:ve.screen.width,$viewport_height:null==ve?void 0:ve.innerHeight,$viewport_width:null==ve?void 0:ve.innerWidth,$lib:r,$lib_version:e,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}function Xe(e,r){return[...e||[],...u(r)?r:[r]]}function qe(e,r){return(c(e)?1:e)*r}function Ye(e,r){return function(e){for(var r=0,t=0;e.length>t;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return Math.abs(r)}(e)%100<h(100*r,0,100,xe)}var Je=["type"];function Qe(e){var{type:r,executionTimeMs:t}=e;return r+(d(t)?"":" ("+t.toFixed(2)+"ms)")}var Ze=Ee("[PostHog Action RateLimiting]");function er(e,r){console.log(e,r)}function rr(e,r,t){if(void 0===t&&(t=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var n={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],u=r[o];if(c(a))n[o]=u;else if(c(u))n[o]=a;else if(!(a===u||d(a)&&d(u)))if(l(a)&&l(u))if(t>1){var f=rr(a,u,t-1);s(f)||(n[o]=f)}else n[o]="max depth reached, checking for changed value";else n[o]=u}return n}var tr,nr,ir,or=(tr=null,nr=0,ir=null,{info(e){ir!==e&&(nr=0,ir=e),nr++,tr&&clearTimeout(tr),tr=setTimeout((()=>{Ze.info(1===nr?'action "'+e+'" has been rate limited':'action "'+e+'" has been rate limited ('+nr+" times)"),nr=0,tr=null}),1e3)}});function ar(e){void 0===e&&(e={});var{maskAction:r,maskState:t,titleFunction:n=Qe,logger:i=er,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:u=10,__stateComparisonDepth:l}=e,s=new p({refillRate:a,bucketSize:u,refillInterval:1e3,Gt:Ze});return e=>a=>u=>{var c=u,d=e.getState(),f=performance.now(),v=a(c),h=performance.now()-f,p=e.getState(),g=r?r(c):c;if(!g)return v;if(s.consumeRateLimit(c.type))or.info(c.type);else try{var w=t?t(d,g):d,m=t?t(p,g):p,_=o.changedState?rr(w,m,null!=l?l:5):void 0,{type:b}=g,x={type:b,payload:function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(g,Je),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},E=n(x);i(E,x)}catch(e){Ze.error("Error logging state:",e)}return v}}_e.posthogCustomizations=Object.freeze({__proto__:null,browserConsoleLogger:er,posthogKeaLogger(e){void 0===e&&(e={});var r=ar(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}},posthogReduxLogger:ar,printAndDropEverything:e=>(console.log("Would have sent event:",e),null),sampleByDistinctId:e=>r=>r&&Ye(r.properties.distinct_id,e)?t({},r,{properties:t({},r.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null,sampleByEvent:(e,r)=>i=>{var o,a,u;return i?n(e,i.event)?100*Math.random()<h(100*r,0,100,xe)?t({},i,{properties:t({},i.properties,{$sample_type:Xe(null==(o=i.properties)?void 0:o.$sample_type,"sampleByEvent"),$sample_threshold:qe(null==(a=i.properties)?void 0:a.$sample_threshold,r),$sampled_events:Xe(null==(u=i.properties)?void 0:u.$sampled_events,e)})}):null:i:null},sampleBySessionId:e=>r=>r&&Ye(r.properties.$session_id,e)?t({},r,{properties:t({},r.properties,{$sample_type:Xe(r.properties.$sample_type,"sampleBySessionId"),$sample_threshold:qe(r.properties.$sample_threshold,e)})}):null,sessionRecordingLoggerForPostHogInstance:e=>(r,t)=>{var n;null==e||null==(n=e.sessionRecording)||n.tryAddCustomEvent("app-state",{title:r,stateEvent:t})},setAllPersonProfilePropertiesAsPersonPropertiesForFlags(e){var r,t=Re({},Ve(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),ze(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==ge?void 0:ge.referrer)||Ke,$referring_domain:null!=ge&&ge.referrer&&(null==(r=$e(ge.referrer))?void 0:r.host)||Ke}),i={};ye(t,(function(e,r){(n(Ce,r)||n(Fe,r))&&(i[r]=e)})),e.setPersonPropertiesForFlags(i)}})}();
2
2
  //# sourceMappingURL=customizations.full.js.map
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(t){for(var r=1;arguments.length>r;r++){var e=arguments[r];for(var i in e)({}).hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},t.apply(null,arguments)}var r="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:r;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var i=null==e?void 0:e.document;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var n=null!=r?r:{};function a(t,r){return-1!==t.indexOf(r)}var l=function(t){return t.trim()},o=Object.prototype,s=o.hasOwnProperty,u=o.toString,c=Array.isArray||function(t){return"[object Array]"===u.call(t)},v=t=>"function"==typeof t,h=t=>void 0===t,f=t=>"[object String]"==u.call(t),d=t=>null===t,_=t=>h(t)||d(t),m=t=>"[object Number]"==u.call(t)&&t==t,b=t=>t instanceof FormData,p=function(t,e){var{debugEnabled:i}=void 0===e?{}:e,a={k(e){if(r&&(n.POSTHOG_DEBUG||i)&&!h(r.console)&&r.console){for(var a=("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e]),l=arguments.length,o=new Array(l>1?l-1:0),s=1;l>s;s++)o[s-1]=arguments[s];a(t,...o)}},debug(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("debug",...r)},info(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("log",...r)},warn(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("warn",...r)},error(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("error",...r)},critical(){for(var r=arguments.length,e=new Array(r),i=0;r>i;i++)e[i]=arguments[i];console.error(t,...e)},uninitializedWarning(t){a.error("You must initialize PostHog before calling "+t)},createLogger:(r,e)=>p(t+" "+r,e)};return a},g=p("[PostHog.js]"),y=g.createLogger;function k(t,r){if(!_(t))if(c(t))t.forEach(r);else if(b(t))t.forEach(((t,e)=>r(t,e)));else for(var e in t)s.call(t,e)&&r(t[e],e)}var w=function(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),i=1;r>i;i++)e[i-1]=arguments[i];for(var n of e)for(var a in n)void 0!==n[a]&&(t[a]=n[a]);return t};function A(t){for(var r=Object.keys(t),e=r.length,i=new Array(e);e--;)i[e]=[r[e],t[r[e]]];return i}function x(t,r,e,i){var{capture:n=!1,passive:a=!0}=null!=i?i:{};null==t||t.addEventListener(r,e,{capture:n,passive:a})}var E=1,O=3,C=11;function j(t){return!!t&&t.nodeType===E}function D(t,r){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===r.toLowerCase()}function L(t){return!!t&&t.nodeType===C&&j(t.host)}function T(t){return t?l(t).split(/\s+/):[]}function R(t){var r="";switch(typeof t.className){case"string":r=t.className;break;case"object":r=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:r=""}return T(r)}function M(t){var r="";return B(t)&&!F(t)&&t.childNodes&&t.childNodes.length&&k(t.childNodes,(function(t){var e,i;(function(t){return!!t&&t.nodeType===O})(t)&&t.textContent&&(r+=null!==(e=_(i=t.textContent)?null:l(i).split(/(\s+)/).filter((t=>Y(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))&&void 0!==e?e:"")})),l(r)}var I=["a","button","form","input","select","textarea","label"];function S(t){var r=t.parentNode;return!(!r||!j(r))&&r}var z=[".ph-no-deadclick",".ph-no-capture"];var H=t=>!t||D(t,"html")||!j(t),P=(t,e)=>{if(!r||H(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],a=t;a.parentNode&&!D(a,"body");)if(L(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var l=S(a);if(!l)break;if(I.indexOf(l.tagName.toLowerCase())>-1)i=!0;else{var o=r.getComputedStyle(l);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}n.push(l),a=l}return{parentIsUsefulElement:i,targetElementList:n}};function B(t){for(var r=t;r.parentNode&&!D(r,"body");r=r.parentNode){var e=R(r);if(a(e,"ph-sensitive")||a(e,"ph-no-capture"))return!1}if(a(R(t),"ph-include"))return!0;var i=t.type||"";if(f(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!f(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function F(t){return!!(D(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||D(t,"select")||D(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var N="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",U=new RegExp("^(?:"+N+")$"),V=new RegExp(N),W="\\d{3}-?\\d{2}-?\\d{4}",q=new RegExp("^("+W+")$"),G=new RegExp("("+W+")");function Y(t,r){if(void 0===r&&(r=!0),_(t))return!1;if(f(t)){if(t=l(t),(r?U:V).test((t||"").replace(/[- ]/g,"")))return!1;if((r?q:G).test(t))return!1}return!0}function Z(t){var r=M(t);return Y(r=(r+" "+J(t)).trim())?r:""}function J(t){var r="";return t&&t.childNodes&&t.childNodes.length&&k(t.childNodes,(function(t){var e;if(t&&"span"===(null==(e=t.tagName)?void 0:e.toLowerCase()))try{var i=M(t);r=(r+" "+i).trim(),t.childNodes&&t.childNodes.length&&(r=(r+" "+J(t)).trim())}catch(t){g.error("[AutoCapture]",t)}})),r}function K(t){return t.replace(/"|\\"/g,'\\"')}function Q(t){var r=t.attr__class;return r?c(r)?r:T(r):void 0}function X(t,r){return r.length>t?r.slice(0,t)+"...":r}function tt(t){if(t.previousElementSibling)return t.previousElementSibling;var r=t;do{r=r.previousSibling}while(r&&!j(r));return r}function rt(e,n){var l,o,{e:s,maskAllElementAttributes:u,maskAllText:c,elementAttributeIgnoreList:v}=n;if(!j(e))return{props:{}};for(var d=[e],_=e;_.parentNode&&!D(_,"body");)if(L(_.parentNode))d.push(_.parentNode.host),_=_.parentNode.host;else{if(!j(_.parentNode))break;d.push(_.parentNode),_=_.parentNode}var m,b,p,g,y=[],x={},E=!1,O=!1;if(k(d,(t=>{var r=B(t);if(D(t,"a")){var e=t.getAttribute("href");E=r&&!!e&&Y(e)&&e}a(R(t),"ph-no-capture")&&(O=!0),y.push(function(t,r,e,i){var n=t.tagName.toLowerCase(),a={tag_name:n};I.indexOf(n)>-1&&!e&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?X(1024,Z(t)):X(1024,M(t)));var l=R(t);l.length>0&&(a.classes=l.filter((function(t){return""!==t}))),k(t.attributes,(function(e){var n;if((!F(t)||-1!==["name","id","class","aria-label"].indexOf(e.name))&&(null==i||!i.includes(e.name))&&!r&&Y(e.value)&&(!f(n=e.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var l=e.value;"class"===e.name&&(l=T(l).join(" ")),a["attr__"+e.name]=X(1024,l)}}));for(var o=1,s=1,u=t;u=tt(u);)o++,u.tagName===t.tagName&&s++;return a.nth_child=o,a.nth_of_type=s,a}(t,u,c,v));var i=function(t){if(!B(t))return{};var r={};return k(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var e=t.name.replace("data-ph-capture-attribute-",""),i=t.value;e&&i&&Y(i)&&(r[e]=i)}})),r}(t);w(x,i)})),O)return{props:{},explicitNoCapture:O};if(c||(y[0].$el_text=D(e,"a")||D(e,"button")?Z(e):M(e)),E){var C,S;y[0].attr__href=E;var z=null==(b=E,p=null==i?void 0:i.createElement("a"),C=h(p)?null:(p.href=b,p))?void 0:C.host,H=null==r||null==(S=r.location)?void 0:S.host;z&&H&&z!==H&&(m=E)}return{props:w({$event_type:s.type,$ce_version:1},{$elements:y},{$elements_chain:(g=y,function(r){return r.map((r=>{var e,i,n="";if(r.tag_name&&(n+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))n+="."+a.replace(/"/g,"");var l=t({},r.text?{text:r.text}:{},{"nth-child":null!==(e=r.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=r.nth_of_type)&&void 0!==i?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),o={};return A(l).sort(((t,r)=>{var[e]=t,[i]=r;return e.localeCompare(i)})).forEach((t=>{var[r,e]=t;return o[K(r.toString())]=K(e.toString())})),(n+=":")+A(o).map((t=>{var[r,e]=t;return r+'="'+e+'"'})).join("")})).join(";")}(function(t){return t.map((t=>{var r,e,i={text:null==(r=t.$el_text)?void 0:r.slice(0,400),tag_name:t.tag_name,href:null==(e=t.attr__href)?void 0:e.slice(0,2048),attr_class:Q(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return A(t).filter((t=>{var[r]=t;return 0===r.indexOf("attr__")})).forEach((t=>{var[r,e]=t;return i.attributes[r]=e})),i}))}(g)))},null!=(l=y[0])&&l.$el_text?{$el_text:null==(o=y[0])?void 0:o.$el_text}:{},m&&"click"===s.type?{$external_click_url:m}:{},x)}}y("[AutoCapture]");var et={};function it(t){return function(t,e){var i=et[t];if(i)return i;var n,a=e[t];if(v(n=a)&&-1!==n.toString().indexOf("[native code]")&&!r.Zone)return et[t]=a.bind(e);var l=e.document;if(l&&v(l.createElement))try{var o=l.createElement("iframe");o.hidden=!0,l.head.appendChild(o);var s=o.contentWindow;s&&s[t]&&(a=s[t]),l.head.removeChild(o)}catch(r){g.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",r)}return a&&v(a)?et[t]=a.bind(e):a}("MutationObserver",t)}function nt(t,r){return m(t)&&t>=r}class at{St(t){var r,e,i,n,a,l=this.Ct((null==t?void 0:t.__onCapture)||this.It.bind(this));return{element_attribute_ignorelist:null!==(r=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==r?r:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(e=null==t?void 0:t.scroll_threshold_ms)&&void 0!==e?e:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(t,r){this.Tt=[],this.Ct=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.Mt=t=>{var r=function(t){var r,e,i=h((r=t).target)?r.srcElement||null:null!=(e=r.target)&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;return i?{node:i,originalEvent:t,timestamp:Date.now()}:null}(t);d(r)||this._t(r)||this.Tt.push(r),this.Tt.length&&h(this.Lt)&&(this.Lt=n.setTimeout((()=>{this.Et()}),1e3))},this.Ot=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((r=>{h(r.scrollDelayMs)&&(r.scrollDelayMs=t-r.timestamp)}))},this.Rt=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==i?void 0:i.visibilityState)&&(this.Pt=Date.now())},this.instance=t,this.qt=this.St(r),this._onCapture=this.qt.__onCapture}start(t){this.Dt(),this.Ft(),this.jt(),this.Ht(),this.Ut(t)}Ut(t){if(!this.Bt){var r=it(n);this.Bt=new r((t=>{this.Vt(t)})),this.Bt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Bt)||t.disconnect(),this.Bt=void 0,n.removeEventListener("click",this.Mt),n.removeEventListener("scroll",this.Ot,{capture:!0}),n.removeEventListener("selectionchange",this.Rt),null==i||i.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){x(n,"click",this.Mt)}Ft(){x(n,"scroll",this.Ot,{capture:!0})}jt(){x(n,"selectionchange",this.Rt)}Ht(){x(i,"visibilitychange",this.At)}_t(t){return!(t&&(this.qt.capture_clicks_with_modifier_keys||!((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))&&!((i=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===i.id||null!=i.closest&&i.closest(".toolbar-global-fade-container")))&&!this.Tt.some((r=>r.node===t.node&&1e3>Math.abs(r.timestamp-t.timestamp)))&&!D(t.node,"html")&&j(t.node)&&!function(t){if(!r||H(t))return!1;var{targetElementList:e}=P(t);return e.some((t=>D(t,"a")))}(t.node)&&function(t,e){var i;if(!r||H(t))return!1;var n="[object Boolean]"===u.call(e)?z:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:z,{targetElementList:a}=P(t);return!function(t,r){if(h(r))return!0;var e,i=function(t){if(r.some((r=>t.matches(r))))return{v:!0}};for(var n of t)if(e=i(n))return e.v;return!1}(a,n)}(t.node,{css_selector_ignorelist:this.qt.css_selector_ignorelist}));var e,i}Et(){if(this.Tt.length){clearTimeout(this.Lt),this.Lt=void 0;var t=this.Tt;for(var r of(this.Tt=[],t)){var e;r.mutationDelayMs=null!==(e=r.mutationDelayMs)&&void 0!==e?e:this.Wt&&this.Wt>=r.timestamp?this.Wt-r.timestamp:void 0,r.absoluteDelayMs=Date.now()-r.timestamp,r.selectionChangedDelayMs=this.Nt&&this.Nt>=r.timestamp?this.Nt-r.timestamp:void 0,r.visibilityChangedDelayMs=this.Pt?Math.abs(r.timestamp-this.Pt):void 0;var i=nt(r.scrollDelayMs,this.qt.scroll_threshold_ms),a=nt(r.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),l=nt(r.mutationDelayMs,this.qt.mutation_threshold_ms),o=nt(r.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),s=m(r.scrollDelayMs)&&this.qt.scroll_threshold_ms>r.scrollDelayMs,u=m(r.mutationDelayMs)&&this.qt.mutation_threshold_ms>r.mutationDelayMs,c=m(r.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>r.selectionChangedDelayMs,v=m(r.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>r.visibilityChangedDelayMs;if(!(s||u||c||v)){var f=nt(r.visibilityChangedDelayMs,this.qt.selection_change_threshold_ms);i||l||o||a||f?this._onCapture(r,{$dead_click_last_mutation_timestamp:this.Wt,$dead_click_event_timestamp:r.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:l,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:a,$dead_click_visibility_changed_timeout:f}):this.qt.mutation_threshold_ms>r.absoluteDelayMs&&this.Tt.push(r)}}this.Tt.length&&h(this.Lt)&&(this.Lt=n.setTimeout((()=>{this.Et()}),1e3))}}It(r,e){this.instance.capture("$dead_click",t({},e,rt(r.node,{e:r.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist}).props,{$dead_click_scroll_delay_ms:r.scrollDelayMs,$dead_click_mutation_delay_ms:r.mutationDelayMs,$dead_click_absolute_delay_ms:r.absoluteDelayMs,$dead_click_selection_changed_delay_ms:r.selectionChangedDelayMs,$dead_click_visibility_changed_delay_ms:r.visibilityChangedDelayMs}),{timestamp:new Date(r.timestamp)})}}n.__PosthogExtensions__=n.__PosthogExtensions__||{},n.__PosthogExtensions__.initDeadClicksAutocapture=(t,r)=>new at(t,r)}();
1
+ !function(){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(t){for(var r=1;arguments.length>r;r++){var e=arguments[r];for(var i in e)({}).hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},t.apply(null,arguments)}var r="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:r;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var i=null==e?void 0:e.document;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var n=null!=r?r:{};function a(t,r){return-1!==t.indexOf(r)}var l=function(t){return t.trim()},o=Object.prototype,s=o.hasOwnProperty,u=o.toString,c=Array.isArray||function(t){return"[object Array]"===u.call(t)},v=t=>"function"==typeof t,h=t=>void 0===t,f=t=>"[object String]"==u.call(t),d=t=>null===t,_=t=>h(t)||d(t),m=t=>"[object Number]"==u.call(t)&&t==t,b=t=>t instanceof FormData,p=function(t,e){var{debugEnabled:i}=void 0===e?{}:e,a={k(e){if(r&&(n.POSTHOG_DEBUG||i)&&!h(r.console)&&r.console){for(var a=("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e]),l=arguments.length,o=new Array(l>1?l-1:0),s=1;l>s;s++)o[s-1]=arguments[s];a(t,...o)}},debug(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("debug",...r)},info(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("log",...r)},warn(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("warn",...r)},error(){for(var t=arguments.length,r=new Array(t),e=0;t>e;e++)r[e]=arguments[e];a.k("error",...r)},critical(){for(var r=arguments.length,e=new Array(r),i=0;r>i;i++)e[i]=arguments[i];console.error(t,...e)},uninitializedWarning(t){a.error("You must initialize PostHog before calling "+t)},createLogger:(r,e)=>p(t+" "+r,e)};return a},g=p("[PostHog.js]"),y=g.createLogger;function k(t,r){if(!_(t))if(c(t))t.forEach(r);else if(b(t))t.forEach(((t,e)=>r(t,e)));else for(var e in t)s.call(t,e)&&r(t[e],e)}var w=function(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),i=1;r>i;i++)e[i-1]=arguments[i];for(var n of e)for(var a in n)void 0!==n[a]&&(t[a]=n[a]);return t};function A(t){for(var r=Object.keys(t),e=r.length,i=new Array(e);e--;)i[e]=[r[e],t[r[e]]];return i}function x(t,r,e,i){var{capture:n=!1,passive:a=!0}=null!=i?i:{};null==t||t.addEventListener(r,e,{capture:n,passive:a})}var E=1,O=3,C=11;function j(t){return!!t&&t.nodeType===E}function D(t,r){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===r.toLowerCase()}function L(t){return!!t&&t.nodeType===C&&j(t.host)}function T(t){return t?l(t).split(/\s+/):[]}function R(t){var r="";switch(typeof t.className){case"string":r=t.className;break;case"object":r=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:r=""}return T(r)}function M(t){var r="";return B(t)&&!F(t)&&t.childNodes&&t.childNodes.length&&k(t.childNodes,(function(t){var e,i;(function(t){return!!t&&t.nodeType===O})(t)&&t.textContent&&(r+=null!==(e=_(i=t.textContent)?null:l(i).split(/(\s+)/).filter((t=>Y(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))&&void 0!==e?e:"")})),l(r)}var I=["a","button","form","input","select","textarea","label"];function S(t){var r=t.parentNode;return!(!r||!j(r))&&r}var z=[".ph-no-deadclick",".ph-no-capture"];var H=t=>!t||D(t,"html")||!j(t),P=(t,e)=>{if(!r||H(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],a=t;a.parentNode&&!D(a,"body");)if(L(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var l=S(a);if(!l)break;if(I.indexOf(l.tagName.toLowerCase())>-1)i=!0;else{var o=r.getComputedStyle(l);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}n.push(l),a=l}return{parentIsUsefulElement:i,targetElementList:n}};function B(t){for(var r=t;r.parentNode&&!D(r,"body");r=r.parentNode){var e=R(r);if(a(e,"ph-sensitive")||a(e,"ph-no-capture"))return!1}if(a(R(t),"ph-include"))return!0;var i=t.type||"";if(f(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!f(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function F(t){return!!(D(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||D(t,"select")||D(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var N="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",U=new RegExp("^(?:"+N+")$"),V=new RegExp(N),W="\\d{3}-?\\d{2}-?\\d{4}",q=new RegExp("^("+W+")$"),G=new RegExp("("+W+")");function Y(t,r){if(void 0===r&&(r=!0),_(t))return!1;if(f(t)){if(t=l(t),(r?U:V).test((t||"").replace(/[- ]/g,"")))return!1;if((r?q:G).test(t))return!1}return!0}function Z(t){var r=M(t);return Y(r=(r+" "+J(t)).trim())?r:""}function J(t){var r="";return t&&t.childNodes&&t.childNodes.length&&k(t.childNodes,(function(t){var e;if(t&&"span"===(null==(e=t.tagName)?void 0:e.toLowerCase()))try{var i=M(t);r=(r+" "+i).trim(),t.childNodes&&t.childNodes.length&&(r=(r+" "+J(t)).trim())}catch(t){g.error("[AutoCapture]",t)}})),r}function K(t){return t.replace(/"|\\"/g,'\\"')}function Q(t){var r=t.attr__class;return r?c(r)?r:T(r):void 0}function X(t,r){return r.length>t?r.slice(0,t)+"...":r}function tt(t){if(t.previousElementSibling)return t.previousElementSibling;var r=t;do{r=r.previousSibling}while(r&&!j(r));return r}function rt(e,n){var l,o,{e:s,maskAllElementAttributes:u,maskAllText:c,elementAttributeIgnoreList:v}=n;if(!j(e))return{props:{}};for(var d=[e],_=e;_.parentNode&&!D(_,"body");)if(L(_.parentNode))d.push(_.parentNode.host),_=_.parentNode.host;else{if(!j(_.parentNode))break;d.push(_.parentNode),_=_.parentNode}var m,b,p,g,y=[],x={},E=!1,O=!1;if(k(d,(t=>{var r=B(t);if(D(t,"a")){var e=t.getAttribute("href");E=r&&!!e&&Y(e)&&e}a(R(t),"ph-no-capture")&&(O=!0),y.push(function(t,r,e,i){var n=t.tagName.toLowerCase(),a={tag_name:n};I.indexOf(n)>-1&&!e&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?X(1024,Z(t)):X(1024,M(t)));var l=R(t);l.length>0&&(a.classes=l.filter((function(t){return""!==t}))),k(t.attributes,(function(e){var n;if((!F(t)||-1!==["name","id","class","aria-label"].indexOf(e.name))&&(null==i||!i.includes(e.name))&&!r&&Y(e.value)&&(!f(n=e.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var l=e.value;"class"===e.name&&(l=T(l).join(" ")),a["attr__"+e.name]=X(1024,l)}}));for(var o=1,s=1,u=t;u=tt(u);)o++,u.tagName===t.tagName&&s++;return a.nth_child=o,a.nth_of_type=s,a}(t,u,c,v));var i=function(t){if(!B(t))return{};var r={};return k(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var e=t.name.replace("data-ph-capture-attribute-",""),i=t.value;e&&i&&Y(i)&&(r[e]=i)}})),r}(t);w(x,i)})),O)return{props:{},explicitNoCapture:O};if(c||(y[0].$el_text=D(e,"a")||D(e,"button")?Z(e):M(e)),E){var C,S;y[0].attr__href=E;var z=null==(b=E,p=null==i?void 0:i.createElement("a"),C=h(p)?null:(p.href=b,p))?void 0:C.host,H=null==r||null==(S=r.location)?void 0:S.host;z&&H&&z!==H&&(m=E)}return{props:w({$event_type:s.type,$ce_version:1},{$elements:y},{$elements_chain:(g=y,function(r){return r.map((r=>{var e,i,n="";if(r.tag_name&&(n+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))n+="."+a.replace(/"/g,"");var l=t({},r.text?{text:r.text}:{},{"nth-child":null!==(e=r.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=r.nth_of_type)&&void 0!==i?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),o={};return A(l).sort(((t,r)=>{var[e]=t,[i]=r;return e.localeCompare(i)})).forEach((t=>{var[r,e]=t;return o[K(r.toString())]=K(e.toString())})),(n+=":")+A(o).map((t=>{var[r,e]=t;return r+'="'+e+'"'})).join("")})).join(";")}(function(t){return t.map((t=>{var r,e,i={text:null==(r=t.$el_text)?void 0:r.slice(0,400),tag_name:t.tag_name,href:null==(e=t.attr__href)?void 0:e.slice(0,2048),attr_class:Q(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return A(t).filter((t=>{var[r]=t;return 0===r.indexOf("attr__")})).forEach((t=>{var[r,e]=t;return i.attributes[r]=e})),i}))}(g)))},null!=(l=y[0])&&l.$el_text?{$el_text:null==(o=y[0])?void 0:o.$el_text}:{},m&&"click"===s.type?{$external_click_url:m}:{},x)}}y("[AutoCapture]");var et={};function it(t){return function(t,e){var i=et[t];if(i)return i;var n,a=e[t];if(v(n=a)&&-1!==n.toString().indexOf("[native code]")&&!r.Zone)return et[t]=a.bind(e);var l=e.document;if(l&&v(l.createElement))try{var o=l.createElement("iframe");o.hidden=!0,l.head.appendChild(o);var s=o.contentWindow;s&&s[t]&&(a=s[t]),l.head.removeChild(o)}catch(r){g.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",r)}return a&&v(a)?et[t]=a.bind(e):a}("MutationObserver",t)}function nt(t,r){return m(t)&&t>=r}class at{St(t){var r,e,i,n,a,l=this.Ct((null==t?void 0:t.__onCapture)||this.It.bind(this));return{element_attribute_ignorelist:null!==(r=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==r?r:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(e=null==t?void 0:t.scroll_threshold_ms)&&void 0!==e?e:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(t,r){this.Tt=[],this.Ct=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.Mt=t=>{var r=function(t){var r,e,i=h((r=t).target)?r.srcElement||null:null!=(e=r.target)&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;return i?{node:i,originalEvent:t,timestamp:Date.now()}:null}(t);d(r)||this._t(r)||this.Tt.push(r),this.Tt.length&&h(this.Lt)&&(this.Lt=n.setTimeout((()=>{this.Ot()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((r=>{h(r.scrollDelayMs)&&(r.scrollDelayMs=t-r.timestamp)}))},this.Rt=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==i?void 0:i.visibilityState)&&(this.Pt=Date.now())},this.instance=t,this.qt=this.St(r),this._onCapture=this.qt.__onCapture}start(t){this.Dt(),this.Ft(),this.jt(),this.Ht(),this.Ut(t)}Ut(t){if(!this.Bt){var r=it(n);this.Bt=new r((t=>{this.Vt(t)})),this.Bt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Bt)||t.disconnect(),this.Bt=void 0,n.removeEventListener("click",this.Mt),n.removeEventListener("scroll",this.Et,{capture:!0}),n.removeEventListener("selectionchange",this.Rt),null==i||i.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){x(n,"click",this.Mt)}Ft(){x(n,"scroll",this.Et,{capture:!0})}jt(){x(n,"selectionchange",this.Rt)}Ht(){x(i,"visibilitychange",this.At)}_t(t){return!(t&&(this.qt.capture_clicks_with_modifier_keys||!((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))&&!((i=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===i.id||null!=i.closest&&i.closest(".toolbar-global-fade-container")))&&!this.Tt.some((r=>r.node===t.node&&1e3>Math.abs(r.timestamp-t.timestamp)))&&!D(t.node,"html")&&j(t.node)&&!function(t){if(!r||H(t))return!1;var{targetElementList:e}=P(t);return e.some((t=>D(t,"a")))}(t.node)&&function(t,e){var i;if(!r||H(t))return!1;var n="[object Boolean]"===u.call(e)?z:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:z,{targetElementList:a}=P(t);return!function(t,r){if(h(r))return!0;var e,i=function(t){if(r.some((r=>t.matches(r))))return{v:!0}};for(var n of t)if(e=i(n))return e.v;return!1}(a,n)}(t.node,{css_selector_ignorelist:this.qt.css_selector_ignorelist}));var e,i}Ot(){if(this.Tt.length){clearTimeout(this.Lt),this.Lt=void 0;var t=this.Tt;for(var r of(this.Tt=[],t)){var e;r.mutationDelayMs=null!==(e=r.mutationDelayMs)&&void 0!==e?e:this.Wt&&this.Wt>=r.timestamp?this.Wt-r.timestamp:void 0,r.absoluteDelayMs=Date.now()-r.timestamp,r.selectionChangedDelayMs=this.Nt&&this.Nt>=r.timestamp?this.Nt-r.timestamp:void 0,r.visibilityChangedDelayMs=this.Pt?Math.abs(r.timestamp-this.Pt):void 0;var i=nt(r.scrollDelayMs,this.qt.scroll_threshold_ms),a=nt(r.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),l=nt(r.mutationDelayMs,this.qt.mutation_threshold_ms),o=nt(r.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),s=m(r.scrollDelayMs)&&this.qt.scroll_threshold_ms>r.scrollDelayMs,u=m(r.mutationDelayMs)&&this.qt.mutation_threshold_ms>r.mutationDelayMs,c=m(r.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>r.selectionChangedDelayMs,v=m(r.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>r.visibilityChangedDelayMs;if(!(s||u||c||v)){var f=nt(r.visibilityChangedDelayMs,this.qt.selection_change_threshold_ms);i||l||o||a||f?this._onCapture(r,{$dead_click_last_mutation_timestamp:this.Wt,$dead_click_event_timestamp:r.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:l,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:a,$dead_click_visibility_changed_timeout:f}):this.qt.mutation_threshold_ms>r.absoluteDelayMs&&this.Tt.push(r)}}this.Tt.length&&h(this.Lt)&&(this.Lt=n.setTimeout((()=>{this.Ot()}),1e3))}}It(r,e){this.instance.capture("$dead_click",t({},e,rt(r.node,{e:r.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist}).props,{$dead_click_scroll_delay_ms:r.scrollDelayMs,$dead_click_mutation_delay_ms:r.mutationDelayMs,$dead_click_absolute_delay_ms:r.absoluteDelayMs,$dead_click_selection_changed_delay_ms:r.selectionChangedDelayMs,$dead_click_visibility_changed_delay_ms:r.visibilityChangedDelayMs}),{timestamp:new Date(r.timestamp)})}}n.__PosthogExtensions__=n.__PosthogExtensions__||{},n.__PosthogExtensions__.initDeadClicksAutocapture=(t,r)=>new at(t,r)}();
2
2
  //# sourceMappingURL=dead-clicks-autocapture.js.map