posthog-js 1.316.0 → 1.317.0

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.
Files changed (86) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/element-inference.d.ts +21 -0
  13. package/dist/element-inference.js +2 -0
  14. package/dist/element-inference.js.map +1 -0
  15. package/dist/lazy-recorder.js +1 -1
  16. package/dist/main.js +1 -1
  17. package/dist/main.js.map +1 -1
  18. package/dist/module.d.ts +12 -0
  19. package/dist/module.full.d.ts +12 -0
  20. package/dist/module.full.js +1 -1
  21. package/dist/module.full.js.map +1 -1
  22. package/dist/module.full.no-external.d.ts +12 -0
  23. package/dist/module.full.no-external.js +1 -1
  24. package/dist/module.full.no-external.js.map +1 -1
  25. package/dist/module.js +1 -1
  26. package/dist/module.js.map +1 -1
  27. package/dist/module.no-external.d.ts +12 -0
  28. package/dist/module.no-external.js +1 -1
  29. package/dist/module.no-external.js.map +1 -1
  30. package/dist/posthog-recorder.js +1 -1
  31. package/dist/product-tours-preview.d.ts +12 -0
  32. package/dist/product-tours-preview.js +1 -1
  33. package/dist/product-tours-preview.js.map +1 -1
  34. package/dist/product-tours.js +1 -1
  35. package/dist/product-tours.js.map +1 -1
  36. package/dist/src/entrypoints/element-inference.es.d.ts +1 -0
  37. package/dist/src/entrypoints/product-tours.d.ts +2 -0
  38. package/dist/src/extensions/product-tours/element-inference.d.ts +30 -0
  39. package/dist/src/extensions/product-tours/index.d.ts +2 -0
  40. package/dist/src/extensions/product-tours/product-tours-utils.d.ts +2 -1
  41. package/dist/src/extensions/surveys.d.ts +2 -2
  42. package/dist/src/posthog-product-tours-types.d.ts +7 -0
  43. package/dist/src/utils/survey-branching.d.ts +11 -0
  44. package/dist/src/utils/survey-url-prefill.d.ts +7 -5
  45. package/dist/surveys-preview.d.ts +18 -1
  46. package/dist/surveys-preview.js +1 -1
  47. package/dist/surveys-preview.js.map +1 -1
  48. package/dist/surveys.js +1 -1
  49. package/dist/surveys.js.map +1 -1
  50. package/lib/package.json +5 -1
  51. package/lib/src/entrypoints/element-inference.es.d.ts +1 -0
  52. package/lib/src/entrypoints/element-inference.es.js +8 -0
  53. package/lib/src/entrypoints/element-inference.es.js.map +1 -0
  54. package/lib/src/entrypoints/product-tours.d.ts +2 -0
  55. package/lib/src/entrypoints/product-tours.js +5 -0
  56. package/lib/src/entrypoints/product-tours.js.map +1 -1
  57. package/lib/src/extensions/product-tours/components/ProductTourTooltip.js +5 -2
  58. package/lib/src/extensions/product-tours/components/ProductTourTooltip.js.map +1 -1
  59. package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js +1 -1
  60. package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js.map +1 -1
  61. package/lib/src/extensions/product-tours/element-inference.d.ts +30 -0
  62. package/lib/src/extensions/product-tours/element-inference.js +296 -0
  63. package/lib/src/extensions/product-tours/element-inference.js.map +1 -0
  64. package/lib/src/extensions/product-tours/index.d.ts +2 -0
  65. package/lib/src/extensions/product-tours/index.js +4 -1
  66. package/lib/src/extensions/product-tours/index.js.map +1 -1
  67. package/lib/src/extensions/product-tours/preview.js +1 -1
  68. package/lib/src/extensions/product-tours/preview.js.map +1 -1
  69. package/lib/src/extensions/product-tours/product-tours-utils.d.ts +2 -1
  70. package/lib/src/extensions/product-tours/product-tours-utils.js +12 -0
  71. package/lib/src/extensions/product-tours/product-tours-utils.js.map +1 -1
  72. package/lib/src/extensions/product-tours/product-tours.js +15 -31
  73. package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
  74. package/lib/src/extensions/surveys.d.ts +2 -2
  75. package/lib/src/extensions/surveys.js +5 -94
  76. package/lib/src/extensions/surveys.js.map +1 -1
  77. package/lib/src/posthog-product-tours-types.d.ts +7 -0
  78. package/lib/src/posthog-product-tours-types.js.map +1 -1
  79. package/lib/src/utils/survey-branching.d.ts +11 -0
  80. package/lib/src/utils/survey-branching.js +106 -0
  81. package/lib/src/utils/survey-branching.js.map +1 -0
  82. package/lib/src/utils/survey-url-prefill.d.ts +7 -5
  83. package/lib/src/utils/survey-url-prefill.js +30 -18
  84. package/lib/src/utils/survey-url-prefill.js.map +1 -1
  85. package/lib/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +7 -3
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:e;"undefined"==typeof self&&(r.self=r),"undefined"==typeof File&&(r.File=function(){});var n=Array.prototype.forEach,t=null==r?void 0:r.navigator,i=null==r?void 0:r.document,o=null==r?void 0:r.location;null==r||r.fetch,null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest&&r.XMLHttpRequest,null==r||r.AbortController;var a=null==t?void 0:t.userAgent,u=null!=e?e:{},s={LIB_VERSION:"1.316.0"};function l(){return l=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},l.apply(null,arguments)}function c(e,r){return-1!==e.indexOf(r)}var f=Array.isArray,d=Object.prototype,v=d.hasOwnProperty,h=d.toString,p=f||function(e){return"[object Array]"===h.call(e)},g=e=>e===Object(e)&&!p(e),w=e=>{if(g(e)){for(var r in e)if(v.call(e,r))return!1;return!0}return!1},m=e=>void 0===e,_=e=>m(e)||(e=>null===e)(e),b=e=>"[object Number]"==h.call(e),x=e=>e instanceof FormData;function y(e,r,n,t,i){return r>n&&(t.warn("min cannot be greater than max."),r=n),b(e)?e>n?(t.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e<r?(t.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(t.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),y(n,r,n,t))}class E{constructor(e){this.t={},this.i=e.i,this.o=y(e.bucketSize,0,100,e.u),this.l=y(e.refillRate,0,this.o,e.u),this.v=y(e.refillInterval,0,864e5,e.u)}h(e,r){var n=r-e.lastAccess,t=Math.floor(n/this.v);if(t>0){var i=t*this.l;e.tokens=Math.min(e.tokens+i,this.o),e.lastAccess=e.lastAccess+t*this.v}}consumeRateLimit(e){var r,n=Date.now(),t=String(e),i=this.t[t];return i?this.h(i,n):(i={tokens:this.o,lastAccess:n},this.t[t]=i),0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.i)||r.call(this,e)),0===i.tokens)}stop(){this.t={}}}var R="Mobile",S="iOS",M="Android",k="Tablet",P=M+" "+k,A="iPad",O="Apple",B=O+" Watch",I="Safari",U="BlackBerry",N="Samsung",T=N+"Browser",C=N+" Internet",D="Chrome",F=D+" OS",W=D+" "+S,j="Internet Explorer",z=j+" "+R,L="Opera",K=L+" Mini",V="Edge",G="Microsoft "+V,H="Firefox",X=H+" "+S,q="Nintendo",Y="PlayStation",J="Xbox",Q=M+" "+R,Z=R+" "+I,ee="Windows",re=ee+" Phone",ne="Nokia",te="Ouya",ie="Generic",oe=ie+" "+R.toLowerCase(),ae=ie+" "+k.toLowerCase(),ue="Konqueror",se="(\\d+(\\.\\d+)?)",le=new RegExp("Version/"+se),ce=new RegExp(J,"i"),fe=new RegExp(Y+" \\w+","i"),de=new RegExp(q+" \\w+","i"),ve=new RegExp(U+"|PlayBook|BB10","i"),he={"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"};var pe=(e,r)=>r&&c(r,O)||function(e){return c(e,I)&&!c(e,D)&&!c(e,M)}(e),ge=function(e,r){return r=r||"",c(e," OPR/")&&c(e,"Mini")?K:c(e," OPR/")?L:ve.test(e)?U:c(e,"IE"+R)||c(e,"WPDesktop")?z:c(e,T)?C:c(e,V)||c(e,"Edg/")?G:c(e,"FBIOS")?"Facebook "+R:c(e,"UCWEB")||c(e,"UCBrowser")?"UC Browser":c(e,"CriOS")?W:c(e,"CrMo")||c(e,D)?D:c(e,M)&&c(e,I)?Q:c(e,"FxiOS")?X:c(e.toLowerCase(),ue.toLowerCase())?ue:pe(e,r)?c(e,R)?Z:I:c(e,H)?H:c(e,"MSIE")||c(e,"Trident/")?j:c(e,"Gecko")?H:""},we={[z]:[new RegExp("rv:"+se)],[G]:[new RegExp(V+"?\\/"+se)],[D]:[new RegExp("("+D+"|CrMo)\\/"+se)],[W]:[new RegExp("CriOS\\/"+se)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+se)],[I]:[le],[Z]:[le],[L]:[new RegExp("(Opera|OPR)\\/"+se)],[H]:[new RegExp(H+"\\/"+se)],[X]:[new RegExp("FxiOS\\/"+se)],[ue]:[new RegExp("Konqueror[:/]?"+se,"i")],[U]:[new RegExp(U+" "+se),le],[Q]:[new RegExp("android\\s"+se,"i")],[C]:[new RegExp(T+"\\/"+se)],[j]:[new RegExp("(rv:|MSIE )"+se)],Mozilla:[new RegExp("rv:"+se)]},me=function(e,r){var n=ge(e,r),t=we[n];if(m(t))return null;for(var i=0;i<t.length;i++){var o=t[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},_e=[[new RegExp(J+"; "+J+" (.*?)[);]","i"),e=>[J,e&&e[1]||""]],[new RegExp(q,"i"),[q,""]],[new RegExp(Y,"i"),[Y,""]],[ve,[U,""]],[new RegExp(ee,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[re,""];if(new RegExp(R).test(r)&&!/IEMobile\b/.test(r))return[ee+" "+R,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=n[1],i=he[t]||"";return/arm/i.test(r)&&(i="RT"),[ee,i]}return[ee,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var r=[e[3],e[4],e[5]||"0"];return[S,r.join(".")]}return[S,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=m(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+M+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+M+")","i"),e=>{if(e&&e[2]){var r=[e[2],e[3],e[4]||"0"];return[M,r.join(".")]}return[M,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];r[1]=n.join(".")}return r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[F,""]],[/Linux|debian/i,["Linux",""]]],be=function(e){return de.test(e)?q:fe.test(e)?Y:ce.test(e)?J:new RegExp(te,"i").test(e)?te:new RegExp("("+re+"|WPDesktop)","i").test(e)?re:/iPad/.test(e)?A:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?B:ve.test(e)?U:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ne,"i").test(e)?ne:/(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(R).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:P:new RegExp("(pda|"+R+")","i").test(e)?oe:new RegExp(k,"i").test(e)&&!new RegExp(k+" pc","i").test(e)?ae:""},xe=function(r,n){var{debugEnabled:t}=void 0===n?{}:n,i={p:function(n){if(e&&(u.POSTHOG_DEBUG||t)&&!m(e.console)&&e.console){for(var i=("__rrweb_original__"in e.console[n]?e.console[n].__rrweb_original__:e.console[n]),o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];i(r,...a)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];i.p("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];i.p("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];i.p("error",...r)},critical:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];console.error(r,...n)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(e,n)=>xe(r+" "+e,n)};return i},ye=xe("[PostHog.js]"),Ee=ye.createLogger,Re={};function $e(e,r,t){if(p(e))if(n&&e.forEach===n)e.forEach(r,t);else if("length"in e&&e.length===+e.length)for(var i=0,o=e.length;i<o;i++)if(i in e&&r.call(t,e[i],i)===Re)return}function Se(e,r,n){if(!_(e)){if(p(e))return $e(e,r,n);if(x(e)){for(var t of e.entries())if(r.call(n,t[1],t[0])===Re)return}else for(var i in e)if(v.call(e,i)&&r.call(n,e[i],i)===Re)return}}var Me=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];return $e(n,(function(r){for(var n in r)void 0!==r[n]&&(e[n]=r[n])})),e},ke=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];return $e(n,(function(r){$e(r,(function(r){e.push(r)}))})),e},Pe=function(e){var r={};return Se(e,(function(e,n){var t;t=e,("[object String]"==h.call(t)&&e.length>0||b(e))&&(r[n]=e)})),r},Ae=e=>{var r=null==i?void 0:i.createElement("a");return m(r)?null:(r.href=e,r)},Oe=function(e,r){for(var n,t=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<t.length;i++){var o=t[i].split("=");if(o[0]===r){n=o;break}}if(!p(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){ye.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Be=function(e,r,n){if(!e||!r||!r.length)return e;for(var t=e.split("#"),i=t[0]||"",o=t[1],a=i.split("?"),u=a[1],s=a[0],l=(u||"").split("&"),c=[],f=0;f<l.length;f++){var d=l[f].split("=");p(d)&&(r.includes(d[0])?c.push(d[0]+"="+n):c.push(l[f]))}var v=s;return null!=u&&(v+="?"+c.join("&")),null!=o&&(v+="#"+o),v};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return b(e)&&isFinite(e)&&Math.floor(e)===e});var Ie="0123456789abcdef";class Ue{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,t){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(t)||e<0||r<0||n<0||t<0||e>0xffffffffffff||r>4095||n>1073741823||t>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|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=t>>>24,i[13]=t>>>16,i[14]=t>>>8,i[15]=t,new Ue(i)}toString(){for(var e="",r=0;r<this.bytes.length;r++)e=e+Ie.charAt(this.bytes[r]>>>4)+Ie.charAt(15&this.bytes[r]),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 Ue(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;r<16;r++){var n=this.bytes[r]-e.bytes[r];if(0!==n)return Math.sign(n)}return 0}}class Ne{constructor(){this.m=0,this.R=0,this.$=new De}generate(){var e=this.generateOrAbort();if(m(e)){this.m=0;var r=this.generateOrAbort();if(m(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.m)this.m=e,this.S();else{if(!(e+1e4>this.m))return;this.R++,this.R>4398046511103&&(this.m++,this.S())}return Ue.fromFieldsV7(this.m,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.$.nextUint32())}S(){this.R=1024*this.$.nextUint32()+(1023&this.$.nextUint32())}}var Te,Ce=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;r<e.length;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!m(e.crypto)&&crypto.getRandomValues&&(Ce=e=>crypto.getRandomValues(e));class De{constructor(){this.M=new Uint32Array(8),this.k=1/0}nextUint32(){return this.k>=this.M.length&&(Ce(this.M),this.k=0),this.M[this.k++]}}var Fe=()=>We().toString(),We=()=>(Te||(Te=new Ne)).generate(),je="";var ze=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Le(e,r){if(r){var n=function(e,r){if(void 0===r&&(r=i),je)return je;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),t=Math.min(n.length,8),o="dmn_chk_"+Fe();!je&&t--;){var a=n.slice(t).join("."),u=o+"=1;domain=."+a+";path=/";r.cookie=u+";max-age=3",r.cookie.includes(o)&&(r.cookie=u+";max-age=0",je=a)}return je}(e);if(!n){var t=(e=>{var r=e.match(ze);return r?r[0]:""})(e);t!==n&&ye.info("Warning: cookie subdomain discovery mismatch",t,n),n=t}return n?"; domain=."+n:""}return""}var Ke={P:()=>!!i,A:function(e){ye.error("cookieStore error: "+e)},O:function(e){if(i){try{for(var r=e+"=",n=i.cookie.split(";").filter((e=>e.length)),t=0;t<n.length;t++){for(var o=n[t];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return decodeURIComponent(o.substring(r.length,o.length))}}catch(e){}return null}},B:function(e){var r;try{r=JSON.parse(Ke.O(e))||{}}catch(e){}return r},I:function(e,r,n,t,o){if(i)try{var a="",u="",s=Le(i.location.hostname,t);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}o&&(u="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(r))+a+"; SameSite=Lax; path=/"+s+u;return c.length>3686.4&&ye.warn("cookieStore warning: large cookie, len="+c.length),i.cookie=c,c}catch(e){return}},U:function(e,r){if(null!=i&&i.cookie)try{Ke.I(e,"",-1,r)}catch(e){return}}},Ve=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ge=ke(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Ve),He=["$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"],Xe="<masked>",qe=["li_fat_id"];function Ye(e,r,n){if(!i)return{};var t,o,a,u,s=r?ke([],Ve,n||[]):[],l=(t=Be(i.URL,s,Xe),o=e,a=Ge.concat(o||[]),u={},Se(a,(function(e){var r=Oe(t,e);u[e]=r||null})),u),c=function(){var e={};return Se(qe,(function(r){var n=Ke.O(r);e[r]=n||null})),e}();return Me(c,l)}function Je(){return navigator.language||navigator.userLanguage}function Qe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ze(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function er(r,n){if(!a)return{};var t,i,u,l=r?ke([],Ve,n||[]):[],[c,f]=function(e){for(var r=0;r<_e.length;r++){var[n,t]=_e[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]}(a);return Me(Pe({$os:c,$os_version:f,$browser:ge(a,navigator.vendor),$device:be(a),$device_type:(i=a,u=be(i),u===A||u===P||"Kobo"===u||"Kindle Fire"===u||u===ae?k:u===q||u===J||u===Y||u===te?"Console":u===B?"Wearable":u?R:"Desktop"),$timezone:Qe(),$timezone_offset:Ze()}),{$current_url:Be(null==o?void 0:o.href,l,Xe),$host:null==o?void 0:o.host,$pathname:null==o?void 0:o.pathname,$raw_user_agent:a.length>1e3?a.substring(0,997)+"...":a,$browser_version:me(a,navigator.vendor),$browser_language:Je(),$browser_language_prefix:(t=Je(),"string"==typeof t?t.split("-")[0]:void 0),$screen_height:null==e?void 0:e.screen.height,$screen_width:null==e?void 0:e.screen.width,$viewport_height:null==e?void 0:e.innerHeight,$viewport_width:null==e?void 0:e.innerWidth,$lib:"web",$lib_version:s.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}function rr(e,r){return[...e||[],...p(r)?r:[r]]}function nr(e,r){return(m(e)?1:e)*r}function tr(e,r){return function(e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<y(100*r,0,100,ye)}var ir=["type"];function or(e){var{type:r,executionTimeMs:n}=e;return""+r+(_(n)?"":" ("+n.toFixed(2)+"ms)")}var ar=Ee("[PostHog Action RateLimiting]");function ur(e,r){console.log(e,r)}function sr(e,r,n){if(void 0===n&&(n=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var t={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],u=r[o];if(m(a))t[o]=u;else if(m(u))t[o]=a;else if(!(a===u||_(a)&&_(u)))if(g(a)&&g(u))if(n>1){var s=sr(a,u,n-1);w(s)||(t[o]=s)}else t[o]="max depth reached, checking for changed value";else t[o]=u}return t}var lr,cr,fr,dr=(lr=null,cr=0,fr=null,{info:e=>{fr!==e&&(cr=0,fr=e),cr++,lr&&clearTimeout(lr),lr=setTimeout((()=>{var r=cr;1===r?ar.info('action "'+e+'" has been rate limited'):ar.info('action "'+e+'" has been rate limited ('+r+" times)"),cr=0,lr=null}),1e3)}});function vr(e){void 0===e&&(e={});var{maskAction:r,maskState:n,titleFunction:t=or,logger:i=ur,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:u=10,__stateComparisonDepth:s}=e,l=new E({refillRate:a,bucketSize:u,refillInterval:1e3,u:ar});return e=>a=>u=>{var c=u,f=e.getState(),d=performance.now(),v=a(c),h=performance.now()-d,p=e.getState(),g=r?r(c):c;if(!g)return v;if(l.consumeRateLimit(c.type))dr.info(c.type);else try{var w=n?n(f,g):f,m=n?n(p,g):p,_=o.changedState?sr(w,m,null!=s?s:5):void 0,{type:b}=g,x={type:b,payload:function(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==r.indexOf(t))continue;n[t]=e[t]}return n}(g,ir),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},y=t(x);i(y,x)}catch(e){ar.error("Error logging state:",e)}return v}}var hr=Object.freeze({__proto__:null,browserConsoleLogger:ur,posthogKeaLogger:function(e){void 0===e&&(e={});var r=vr(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}},posthogReduxLogger:vr,printAndDropEverything:e=>(console.log("Would have sent event:",e),null),sampleByDistinctId:function(e){return r=>r&&tr(r.properties.distinct_id,e)?l({},r,{properties:l({},r.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null},sampleByEvent:function(e,r){return n=>{var t,i,o;return n?c(e,n.event)?100*Math.random()<y(100*r,0,100,ye)?l({},n,{properties:l({},n.properties,{$sample_type:rr(null==(t=n.properties)?void 0:t.$sample_type,"sampleByEvent"),$sample_threshold:nr(null==(i=n.properties)?void 0:i.$sample_threshold,r),$sampled_events:rr(null==(o=n.properties)?void 0:o.$sampled_events,e)})}):null:n:null}},sampleBySessionId:function(e){return r=>r&&tr(r.properties.$session_id,e)?l({},r,{properties:l({},r.properties,{$sample_type:rr(r.properties.$sample_type,"sampleBySessionId"),$sample_threshold:nr(r.properties.$sample_threshold,e)})}):null},sessionRecordingLoggerForPostHogInstance:e=>(r,n)=>{var t;null==e||null==(t=e.sessionRecording)||t.tryAddCustomEvent("app-state",{title:r,stateEvent:n})},setAllPersonProfilePropertiesAsPersonPropertiesForFlags:e=>{var r,n=Me({},er(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),Ye(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==i?void 0:i.referrer)||"$direct",$referring_domain:null!=i&&i.referrer&&(null==(r=Ae(i.referrer))?void 0:r.host)||"$direct"}),t={};Se(n,(function(e,r){(c(Ge,r)||c(He,r))&&(t[r]=e)})),e.setPersonPropertiesForFlags(t)}});u.posthogCustomizations=hr}();
1
+ !function(){"use strict";var e="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:e;"undefined"==typeof self&&(r.self=r),"undefined"==typeof File&&(r.File=function(){});var n=Array.prototype.forEach,t=null==r?void 0:r.navigator,i=null==r?void 0:r.document,o=null==r?void 0:r.location;null==r||r.fetch,null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest&&r.XMLHttpRequest,null==r||r.AbortController;var a=null==t?void 0:t.userAgent,u=null!=e?e:{},s={LIB_VERSION:"1.317.0"};function l(){return l=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},l.apply(null,arguments)}function c(e,r){return-1!==e.indexOf(r)}var f=Array.isArray,d=Object.prototype,v=d.hasOwnProperty,h=d.toString,p=f||function(e){return"[object Array]"===h.call(e)},g=e=>e===Object(e)&&!p(e),w=e=>{if(g(e)){for(var r in e)if(v.call(e,r))return!1;return!0}return!1},m=e=>void 0===e,_=e=>m(e)||(e=>null===e)(e),b=e=>"[object Number]"==h.call(e),x=e=>e instanceof FormData;function y(e,r,n,t,i){return r>n&&(t.warn("min cannot be greater than max."),r=n),b(e)?e>n?(t.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e<r?(t.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(t.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),y(n,r,n,t))}class E{constructor(e){this.t={},this.i=e.i,this.o=y(e.bucketSize,0,100,e.u),this.l=y(e.refillRate,0,this.o,e.u),this.v=y(e.refillInterval,0,864e5,e.u)}h(e,r){var n=r-e.lastAccess,t=Math.floor(n/this.v);if(t>0){var i=t*this.l;e.tokens=Math.min(e.tokens+i,this.o),e.lastAccess=e.lastAccess+t*this.v}}consumeRateLimit(e){var r,n=Date.now(),t=String(e),i=this.t[t];return i?this.h(i,n):(i={tokens:this.o,lastAccess:n},this.t[t]=i),0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.i)||r.call(this,e)),0===i.tokens)}stop(){this.t={}}}var R="Mobile",S="iOS",M="Android",k="Tablet",P=M+" "+k,A="iPad",O="Apple",B=O+" Watch",I="Safari",U="BlackBerry",N="Samsung",T=N+"Browser",C=N+" Internet",D="Chrome",F=D+" OS",W=D+" "+S,j="Internet Explorer",z=j+" "+R,L="Opera",K=L+" Mini",V="Edge",G="Microsoft "+V,H="Firefox",X=H+" "+S,q="Nintendo",Y="PlayStation",J="Xbox",Q=M+" "+R,Z=R+" "+I,ee="Windows",re=ee+" Phone",ne="Nokia",te="Ouya",ie="Generic",oe=ie+" "+R.toLowerCase(),ae=ie+" "+k.toLowerCase(),ue="Konqueror",se="(\\d+(\\.\\d+)?)",le=new RegExp("Version/"+se),ce=new RegExp(J,"i"),fe=new RegExp(Y+" \\w+","i"),de=new RegExp(q+" \\w+","i"),ve=new RegExp(U+"|PlayBook|BB10","i"),he={"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"};var pe=(e,r)=>r&&c(r,O)||function(e){return c(e,I)&&!c(e,D)&&!c(e,M)}(e),ge=function(e,r){return r=r||"",c(e," OPR/")&&c(e,"Mini")?K:c(e," OPR/")?L:ve.test(e)?U:c(e,"IE"+R)||c(e,"WPDesktop")?z:c(e,T)?C:c(e,V)||c(e,"Edg/")?G:c(e,"FBIOS")?"Facebook "+R:c(e,"UCWEB")||c(e,"UCBrowser")?"UC Browser":c(e,"CriOS")?W:c(e,"CrMo")||c(e,D)?D:c(e,M)&&c(e,I)?Q:c(e,"FxiOS")?X:c(e.toLowerCase(),ue.toLowerCase())?ue:pe(e,r)?c(e,R)?Z:I:c(e,H)?H:c(e,"MSIE")||c(e,"Trident/")?j:c(e,"Gecko")?H:""},we={[z]:[new RegExp("rv:"+se)],[G]:[new RegExp(V+"?\\/"+se)],[D]:[new RegExp("("+D+"|CrMo)\\/"+se)],[W]:[new RegExp("CriOS\\/"+se)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+se)],[I]:[le],[Z]:[le],[L]:[new RegExp("(Opera|OPR)\\/"+se)],[H]:[new RegExp(H+"\\/"+se)],[X]:[new RegExp("FxiOS\\/"+se)],[ue]:[new RegExp("Konqueror[:/]?"+se,"i")],[U]:[new RegExp(U+" "+se),le],[Q]:[new RegExp("android\\s"+se,"i")],[C]:[new RegExp(T+"\\/"+se)],[j]:[new RegExp("(rv:|MSIE )"+se)],Mozilla:[new RegExp("rv:"+se)]},me=function(e,r){var n=ge(e,r),t=we[n];if(m(t))return null;for(var i=0;i<t.length;i++){var o=t[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},_e=[[new RegExp(J+"; "+J+" (.*?)[);]","i"),e=>[J,e&&e[1]||""]],[new RegExp(q,"i"),[q,""]],[new RegExp(Y,"i"),[Y,""]],[ve,[U,""]],[new RegExp(ee,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[re,""];if(new RegExp(R).test(r)&&!/IEMobile\b/.test(r))return[ee+" "+R,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=n[1],i=he[t]||"";return/arm/i.test(r)&&(i="RT"),[ee,i]}return[ee,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var r=[e[3],e[4],e[5]||"0"];return[S,r.join(".")]}return[S,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=m(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+M+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+M+")","i"),e=>{if(e&&e[2]){var r=[e[2],e[3],e[4]||"0"];return[M,r.join(".")]}return[M,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];r[1]=n.join(".")}return r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[F,""]],[/Linux|debian/i,["Linux",""]]],be=function(e){return de.test(e)?q:fe.test(e)?Y:ce.test(e)?J:new RegExp(te,"i").test(e)?te:new RegExp("("+re+"|WPDesktop)","i").test(e)?re:/iPad/.test(e)?A:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?B:ve.test(e)?U:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ne,"i").test(e)?ne:/(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(R).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:P:new RegExp("(pda|"+R+")","i").test(e)?oe:new RegExp(k,"i").test(e)&&!new RegExp(k+" pc","i").test(e)?ae:""},xe=function(r,n){var{debugEnabled:t}=void 0===n?{}:n,i={p:function(n){if(e&&(u.POSTHOG_DEBUG||t)&&!m(e.console)&&e.console){for(var i=("__rrweb_original__"in e.console[n]?e.console[n].__rrweb_original__:e.console[n]),o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];i(r,...a)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];i.p("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];i.p("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];i.p("error",...r)},critical:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];console.error(r,...n)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(e,n)=>xe(r+" "+e,n)};return i},ye=xe("[PostHog.js]"),Ee=ye.createLogger,Re={};function $e(e,r,t){if(p(e))if(n&&e.forEach===n)e.forEach(r,t);else if("length"in e&&e.length===+e.length)for(var i=0,o=e.length;i<o;i++)if(i in e&&r.call(t,e[i],i)===Re)return}function Se(e,r,n){if(!_(e)){if(p(e))return $e(e,r,n);if(x(e)){for(var t of e.entries())if(r.call(n,t[1],t[0])===Re)return}else for(var i in e)if(v.call(e,i)&&r.call(n,e[i],i)===Re)return}}var Me=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];return $e(n,(function(r){for(var n in r)void 0!==r[n]&&(e[n]=r[n])})),e},ke=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];return $e(n,(function(r){$e(r,(function(r){e.push(r)}))})),e},Pe=function(e){var r={};return Se(e,(function(e,n){var t;t=e,("[object String]"==h.call(t)&&e.length>0||b(e))&&(r[n]=e)})),r},Ae=e=>{var r=null==i?void 0:i.createElement("a");return m(r)?null:(r.href=e,r)},Oe=function(e,r){for(var n,t=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<t.length;i++){var o=t[i].split("=");if(o[0]===r){n=o;break}}if(!p(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){ye.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Be=function(e,r,n){if(!e||!r||!r.length)return e;for(var t=e.split("#"),i=t[0]||"",o=t[1],a=i.split("?"),u=a[1],s=a[0],l=(u||"").split("&"),c=[],f=0;f<l.length;f++){var d=l[f].split("=");p(d)&&(r.includes(d[0])?c.push(d[0]+"="+n):c.push(l[f]))}var v=s;return null!=u&&(v+="?"+c.join("&")),null!=o&&(v+="#"+o),v};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return b(e)&&isFinite(e)&&Math.floor(e)===e});var Ie="0123456789abcdef";class Ue{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,t){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(t)||e<0||r<0||n<0||t<0||e>0xffffffffffff||r>4095||n>1073741823||t>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|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=t>>>24,i[13]=t>>>16,i[14]=t>>>8,i[15]=t,new Ue(i)}toString(){for(var e="",r=0;r<this.bytes.length;r++)e=e+Ie.charAt(this.bytes[r]>>>4)+Ie.charAt(15&this.bytes[r]),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 Ue(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;r<16;r++){var n=this.bytes[r]-e.bytes[r];if(0!==n)return Math.sign(n)}return 0}}class Ne{constructor(){this.m=0,this.R=0,this.$=new De}generate(){var e=this.generateOrAbort();if(m(e)){this.m=0;var r=this.generateOrAbort();if(m(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.m)this.m=e,this.S();else{if(!(e+1e4>this.m))return;this.R++,this.R>4398046511103&&(this.m++,this.S())}return Ue.fromFieldsV7(this.m,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.$.nextUint32())}S(){this.R=1024*this.$.nextUint32()+(1023&this.$.nextUint32())}}var Te,Ce=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;r<e.length;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!m(e.crypto)&&crypto.getRandomValues&&(Ce=e=>crypto.getRandomValues(e));class De{constructor(){this.M=new Uint32Array(8),this.k=1/0}nextUint32(){return this.k>=this.M.length&&(Ce(this.M),this.k=0),this.M[this.k++]}}var Fe=()=>We().toString(),We=()=>(Te||(Te=new Ne)).generate(),je="";var ze=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Le(e,r){if(r){var n=function(e,r){if(void 0===r&&(r=i),je)return je;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),t=Math.min(n.length,8),o="dmn_chk_"+Fe();!je&&t--;){var a=n.slice(t).join("."),u=o+"=1;domain=."+a+";path=/";r.cookie=u+";max-age=3",r.cookie.includes(o)&&(r.cookie=u+";max-age=0",je=a)}return je}(e);if(!n){var t=(e=>{var r=e.match(ze);return r?r[0]:""})(e);t!==n&&ye.info("Warning: cookie subdomain discovery mismatch",t,n),n=t}return n?"; domain=."+n:""}return""}var Ke={P:()=>!!i,A:function(e){ye.error("cookieStore error: "+e)},O:function(e){if(i){try{for(var r=e+"=",n=i.cookie.split(";").filter((e=>e.length)),t=0;t<n.length;t++){for(var o=n[t];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return decodeURIComponent(o.substring(r.length,o.length))}}catch(e){}return null}},B:function(e){var r;try{r=JSON.parse(Ke.O(e))||{}}catch(e){}return r},I:function(e,r,n,t,o){if(i)try{var a="",u="",s=Le(i.location.hostname,t);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}o&&(u="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(r))+a+"; SameSite=Lax; path=/"+s+u;return c.length>3686.4&&ye.warn("cookieStore warning: large cookie, len="+c.length),i.cookie=c,c}catch(e){return}},U:function(e,r){if(null!=i&&i.cookie)try{Ke.I(e,"",-1,r)}catch(e){return}}},Ve=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ge=ke(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Ve),He=["$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"],Xe="<masked>",qe=["li_fat_id"];function Ye(e,r,n){if(!i)return{};var t,o,a,u,s=r?ke([],Ve,n||[]):[],l=(t=Be(i.URL,s,Xe),o=e,a=Ge.concat(o||[]),u={},Se(a,(function(e){var r=Oe(t,e);u[e]=r||null})),u),c=function(){var e={};return Se(qe,(function(r){var n=Ke.O(r);e[r]=n||null})),e}();return Me(c,l)}function Je(){return navigator.language||navigator.userLanguage}function Qe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ze(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function er(r,n){if(!a)return{};var t,i,u,l=r?ke([],Ve,n||[]):[],[c,f]=function(e){for(var r=0;r<_e.length;r++){var[n,t]=_e[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]}(a);return Me(Pe({$os:c,$os_version:f,$browser:ge(a,navigator.vendor),$device:be(a),$device_type:(i=a,u=be(i),u===A||u===P||"Kobo"===u||"Kindle Fire"===u||u===ae?k:u===q||u===J||u===Y||u===te?"Console":u===B?"Wearable":u?R:"Desktop"),$timezone:Qe(),$timezone_offset:Ze()}),{$current_url:Be(null==o?void 0:o.href,l,Xe),$host:null==o?void 0:o.host,$pathname:null==o?void 0:o.pathname,$raw_user_agent:a.length>1e3?a.substring(0,997)+"...":a,$browser_version:me(a,navigator.vendor),$browser_language:Je(),$browser_language_prefix:(t=Je(),"string"==typeof t?t.split("-")[0]:void 0),$screen_height:null==e?void 0:e.screen.height,$screen_width:null==e?void 0:e.screen.width,$viewport_height:null==e?void 0:e.innerHeight,$viewport_width:null==e?void 0:e.innerWidth,$lib:"web",$lib_version:s.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}function rr(e,r){return[...e||[],...p(r)?r:[r]]}function nr(e,r){return(m(e)?1:e)*r}function tr(e,r){return function(e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<y(100*r,0,100,ye)}var ir=["type"];function or(e){var{type:r,executionTimeMs:n}=e;return""+r+(_(n)?"":" ("+n.toFixed(2)+"ms)")}var ar=Ee("[PostHog Action RateLimiting]");function ur(e,r){console.log(e,r)}function sr(e,r,n){if(void 0===n&&(n=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var t={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],u=r[o];if(m(a))t[o]=u;else if(m(u))t[o]=a;else if(!(a===u||_(a)&&_(u)))if(g(a)&&g(u))if(n>1){var s=sr(a,u,n-1);w(s)||(t[o]=s)}else t[o]="max depth reached, checking for changed value";else t[o]=u}return t}var lr,cr,fr,dr=(lr=null,cr=0,fr=null,{info:e=>{fr!==e&&(cr=0,fr=e),cr++,lr&&clearTimeout(lr),lr=setTimeout((()=>{var r=cr;1===r?ar.info('action "'+e+'" has been rate limited'):ar.info('action "'+e+'" has been rate limited ('+r+" times)"),cr=0,lr=null}),1e3)}});function vr(e){void 0===e&&(e={});var{maskAction:r,maskState:n,titleFunction:t=or,logger:i=ur,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:u=10,__stateComparisonDepth:s}=e,l=new E({refillRate:a,bucketSize:u,refillInterval:1e3,u:ar});return e=>a=>u=>{var c=u,f=e.getState(),d=performance.now(),v=a(c),h=performance.now()-d,p=e.getState(),g=r?r(c):c;if(!g)return v;if(l.consumeRateLimit(c.type))dr.info(c.type);else try{var w=n?n(f,g):f,m=n?n(p,g):p,_=o.changedState?sr(w,m,null!=s?s:5):void 0,{type:b}=g,x={type:b,payload:function(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==r.indexOf(t))continue;n[t]=e[t]}return n}(g,ir),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},y=t(x);i(y,x)}catch(e){ar.error("Error logging state:",e)}return v}}var hr=Object.freeze({__proto__:null,browserConsoleLogger:ur,posthogKeaLogger:function(e){void 0===e&&(e={});var r=vr(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}},posthogReduxLogger:vr,printAndDropEverything:e=>(console.log("Would have sent event:",e),null),sampleByDistinctId:function(e){return r=>r&&tr(r.properties.distinct_id,e)?l({},r,{properties:l({},r.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null},sampleByEvent:function(e,r){return n=>{var t,i,o;return n?c(e,n.event)?100*Math.random()<y(100*r,0,100,ye)?l({},n,{properties:l({},n.properties,{$sample_type:rr(null==(t=n.properties)?void 0:t.$sample_type,"sampleByEvent"),$sample_threshold:nr(null==(i=n.properties)?void 0:i.$sample_threshold,r),$sampled_events:rr(null==(o=n.properties)?void 0:o.$sampled_events,e)})}):null:n:null}},sampleBySessionId:function(e){return r=>r&&tr(r.properties.$session_id,e)?l({},r,{properties:l({},r.properties,{$sample_type:rr(r.properties.$sample_type,"sampleBySessionId"),$sample_threshold:nr(r.properties.$sample_threshold,e)})}):null},sessionRecordingLoggerForPostHogInstance:e=>(r,n)=>{var t;null==e||null==(t=e.sessionRecording)||t.tryAddCustomEvent("app-state",{title:r,stateEvent:n})},setAllPersonProfilePropertiesAsPersonPropertiesForFlags:e=>{var r,n=Me({},er(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),Ye(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==i?void 0:i.referrer)||"$direct",$referring_domain:null!=i&&i.referrer&&(null==(r=Ae(i.referrer))?void 0:r.host)||"$direct"}),t={};Se(n,(function(e,r){(c(Ge,r)||c(He,r))&&(t[r]=e)})),e.setPersonPropertiesForFlags(t)}});u.posthogCustomizations=hr}();
2
2
  //# sourceMappingURL=customizations.full.js.map
@@ -0,0 +1,21 @@
1
+ declare function elementIsVisible(element: HTMLElement, cache: WeakMap<HTMLElement, boolean>): boolean;
2
+ interface InferredSelector {
3
+ autoData: string;
4
+ text: string | null;
5
+ excludeText?: boolean;
6
+ }
7
+ /**
8
+ * if inferSelector is the sauce, this is the nugget
9
+ *
10
+ * find an element in the dom using the element inference data
11
+ *
12
+ * 1. try each group of selectors, starting with most specific (lowest cardinality)
13
+ * 2. try each selector in the group - run the css query, go to offset
14
+ * 3. "vote" for the element if it was found
15
+ * 4. return early if any element gets majority votes
16
+ * 5. return element w/ most votes
17
+ */
18
+ declare function findElement(selector: InferredSelector): HTMLElement | null;
19
+ declare function getElementPath(el: HTMLElement | null, depth?: number): string | null;
20
+
21
+ export { elementIsVisible, findElement, getElementPath };
@@ -0,0 +1,2 @@
1
+ function r(r,i,o){return void 0===i&&(i=document),void 0===o&&(o=null),function(r,i,o,t){void 0===t&&(t=null);return r=function(r){function n(){u&&(t.length>0&&/^[~+>]$/.test(t[t.length-1])&&t.push(" "),t.push(u))}var e,u,i,o,t=[],f=[0],l=0,a=/(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/,v=/^\s+$/,c=[/\s+|\/\*|["'>~+[(]/g,/\s+|\/\*|["'[\]()]/g,/\s+|\/\*|["'[\]()]/g,null,/\*\//g];for(r=r.trim();;){if(u="",(i=c[f[f.length-1]]).lastIndex=l,!(e=i.exec(r))){u=r.substr(l),n();break}if((o=l)<(l=i.lastIndex)-e[0].length&&(u=r.substring(o,l-e[0].length)),f[f.length-1]<3){if(n(),"["===e[0])f.push(1);else if("("===e[0])f.push(2);else if(/^["']$/.test(e[0]))f.push(3),c[3]=new RegExp(e[0],"g");else if("/*"===e[0])f.push(4);else if(/^[\])]$/.test(e[0])&&f.length>0)f.pop();else if(/^(?:\s+|[~+>])$/.test(e[0])&&(t.length>0&&!v.test(t[t.length-1])&&0===f[f.length-1]&&t.push(" "),1===f[f.length-1]&&5===t.length&&"="===t[2].charAt(t[2].length-1)&&(t[4]=" "+t[4]),v.test(e[0])))continue;t.push(e[0])}else t[t.length-1]+=u,a.test(t[t.length-1])&&(4===f[f.length-1]&&(t.length<2||v.test(t[t.length-2])?t.pop():t[t.length-1]=" ",e[0]=""),f.pop()),t[t.length-1]+=e[0]}return t.join("").trim()}(r),o.querySelector(r),document.head.createShadowRoot||document.head.attachShadow?n(r,",").reduce(((r,i)=>{var f=n(i.replace(/^\s+/g,"").replace(/\s*([>+~]+)\s*/g,"$1")," ").filter((r=>!!r)).map((r=>n(r,">"))),l=f.length-1,a=function(r,n,e){void 0===r&&(r=null);void 0===e&&(e=null);var u=[];if(e)u=e;else{var i=function(r){for(var n=0;n<r.length;n++){var e=r[n];u.push(e),e.shadowRoot&&i(e.shadowRoot.querySelectorAll("*"))}};n.shadowRoot&&i(n.shadowRoot.querySelectorAll("*")),i(n.querySelectorAll("*"))}return r?u.filter((n=>n.matches(r))):u}(f[l][f[l].length-1],o,t),v=function(r,n,i){return o=>{for(var t=n,f=o,l=!1;f&&!e(f);){var a=!0;if(1===r[t].length)a=f.matches(r[t]);else{var v=[].concat(r[t]).reverse(),c=f;for(var d of v){if(!c||!c.matches(d)){a=!1;break}c=u(c,i)}}if(a&&0===t){l=!0;break}a&&t--,f=u(f,i)}return l}}(f,l,o);return r=r.concat(a.filter(v))}),[]):o.querySelectorAll(r)}(r,0,i,o)}function n(r,n){return r.match(/\\?.|^$/g).reduce(((r,e)=>('"'!==e||r.sQuote?"'"!==e||r.quote?r.quote||r.sQuote||e!==n?r.a[r.a.length-1]+=e:r.a.push(""):(r.sQuote^=1,r.a[r.a.length-1]+=e):(r.quote^=1,r.a[r.a.length-1]+=e),r)),{a:[""]}).a}function e(r){return r.nodeType===Node.DOCUMENT_FRAGMENT_NODE||r.nodeType===Node.DOCUMENT_NODE}function u(r,n){var e=r.parentNode;return e&&e.host&&11===e.nodeType?e.host:e===n?null:e}var i="undefined"!=typeof window?window:void 0,o="undefined"!=typeof globalThis?globalThis:i;"undefined"==typeof self&&(o.self=o),"undefined"==typeof File&&(o.File=function(){});var t=null==o?void 0:o.navigator;null==o||o.document,null==o||o.location,null==o||o.fetch,null!=o&&o.XMLHttpRequest&&"withCredentials"in new o.XMLHttpRequest&&o.XMLHttpRequest,null==o||o.AbortController,null==t||t.userAgent;var f=Array.isArray,l=Object.prototype.toString,a=f||function(r){return"[object Array]"===l.call(r)},v=r=>void 0===r;var c=(r,n,e)=>{function u(u){for(var i=arguments.length,o=new Array(i>1?i-1:0),t=1;t<i;t++)o[t-1]=arguments[t];n((()=>{(0,e[u])(r,...o)}))}return{info:function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];u("log",...n)},warn:function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];u("warn",...n)},error:function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];u("error",...n)},critical:function(){for(var n=arguments.length,u=new Array(n),i=0;i<n;i++)u[i]=arguments[i];e.error(r,...u)},createLogger:u=>c(r+" "+u,n,e)}};var d,s,g=i,w=(void 0===d&&(d=r=>r()),c("[Element Inference]",d,(void 0===s&&(s=console),{log:s.log.bind(s),warn:s.warn.bind(s),error:s.error.bind(s),debug:s.debug.bind(s)})));function y(r,n){try{var e=n.get(r);if(!v(e))return e;if(r.checkVisibility){var u=r.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});return n.set(r,u),u}var i=g.getComputedStyle(r);if("none"===i.display||"hidden"===i.visibility||0===parseFloat(i.opacity))return n.set(r,!1),!1;for(var o=r.parentElement;o;){var t=n.get(o);if(v(t)){var f=g.getComputedStyle(o),l="none"!==f.display&&"hidden"!==f.visibility;if(n.set(o,l),!l)return!1;o=o.parentElement}else{if(!t)return!1;o=o.parentElement}}var a=r.getBoundingClientRect(),c=a.width>0||a.height>0||r.getClientRects().length>0;return n.set(r,c),c}catch(r){return!0}}function h(r,n){var e=function(r){var n,e=null==(n=r.innerText)?void 0:n.trim();return!e||e.length>250?null:e}(r);return(null==e?void 0:e.toLowerCase())===n.toLowerCase()}function*p(n,e,u){var i;try{i=r(n)}catch(r){return}for(var o of i){var t=o;e&&!h(t,e)||y(t,u)&&(yield t)}}function b(r,n){var e=0;for(var u of r){if(e===n)return u;e++}return null}function A(r){try{var n=JSON.parse(r.autoData);if(!a(null==n?void 0:n.textGroups)||!a(null==n?void 0:n.notextGroups))return w.error("Invalid autoData structure:",n),null;var{text:e,excludeText:u}=r,i=null!=e&&!u,o=(i?n.textGroups:n.notextGroups).sort(((r,n)=>r.cardinality-n.cardinality));if(0===o.length)return null;var t=new WeakMap;for(var f of o){var l=new Map,v=null,c=0;for(var{css:d,offset:s}of f.cssSelectors){var g,y=b(p(d,i?e:null,t),s);if(y){var h=(null!==(g=l.get(y))&&void 0!==g?g:0)+1;if(l.set(y,h),h>c&&(c=h,v=y,h>=Math.ceil(f.cssSelectors.length/2)))return v}}if(v)return v}return null}catch(r){return w.error("Error finding element:",r),null}}function k(r,n){if(void 0===n&&(n=4),!r)return null;for(var e=[],u=r;u&&e.length<n&&"BODY"!==u.tagName;){var i=u.tagName.toLowerCase();u.id?i+="#"+u.id:u.classList.length&&(i+="."+u.classList[0]),e.unshift(i),u=u.parentElement}return e.join(" > ")}export{y as elementIsVisible,A as findElement,k as getElementPath};
2
+ //# sourceMappingURL=element-inference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-inference.js","sources":["../../../node_modules/.pnpm/query-selector-shadow-dom@1.0.1/node_modules/query-selector-shadow-dom/src/querySelectorDeep.js","../../../node_modules/.pnpm/query-selector-shadow-dom@1.0.1/node_modules/query-selector-shadow-dom/src/normalize.js","../src/utils/globals.ts","../../core/dist/utils/type-utils.mjs","../../core/dist/utils/logger.mjs","../src/extensions/product-tours/element-inference.ts"],"sourcesContent":["import { normalizeSelector } from './normalize';\n\n/**\n* Finds first matching elements on the page that may be in a shadow root using a complex selector of n-depth\n*\n* Don't have to specify all shadow roots to button, tree is travered to find the correct element\n*\n* Example querySelectorAllDeep('downloads-item:nth-child(4) #remove');\n*\n* Example should work on chrome://downloads outputting the remove button inside of a download card component\n*\n* Example find first active download link element querySelectorDeep('#downloads-list .is-active a[href^=\"https://\"]');\n*\n* Another example querySelectorAllDeep('#downloads-list div#title-area + a');\ne.g.\n*/\nexport function querySelectorAllDeep(selector, root = document, allElements = null) {\n return _querySelectorDeep(selector, true, root, allElements);\n}\n\nexport function querySelectorDeep(selector, root = document, allElements = null) {\n return _querySelectorDeep(selector, false, root, allElements);\n}\n\nfunction _querySelectorDeep(selector, findMany, root, allElements = null) {\n selector = normalizeSelector(selector);\n let lightElement = root.querySelector(selector);\n\n if (document.head.createShadowRoot || document.head.attachShadow) {\n // no need to do any special if selector matches something specific in light-dom\n if (!findMany && lightElement) {\n return lightElement;\n }\n\n // split on commas because those are a logical divide in the operation\n const selectionsToMake = splitByCharacterUnlessQuoted(selector, ',');\n\n return selectionsToMake.reduce((acc, minimalSelector) => {\n // if not finding many just reduce the first match\n if (!findMany && acc) {\n return acc;\n }\n // do best to support complex selectors and split the query\n const splitSelector = splitByCharacterUnlessQuoted(minimalSelector\n //remove white space at start of selector\n .replace(/^\\s+/g, '')\n .replace(/\\s*([>+~]+)\\s*/g, '$1'), ' ')\n // filter out entry white selectors\n .filter((entry) => !!entry)\n // convert \"a > b\" to [\"a\", \"b\"]\n .map((entry) => splitByCharacterUnlessQuoted(entry, '>'));\n\n const possibleElementsIndex = splitSelector.length - 1;\n const lastSplitPart = splitSelector[possibleElementsIndex][splitSelector[possibleElementsIndex].length - 1];\n const possibleElements = collectAllElementsDeep(lastSplitPart, root, allElements);\n const findElements = findMatchingElement(splitSelector, possibleElementsIndex, root);\n if (findMany) {\n acc = acc.concat(possibleElements.filter(findElements));\n return acc;\n } else {\n acc = possibleElements.find(findElements);\n return acc || null;\n }\n }, findMany ? [] : null);\n\n\n } else {\n if (!findMany) {\n return lightElement;\n } else {\n return root.querySelectorAll(selector);\n }\n }\n\n}\n\nfunction findMatchingElement(splitSelector, possibleElementsIndex, root) {\n return (element) => {\n let position = possibleElementsIndex;\n let parent = element;\n let foundElement = false;\n while (parent && !isDocumentNode(parent)) {\n let foundMatch = true;\n if (splitSelector[position].length === 1) {\n foundMatch = parent.matches(splitSelector[position]);\n } else {\n // selector is in the format \"a > b\"\n // make sure a few parents match in order\n const reversedParts = ([]).concat(splitSelector[position]).reverse();\n let newParent = parent;\n for (const part of reversedParts) {\n if (!newParent || !newParent.matches(part)) {\n foundMatch = false;\n break;\n }\n newParent = findParentOrHost(newParent, root);\n }\n }\n\n if (foundMatch && position === 0) {\n foundElement = true;\n break;\n }\n if (foundMatch) {\n position--;\n }\n parent = findParentOrHost(parent, root);\n }\n return foundElement;\n };\n\n}\n\nfunction splitByCharacterUnlessQuoted(selector, character) {\n return selector.match(/\\\\?.|^$/g).reduce((p, c) => {\n if (c === '\"' && !p.sQuote) {\n p.quote ^= 1;\n p.a[p.a.length - 1] += c;\n } else if (c === '\\'' && !p.quote) {\n p.sQuote ^= 1;\n p.a[p.a.length - 1] += c;\n\n } else if (!p.quote && !p.sQuote && c === character) {\n p.a.push('');\n } else {\n p.a[p.a.length - 1] += c;\n }\n return p;\n }, { a: [''] }).a;\n}\n\n/**\n * Checks if the node is a document node or not.\n * @param {Node} node\n * @returns {node is Document | DocumentFragment}\n */\nfunction isDocumentNode(node) {\n return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.DOCUMENT_NODE;\n}\n\nfunction findParentOrHost(element, root) {\n const parentNode = element.parentNode;\n return (parentNode && parentNode.host && parentNode.nodeType === 11) ? parentNode.host : parentNode === root ? null : parentNode;\n}\n\n/**\n * Finds all elements on the page, inclusive of those within shadow roots.\n * @param {string=} selector Simple selector to filter the elements by. e.g. 'a', 'div.main'\n * @return {!Array<string>} List of anchor hrefs.\n * @author ebidel@ (Eric Bidelman)\n * License Apache-2.0\n */\nexport function collectAllElementsDeep(selector = null, root, cachedElements = null) {\n let allElements = [];\n\n if (cachedElements) {\n allElements = cachedElements;\n } else {\n const findAllElements = function(nodes) {\n for (let i = 0; i < nodes.length; i++) {\n const el = nodes[i];\n allElements.push(el);\n // If the element has a shadow root, dig deeper.\n if (el.shadowRoot) {\n findAllElements(el.shadowRoot.querySelectorAll('*'));\n }\n }\n };\n if(root.shadowRoot) {\n findAllElements(root.shadowRoot.querySelectorAll('*'));\n }\n findAllElements(root.querySelectorAll('*'));\n }\n\n return selector ? allElements.filter(el => el.matches(selector)) : allElements;\t}\n\n","/* istanbul ignore file */\n\n\n// normalize-selector-rev-02.js\n/*\n author: kyle simpson (@getify)\n original source: https://gist.github.com/getify/9679380\n\n modified for tests by david kaye (@dfkaye)\n 21 march 2014\n\n rev-02 incorporate kyle's changes 3/2/42014\n*/\n\nexport function normalizeSelector(sel) {\n // save unmatched text, if any\n function saveUnmatched() {\n if (unmatched) {\n // whitespace needed after combinator?\n if (tokens.length > 0 && /^[~+>]$/.test(tokens[tokens.length - 1])) {\n tokens.push(\" \");\n }\n\n // save unmatched text\n tokens.push(unmatched);\n }\n }\n\n var tokens = [],\n match,\n unmatched,\n regex,\n state = [0],\n next_match_idx = 0,\n prev_match_idx,\n not_escaped_pattern = /(?:[^\\\\]|(?:^|[^\\\\])(?:\\\\\\\\)+)$/,\n whitespace_pattern = /^\\s+$/,\n state_patterns = [\n /\\s+|\\/\\*|[\"'>~+[(]/g, // general\n /\\s+|\\/\\*|[\"'[\\]()]/g, // [..] set\n /\\s+|\\/\\*|[\"'[\\]()]/g, // (..) set\n null, // string literal (placeholder)\n /\\*\\//g, // comment\n ];\n sel = sel.trim();\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n unmatched = \"\";\n\n regex = state_patterns[state[state.length - 1]];\n\n regex.lastIndex = next_match_idx;\n match = regex.exec(sel);\n\n // matched text to process?\n if (match) {\n prev_match_idx = next_match_idx;\n next_match_idx = regex.lastIndex;\n\n // collect the previous string chunk not matched before this token\n if (prev_match_idx < next_match_idx - match[0].length) {\n unmatched = sel.substring(\n prev_match_idx,\n next_match_idx - match[0].length\n );\n }\n\n // general, [ ] pair, ( ) pair?\n if (state[state.length - 1] < 3) {\n saveUnmatched();\n\n // starting a [ ] pair?\n if (match[0] === \"[\") {\n state.push(1);\n }\n // starting a ( ) pair?\n else if (match[0] === \"(\") {\n state.push(2);\n }\n // starting a string literal?\n else if (/^[\"']$/.test(match[0])) {\n state.push(3);\n state_patterns[3] = new RegExp(match[0], \"g\");\n }\n // starting a comment?\n else if (match[0] === \"/*\") {\n state.push(4);\n }\n // ending a [ ] or ( ) pair?\n else if (/^[\\])]$/.test(match[0]) && state.length > 0) {\n state.pop();\n }\n // handling whitespace or a combinator?\n else if (/^(?:\\s+|[~+>])$/.test(match[0])) {\n // need to insert whitespace before?\n if (\n tokens.length > 0 &&\n !whitespace_pattern.test(tokens[tokens.length - 1]) &&\n state[state.length - 1] === 0\n ) {\n // add normalized whitespace\n tokens.push(\" \");\n }\n\n // case-insensitive attribute selector CSS L4\n if (\n state[state.length - 1] === 1 &&\n tokens.length === 5 &&\n tokens[2].charAt(tokens[2].length - 1) === \"=\"\n ) {\n tokens[4] = \" \" + tokens[4];\n }\n\n // whitespace token we can skip?\n if (whitespace_pattern.test(match[0])) {\n continue;\n }\n }\n\n // save matched text\n tokens.push(match[0]);\n }\n // otherwise, string literal or comment\n else {\n // save unmatched text\n tokens[tokens.length - 1] += unmatched;\n\n // unescaped terminator to string literal or comment?\n if (not_escaped_pattern.test(tokens[tokens.length - 1])) {\n // comment terminator?\n if (state[state.length - 1] === 4) {\n // ok to drop comment?\n if (\n tokens.length < 2 ||\n whitespace_pattern.test(tokens[tokens.length - 2])\n ) {\n tokens.pop();\n }\n // otherwise, turn comment into whitespace\n else {\n tokens[tokens.length - 1] = \" \";\n }\n\n // handled already\n match[0] = \"\";\n }\n\n state.pop();\n }\n\n // append matched text to existing token\n tokens[tokens.length - 1] += match[0];\n }\n }\n // otherwise, end of processing (no more matches)\n else {\n unmatched = sel.substr(next_match_idx);\n saveUnmatched();\n\n break;\n }\n }\n\n return tokens.join(\"\").trim();\n}\n","import type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport {\n DeadClicksAutoCaptureConfig,\n ExternalIntegrationKind,\n Properties,\n RemoteConfig,\n SiteAppLoader,\n SessionStartReason,\n} from '../types'\nimport type {\n ConversationsRemoteConfig,\n GetMessagesResponse,\n GetTicketsOptions,\n GetTicketsResponse,\n MarkAsReadResponse,\n SendMessageResponse,\n UserProvidedTraits,\n} from '../posthog-conversations-types'\n// only importing types here, so won't affect the bundle\n// eslint-disable-next-line posthog-js/no-external-replay-imports\nimport type { SessionRecordingStatus, TriggerType } from '../extensions/replay/external/triggerMatching'\nimport { eventWithTime } from '../extensions/replay/types/rrweb-types'\nimport { ErrorTracking } from '@posthog/core'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\nexport type AssignableWindow = Window &\n typeof globalThis & {\n /*\n * Main PostHog instance\n */\n posthog: any\n\n /*\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n */\n __PosthogExtensions__?: PostHogExtensions\n\n /**\n * When loading remote config, we assign it to this global configuration\n * for ease of sharing it with the rest of the SDK\n */\n _POSTHOG_REMOTE_CONFIG?: Record<\n string,\n {\n config: RemoteConfig\n siteApps: SiteAppLoader[]\n }\n >\n\n /**\n * If this is set on the window, our logger will log to the console\n * for ease of debugging. Used for testing purposes only.\n *\n * @see {Config.DEBUG} from config.ts\n */\n POSTHOG_DEBUG: any\n\n // Exposed by the browser\n doNotTrack: any\n\n // See entrypoints/customizations.full.ts\n posthogCustomizations: any\n\n /**\n * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n * Can be removed once we drop support for 1.161.1\n *\n * See entrypoints/exception-autocapture.ts\n *\n * @deprecated use `__PosthogExtensions__.errorWrappingFunctions` instead\n */\n posthogErrorWrappingFunctions: any\n\n /**\n * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n * Can be removed once we drop support for 1.161.1\n *\n * See entrypoints/posthog-recorder.ts\n *\n * @deprecated use `__PosthogExtensions__.rrweb` instead\n */\n rrweb: any\n\n /**\n * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n * Can be removed once we drop support for 1.161.1\n *\n * See entrypoints/posthog-recorder.ts\n *\n * @deprecated use `__PosthogExtensions__.rrwebConsoleRecord` instead\n */\n rrwebConsoleRecord: any\n\n /**\n * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n * Can be removed once we drop support for 1.161.1\n *\n * See entrypoints/posthog-recorder.ts\n *\n * @deprecated use `__PosthogExtensions__.getRecordNetworkPlugin` instead\n */\n getRecordNetworkPlugin: any\n\n /**\n * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n * Can be removed once we drop support for 1.161.1\n *\n * See entrypoints/web-vitals.ts\n *\n * @deprecated use `__PosthogExtensions__.postHogWebVitalsCallbacks` instead\n */\n postHogWebVitalsCallbacks: any\n\n /**\n * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n * Can be removed once we drop support for 1.161.1\n *\n * See entrypoints/tracing-headers.ts\n *\n * @deprecated use `__PosthogExtensions__.postHogTracingHeadersPatchFns` instead\n */\n postHogTracingHeadersPatchFns: any\n\n /**\n * This is a legacy way to expose these functions, but we still need to support it for backwards compatibility\n * Can be removed once we drop support for 1.161.1\n *\n * See entrypoints/surveys.ts\n *\n * @deprecated use `__PosthogExtensions__.generateSurveys` instead\n */\n extendPostHogWithSurveys: any\n\n /*\n * These are used to handle our toolbar state.\n * @see {Toolbar} from extensions/toolbar.ts\n */\n ph_load_toolbar: any\n ph_load_editor: any\n ph_toolbar_state: any\n } & Record<`__$$ph_site_app_${string}`, any>\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type ExternalExtensionKind = 'intercom-integration' | 'crisp-chat-integration'\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'lazy-recorder'\n | 'tracing-headers'\n | 'surveys'\n | 'conversations'\n | 'product-tours'\n | 'dead-clicks-autocapture'\n | 'remote-config'\n | ExternalExtensionKind\n\nexport interface LazyLoadedSessionRecordingInterface {\n start: (startReason?: SessionStartReason) => void\n stop: () => void\n sessionId: string\n status: SessionRecordingStatus\n onRRwebEmit: (rawEvent: eventWithTime) => void\n log: (message: string, level: 'log' | 'warn' | 'error') => void\n sdkDebugProperties: Properties\n overrideLinkedFlag: () => void\n overrideSampling: () => void\n overrideTrigger: (triggerType: TriggerType) => void\n isStarted: boolean\n tryAddCustomEvent(tag: string, payload: any): boolean\n}\n\nexport interface LazyLoadedDeadClicksAutocaptureInterface {\n start: (observerTarget: Node) => void\n stop: () => void\n}\n\nexport interface LazyLoadedConversationsInterface {\n // Widget control\n show: () => void\n hide: () => void\n isVisible: () => boolean\n\n // Lifecycle\n reset: () => void\n\n // API methods\n sendMessage: (message: string, userTraits?: UserProvidedTraits, newTicket?: boolean) => Promise<SendMessageResponse>\n getMessages: (ticketId?: string, after?: string) => Promise<GetMessagesResponse>\n markAsRead: (ticketId?: string) => Promise<MarkAsReadResponse>\n getTickets: (options?: GetTicketsOptions) => Promise<GetTicketsResponse>\n getCurrentTicketId: () => string | null\n getWidgetSessionId: () => string\n}\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: ErrorTracking.ErrorProperties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: ErrorTracking.ErrorProperties) => void) => () => void\n wrapConsoleError: (captureFn: (props: ErrorTracking.ErrorProperties) => void) => () => void\n }\n rrweb?: { record: any; version: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n generateSurveys?: (posthog: PostHog, isSurveysEnabled: boolean) => any | undefined\n generateProductTours?: (posthog: PostHog, isEnabled: boolean) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (hostnames: string[], distinctId: string, sessionManager?: SessionIdManager) => () => void\n _patchXHR: (hostnames: string[], distinctId: string, sessionManager?: SessionIdManager) => () => void\n }\n initDeadClicksAutocapture?: (\n ph: PostHog,\n config: DeadClicksAutoCaptureConfig\n ) => LazyLoadedDeadClicksAutocaptureInterface\n integrations?: {\n [K in ExternalIntegrationKind]?: { start: (posthog: PostHog) => void; stop: () => void }\n }\n initSessionRecording?: (ph: PostHog) => LazyLoadedSessionRecordingInterface\n initConversations?: (config: ConversationsRemoteConfig, posthog: PostHog) => LazyLoadedConversationsInterface\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\n// React Native polyfills for posthog-js compatibility\nif (typeof self === 'undefined') {\n ;(global as any).self = global\n}\nif (typeof File === 'undefined') {\n ;(global as any).File = function () {}\n}\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: AssignableWindow = win ?? ({} as any)\n\nexport { win as window }\n","import { knownUnsafeEditableEvent } from \"../types.mjs\";\nimport { includes } from \"./string-utils.mjs\";\nconst nativeIsArray = Array.isArray;\nconst ObjProto = Object.prototype;\nconst type_utils_hasOwnProperty = ObjProto.hasOwnProperty;\nconst type_utils_toString = ObjProto.toString;\nconst isArray = nativeIsArray || function(obj) {\n return '[object Array]' === type_utils_toString.call(obj);\n};\nconst isFunction = (x)=>'function' == typeof x;\nconst isNativeFunction = (x)=>isFunction(x) && -1 !== x.toString().indexOf('[native code]');\nconst isObject = (x)=>x === Object(x) && !isArray(x);\nconst isEmptyObject = (x)=>{\n if (isObject(x)) {\n for(const key in x)if (type_utils_hasOwnProperty.call(x, key)) return false;\n return true;\n }\n return false;\n};\nconst isUndefined = (x)=>void 0 === x;\nconst isString = (x)=>'[object String]' == type_utils_toString.call(x);\nconst isEmptyString = (x)=>isString(x) && 0 === x.trim().length;\nconst isNull = (x)=>null === x;\nconst isNullish = (x)=>isUndefined(x) || isNull(x);\nconst isNumber = (x)=>'[object Number]' == type_utils_toString.call(x);\nconst isBoolean = (x)=>'[object Boolean]' === type_utils_toString.call(x);\nconst isFormData = (x)=>x instanceof FormData;\nconst isFile = (x)=>x instanceof File;\nconst isPlainError = (x)=>x instanceof Error;\nconst isKnownUnsafeEditableEvent = (x)=>includes(knownUnsafeEditableEvent, x);\nfunction isPrimitive(value) {\n return null === value || 'object' != typeof value;\n}\nfunction isBuiltin(candidate, className) {\n return Object.prototype.toString.call(candidate) === `[object ${className}]`;\n}\nfunction isError(candidate) {\n switch(Object.prototype.toString.call(candidate)){\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n case '[object DOMError]':\n case '[object WebAssembly.Exception]':\n return true;\n default:\n return isInstanceOf(candidate, Error);\n }\n}\nfunction isErrorEvent(event) {\n return isBuiltin(event, 'ErrorEvent');\n}\nfunction isEvent(candidate) {\n return !isUndefined(Event) && isInstanceOf(candidate, Event);\n}\nfunction isPlainObject(candidate) {\n return isBuiltin(candidate, 'Object');\n}\nfunction isInstanceOf(candidate, base) {\n try {\n return candidate instanceof base;\n } catch {\n return false;\n }\n}\nconst yesLikeValues = [\n true,\n 'true',\n 1,\n '1',\n 'yes'\n];\nconst isYesLike = (val)=>includes(yesLikeValues, val);\nconst noLikeValues = [\n false,\n 'false',\n 0,\n '0',\n 'no'\n];\nconst isNoLike = (val)=>includes(noLikeValues, val);\nexport { type_utils_hasOwnProperty as hasOwnProperty, isArray, isBoolean, isBuiltin, isEmptyObject, isEmptyString, isError, isErrorEvent, isEvent, isFile, isFormData, isFunction, isKnownUnsafeEditableEvent, isNativeFunction, isNoLike, isNull, isNullish, isNumber, isObject, isPlainError, isPlainObject, isPrimitive, isString, isUndefined, isYesLike, noLikeValues, yesLikeValues };\n","function createConsole(consoleLike = console) {\n const lockedMethods = {\n log: consoleLike.log.bind(consoleLike),\n warn: consoleLike.warn.bind(consoleLike),\n error: consoleLike.error.bind(consoleLike),\n debug: consoleLike.debug.bind(consoleLike)\n };\n return lockedMethods;\n}\nconst _createLogger = (prefix, maybeCall, consoleLike)=>{\n function _log(level, ...args) {\n maybeCall(()=>{\n const consoleMethod = consoleLike[level];\n consoleMethod(prefix, ...args);\n });\n }\n const logger = {\n info: (...args)=>{\n _log('log', ...args);\n },\n warn: (...args)=>{\n _log('warn', ...args);\n },\n error: (...args)=>{\n _log('error', ...args);\n },\n critical: (...args)=>{\n consoleLike['error'](prefix, ...args);\n },\n createLogger: (additionalPrefix)=>_createLogger(`${prefix} ${additionalPrefix}`, maybeCall, consoleLike)\n };\n return logger;\n};\nconst passThrough = (fn)=>fn();\nfunction createLogger(prefix, maybeCall = passThrough) {\n return _createLogger(prefix, maybeCall, createConsole());\n}\nexport { _createLogger, createLogger };\n","import { querySelectorAllDeep } from 'query-selector-shadow-dom'\nimport { window as _window } from '../../utils/globals'\nimport { createLogger, isArray, isUndefined } from '@posthog/core'\n\nconst window = _window as Window & typeof globalThis\nconst logger = createLogger('[Element Inference]')\n\n// this is copied directly from the main repo: /frontend/src/toolbar/utils.ts\n// TODO: once this is deployed, we can have the main repo reference this instead\nexport function elementIsVisible(element: HTMLElement, cache: WeakMap<HTMLElement, boolean>): boolean {\n try {\n const alreadyCached = cache.get(element)\n if (!isUndefined(alreadyCached)) {\n return alreadyCached\n }\n\n if (element.checkVisibility) {\n const nativeIsVisible = element.checkVisibility({\n checkOpacity: true,\n checkVisibilityCSS: true,\n })\n cache.set(element, nativeIsVisible)\n return nativeIsVisible\n }\n\n const style = window.getComputedStyle(element)\n const isInvisible = style.display === 'none' || style.visibility === 'hidden' || parseFloat(style.opacity) === 0\n if (isInvisible) {\n cache.set(element, false)\n return false\n }\n\n // Check parent chain for display/visibility\n let parent = element.parentElement\n while (parent) {\n // Check cache first\n const cached = cache.get(parent)\n if (!isUndefined(cached)) {\n if (!cached) {\n return false\n }\n // If cached as visible, skip to next parent\n parent = parent.parentElement\n continue\n }\n\n const parentStyle = window.getComputedStyle(parent)\n const parentVisible = parentStyle.display !== 'none' && parentStyle.visibility !== 'hidden'\n\n cache.set(parent, parentVisible)\n\n if (!parentVisible) {\n return false\n }\n parent = parent.parentElement\n }\n\n // Check if element has actual rendered dimensions\n const rect = element.getBoundingClientRect()\n const elementHasActualRenderedDimensions =\n rect.width > 0 ||\n rect.height > 0 ||\n // Some elements might be 0x0 but still visible (e.g., inline elements with content)\n element.getClientRects().length > 0\n cache.set(element, elementHasActualRenderedDimensions)\n return elementHasActualRenderedDimensions\n } catch {\n // if we can't get the computed style, we'll assume the element is visible\n return true\n }\n}\n\nexport interface SelectorGroup {\n cardinality: number\n cssSelectors: Array<{\n css: string\n offset: number\n }>\n}\n\nexport interface AutoData {\n notextGroups: SelectorGroup[]\n textGroups: SelectorGroup[]\n}\n\nexport interface InferredSelector {\n autoData: string\n text: string | null\n excludeText?: boolean\n}\n\nfunction getElementText(element: HTMLElement): string | null {\n const text = element.innerText?.trim()\n // anything higher than 250 chars -> prob not a good selector / button / target\n if (!text || text.length > 250) {\n return null\n }\n return text\n}\n\nfunction elementMatchesText(element: HTMLElement, text: string): boolean {\n const elementText = getElementText(element)\n return elementText?.toLowerCase() === text.toLowerCase()\n}\n\n// generator to query elements, filtering by text and visibility\nfunction* queryElements(\n selector: string,\n text: string | null,\n visibilityCache: WeakMap<HTMLElement, boolean>\n): Generator<HTMLElement, void, undefined> {\n let elements: HTMLElement[]\n\n try {\n elements = querySelectorAllDeep(selector) as unknown as HTMLElement[]\n } catch {\n return\n }\n\n for (const el of elements) {\n const element = el as HTMLElement\n if (text && !elementMatchesText(element, text)) {\n continue\n }\n if (!elementIsVisible(element, visibilityCache)) {\n continue\n }\n yield element\n }\n}\n\n// could be inlined, but wanna keep lazy eval from queryElements\nfunction nth<T>(iterable: Iterable<T>, n: number): T | null {\n let idx = 0\n for (const item of iterable) {\n if (idx === n) {\n return item\n }\n idx++\n }\n return null\n}\n\n/**\n * if inferSelector is the sauce, this is the nugget\n *\n * find an element in the dom using the element inference data\n *\n * 1. try each group of selectors, starting with most specific (lowest cardinality)\n * 2. try each selector in the group - run the css query, go to offset\n * 3. \"vote\" for the element if it was found\n * 4. return early if any element gets majority votes\n * 5. return element w/ most votes\n */\nexport function findElement(selector: InferredSelector): HTMLElement | null {\n try {\n const autoData = JSON.parse(selector.autoData) as AutoData\n if (!isArray(autoData?.textGroups) || !isArray(autoData?.notextGroups)) {\n logger.error('Invalid autoData structure:', autoData)\n return null\n }\n const { text, excludeText } = selector\n\n // excludeText -> user setting, usually if the target element\n // has dynamic/localized text\n const useText = text != null && !excludeText\n\n // choose appropriate group + sort\n const groups = (useText ? autoData.textGroups : autoData.notextGroups).sort(\n (a, b) => a.cardinality - b.cardinality\n )\n\n if (groups.length === 0) {\n return null\n }\n\n const visibilityCache = new WeakMap<HTMLElement, boolean>()\n\n // try each selector group, starting w/ most specific (lowest cardinality)\n for (const group of groups) {\n const votes = new Map<HTMLElement, number>()\n let winner: HTMLElement | null = null\n let maxVotes = 0\n\n // test each selector in the group\n for (const { css, offset } of group.cssSelectors) {\n // get matches, jump to offset to find our target\n const element = nth(queryElements(css, useText ? text : null, visibilityCache), offset)\n\n if (!element) {\n continue\n }\n\n // if we found something, this element gets a vote\n const voteCount = (votes.get(element) ?? 0) + 1\n votes.set(element, voteCount)\n\n if (voteCount > maxVotes) {\n maxVotes = voteCount\n winner = element\n\n // break early if we have a majority\n if (voteCount >= Math.ceil(group.cssSelectors.length / 2)) {\n return winner\n }\n }\n }\n\n if (winner) {\n return winner\n }\n }\n\n return null\n } catch (error) {\n logger.error('Error finding element:', error)\n return null\n }\n}\n\nexport function getElementPath(el: HTMLElement | null, depth = 4): string | null {\n if (!el) {\n return null\n }\n const parts: string[] = []\n let current: HTMLElement | null = el\n\n while (current && parts.length < depth && current.tagName !== 'BODY') {\n let part = current.tagName.toLowerCase()\n if (current.id) {\n part += `#${current.id}`\n } else if (current.classList.length) {\n part += `.${current.classList[0]}`\n }\n parts.unshift(part)\n current = current.parentElement\n }\n\n return parts.join(' > ')\n}\n"],"names":["querySelectorAllDeep","selector","root","allElements","document","findMany","sel","saveUnmatched","unmatched","tokens","length","test","push","match","regex","prev_match_idx","state","next_match_idx","not_escaped_pattern","whitespace_pattern","state_patterns","trim","lastIndex","exec","substr","substring","RegExp","pop","charAt","join","normalizeSelector","querySelector","head","createShadowRoot","attachShadow","splitByCharacterUnlessQuoted","reduce","acc","minimalSelector","splitSelector","replace","filter","entry","map","possibleElementsIndex","possibleElements","cachedElements","findAllElements","nodes","i","el","shadowRoot","querySelectorAll","matches","collectAllElementsDeep","findElements","element","position","parent","foundElement","isDocumentNode","foundMatch","reversedParts","concat","reverse","newParent","part","findParentOrHost","findMatchingElement","_querySelectorDeep","character","p","c","sQuote","quote","a","node","nodeType","Node","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","parentNode","host","win","window","undefined","global","globalThis","self","File","navigator","location","fetch","XMLHttpRequest","AbortController","userAgent","nativeIsArray","Array","isArray","type_utils_toString","Object","prototype","toString","obj","call","isUndefined","x","_createLogger","prefix","maybeCall","consoleLike","_log","level","_len","arguments","args","_key","consoleMethod","info","_len2","_key2","warn","_len3","_key3","error","_len4","_key4","critical","_len5","_key5","createLogger","additionalPrefix","_window","logger","fn","console","log","bind","debug","elementIsVisible","cache","alreadyCached","get","checkVisibility","nativeIsVisible","checkOpacity","checkVisibilityCSS","set","style","getComputedStyle","display","visibility","parseFloat","opacity","parentElement","cached","parentStyle","parentVisible","rect","getBoundingClientRect","elementHasActualRenderedDimensions","width","height","getClientRects","_unused","elementMatchesText","text","elementText","_element$innerText","innerText","getElementText","toLowerCase","queryElements","visibilityCache","elements","_unused2","nth","iterable","n","idx","item","findElement","autoData","JSON","parse","textGroups","notextGroups","excludeText","useText","groups","sort","b","cardinality","WeakMap","group","votes","Map","winner","maxVotes","css","offset","cssSelectors","_votes$get","voteCount","Math","ceil","getElementPath","depth","parts","current","tagName","id","classList","unshift"],"mappings":"AAgBO,SAASA,EAAqBC,EAAUC,EAAiBC,GAC5D,YAD+C,IAAJD,IAAAA,EAAOE,eAAqB,IAAXD,IAAAA,EAAc,MAQ9E,SAA4BF,EAAUI,EAAUH,EAAMC,QAAW,IAAXA,IAAAA,EAAc,MAIhE,OAHAF,ECXG,SAA2BK,GAEhC,SAASC,IACHC,IAEEC,EAAOC,OAAS,GAAK,UAAUC,KAAKF,EAAOA,EAAOC,OAAS,KAC7DD,EAAOG,KAAK,KAIdH,EAAOG,KAAKJ,GAEhB,CAEA,IACEK,EACAL,EACAM,EAGAC,EANEN,EAAS,GAIXO,EAAQ,CAAC,GACTC,EAAiB,EAEjBC,EAAsB,kCACtBC,EAAqB,QACrBC,EAAiB,CACf,sBACA,sBACA,sBACA,KACA,SAKJ,IAHAd,EAAMA,EAAIe,SAGG,CASX,GARAb,EAAY,IAEZM,EAAQM,EAAeJ,EAAMA,EAAMN,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