vendor: 55,906 bytes, line 1
1(()=>{"use strict";var e="undefined"!=typeof window?window:void 0,t="undefined"!=typeof globalThis?globalThis:e;"undefined"==typeof self&&(t.self=t),"undefined"==typeof File&&(t.File=function(){});var i=Array.prototype,r=i.forEach,n=i.indexOf,s=null==t?void 0:t.navigator,o=null==t?void 0:t.document,a=null==t?void 0:t.location,l=null==t?void 0:t.fetch,c=null!=t&&t.XMLHttpRequest&&"withCredentials"in new t.XMLHttpRequest?t.XMLHttpRequest:void 0,u=null==t?void 0:t.AbortController,d=null==s?void 0:s.userAgent,p=null!=e?e:{},h={DEBUG:!1,LIB_VERSION:"1.355.0"};function f(e,t,i,r,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(r,n)}function g(e){return function(){var t=this,i=arguments;return new Promise(function(r,n){var s=e.apply(t,i);function o(e){f(s,r,n,o,a,"next",e)}function a(e){f(s,r,n,o,a,"throw",e)}o(void 0)})}}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},_.apply(null,arguments)}function v(e,t){if(null==e)return{};var i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var m=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],y=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],b=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return y.concat(t).some(e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)})};function w(e,t){return-1!==e.indexOf(t)}var E=function(e){return e.trim()},x=function(e){return e.replace(/^\$/,"")},S=Array.isArray,k=Object.prototype,O=k.hasOwnProperty,P=k.toString,I=S||function(e){return"[object Array]"===P.call(e)},T=e=>"function"==typeof e,A=e=>e===Object(e)&&!I(e),R=e=>{if(A(e)){for(var t in e)if(O.call(e,t))return!1;return!0}return!1},$=e=>void 0===e,C=e=>"[object String]"==P.call(e),F=e=>C(e)&&0===e.trim().length,M=e=>null===e,j=e=>$(e)||M(e),N=e=>"[object Number]"==P.call(e)&&e==e,D=e=>N(e)&&e>0,L=e=>"[object Boolean]"===P.call(e),H=e=>w(m,e);function q(e){return null===e||"object"!=typeof e}function U(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function z(e){return!$(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var B=[!0,"true",1,"1","yes"],W=e=>w(B,e),V=[!1,"false",0,"0","no"];function G(e,t,i,r,n){return t>i&&(r.warn("min cannot be greater than max."),t=i),N(e)?e>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),G(n||i,t,i,r))}class Y{constructor(e){this.t={},this.i=e.i,this.o=G(e.bucketSize,0,100,e.h),this.m=G(e.refillRate,0,this.o,e.h),this.$=G(e.refillInterval,0,864e5,e.h)}S(e,t){var i=t-e.lastAccess,r=Math.floor(i/this.$);if(r>0){var n=r*this.m;e.tokens=Math.min(e.tokens+n,this.o),e.lastAccess=e.lastAccess+r*this.$}}consumeRateLimit(e){var t,i=Date.now(),r=String(e),n=this.t[r];return n?this.S(n,i):(n={tokens:this.o,lastAccess:i},this.t[r]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.i)||t.call(this,e)),0===n.tokens)}stop(){this.t={}}}var J,K,X,Z="Mobile",Q="iOS",ee="Android",te="Tablet",ie=ee+" "+te,re="iPad",ne="Apple",se=ne+" Watch",oe="Safari",ae="BlackBerry",le="Samsung",ce=le+"Browser",ue=le+" Internet",de="Chrome",pe=de+" OS",he=de+" "+Q,fe="Internet Explorer",ge=fe+" "+Z,_e="Opera",ve=_e+" Mini",me="Edge",ye="Microsoft "+me,be="Firefox",we=be+" "+Q,Ee="Nintendo",xe="PlayStation",Se="Xbox",ke=ee+" "+Z,Oe=Z+" "+oe,Pe="Windows",Ie=Pe+" Phone",Te="Nokia",Ae="Ouya",Re="Generic",$e=Re+" "+Z.toLowerCase(),Ce=Re+" "+te.toLowerCase(),Fe="Konqueror",Me="(\\d+(\\.\\d+)?)",je=new RegExp("Version/"+Me),Ne=new RegExp(Se,"i"),De=new RegExp(xe+" \\w+","i"),Le=new RegExp(Ee+" \\w+","i"),He=new RegExp(ae+"|PlayBook|BB10","i"),qe={"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"},Ue=function(e,t){return t=t||"",w(e," OPR/")&&w(e,"Mini")?ve:w(e," OPR/")?_e:He.test(e)?ae:w(e,"IE"+Z)||w(e,"WPDesktop")?ge:w(e,ce)?ue:w(e,me)||w(e,"Edg/")?ye:w(e,"FBIOS")?"Facebook "+Z:w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?he:w(e,"CrMo")||w(e,de)?de:w(e,ee)&&w(e,oe)?ke:w(e,"FxiOS")?we:w(e.toLowerCase(),Fe.toLowerCase())?Fe:((e,t)=>t&&w(t,ne)||function(e){return w(e,oe)&&!w(e,de)&&!w(e,ee)}(e))(e,t)?w(e,Z)?Oe:oe:w(e,be)?be:w(e,"MSIE")||w(e,"Trident/")?fe:w(e,"Gecko")?be:""},ze={[ge]:[new RegExp("rv:"+Me)],[ye]:[new RegExp(me+"?\\/"+Me)],[de]:[new RegExp("("+de+"|CrMo)\\/"+Me)],[he]:[new RegExp("CriOS\\/"+Me)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Me)],[oe]:[je],[Oe]:[je],[_e]:[new RegExp("(Opera|OPR)\\/"+Me)],[be]:[new RegExp(be+"\\/"+Me)],[we]:[new RegExp("FxiOS\\/"+Me)],[Fe]:[new RegExp("Konqueror[:/]?"+Me,"i")],[ae]:[new RegExp(ae+" "+Me),je],[ke]:[new RegExp("android\\s"+Me,"i")],[ue]:[new RegExp(ce+"\\/"+Me)],[fe]:[new RegExp("(rv:|MSIE )"+Me)],Mozilla:[new RegExp("rv:"+Me)]},Be=function(e,t){var i=Ue(e,t),r=ze[i];if($(r))return null;for(var n=0;n<r.length;n++){var s=r[n],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},We=[[new RegExp(Se+"; "+Se+" (.*?)[);]","i"),e=>[Se,e&&e[1]||""]],[new RegExp(Ee,"i"),[Ee,""]],[new RegExp(xe,"i"),[xe,""]],[He,[ae,""]],[new RegExp(Pe,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ie,""];if(new RegExp(Z).test(t)&&!/IEMobile\b/.test(t))return[Pe+" "+Z,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],n=qe[r]||"";return/arm/i.test(t)&&(n="RT"),[Pe,n]}return[Pe,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Q,t.join(".")]}return[Q,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=$(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+ee+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ee+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[ee,t.join(".")]}return[ee,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[pe,""]],[/Linux|debian/i,["Linux",""]]],Ve=function(e){return Le.test(e)?Ee:De.test(e)?xe:Ne.test(e)?Se:new RegExp(Ae,"i").test(e)?Ae:new RegExp("("+Ie+"|WPDesktop)","i").test(e)?Ie:/iPad/.test(e)?re:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?se:He.test(e)?ae:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Te,"i").test(e)?Te:/(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(Z).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)?ee:ie:new RegExp("(pda|"+Z+")","i").test(e)?$e:new RegExp(te,"i").test(e)&&!new RegExp(te+" pc","i").test(e)?Ce:""},Ge=e=>e instanceof Error;function Ye(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return X&&i.length===K||(K=i.length,X=i.reduce((i,r)=>{J||(J={});var n=J[r];if(n)i[n[0]]=n[1];else for(var s=e(r),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,c=t[r];if(l&&c){i[l]=c,J[r]=[l,c];break}}return i},{})),X}}class Je{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(e){var t=this;return g(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&I(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),_({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return g(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,n,s={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(r=t.handled)||void 0===r||r,synthetic:null!==(n=e.synthetic)&&void 0!==n&&n}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,_({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:Ye(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(r<=4){var n=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,n)}};return _({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}var Ke="?";function Xe(e,t,i,r,n){var s={platform:e,filename:t,function:"<anonymous>"===i?Ke:i,in_app:!0};return $(r)||(s.lineno=r),$(n)||(s.colno=n),s}var Ze=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:Ke,i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Qe=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,et=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tt=/\((\S*)(?::(\d+))(?::(\d+))\)/,it=(e,t)=>{var i=Qe.exec(e);if(i){var[,r,n,s]=i;return Xe(t,r,Ke,+n,+s)}var o=et.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=tt.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,c]=Ze(o[1]||Ke,o[2]);return Xe(t,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},rt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,nt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,st=(e,t)=>{var i=rt.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=nt.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||Ke;return[s,n]=Ze(s,n),Xe(t,n,s,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},ot=/\(error: (.*)\)/;class at{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=C(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return U(e,"DOMException")}isDOMError(e){return U(e,"DOMError")}}class lt{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class ct{constructor(){}match(e){return U(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var ut=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class dt{match(e){return"string"==typeof e}coerce(e,t){var i,[r,n]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(ut);return r&&(t=r[1],i=r[2]),[t,i]}}var pt=["fatal","error","warning","log","info","debug"];function ht(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(!(n.length>t))return r===i.length||n.length<=t?n:n.slice(0,t)+"..."}return""}class ft{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return z(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+ht(e)}isSeverityLevel(e){return C(e)&&!F(e)&&pt.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(Ge(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class gt{match(e){return z(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ht(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class _t{match(e){return q(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class vt{match(e){return U(e,"PromiseRejectionEvent")}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return q(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){if(q(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var mt=function(t,i){var{debugEnabled:r}=void 0===i?{}:i,n={k:function(i){if(e&&(h.DEBUG||p.POSTHOG_DEBUG||r)&&!$(e.console)&&e.console){for(var n=("__rrweb_original__"in e.console[i]?e.console[i].__rrweb_original__:e.console[i]),s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];n(t,...o)}},info:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.k("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.k("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.k("error",...t)},critical:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning:e=>{n.error("You must initialize PostHog before calling "+e)},createLogger:(e,i)=>mt(t+" "+e,i)};return n},yt=mt("[PostHog.js]"),bt=yt.createLogger,wt=bt("[ExternalScriptsLoader]"),Et=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return wt.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==o?void 0:o.querySelectorAll("script");if(r)for(var n,s=function(){if(r[a].src===t){var e=r[a];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}},a=0;a<r.length;a++)if(n=s())return n.v;var l=()=>{if(!o)return i("document not found");var r=o.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)o.head.appendChild(r);else{var n,s=o.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):o.body.appendChild(r)}};null!=o&&o.body?l():null==o||o.addEventListener("DOMContentLoaded",l)};p.__PosthogExtensions__=p.__PosthogExtensions__||{},p.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var r="/static/"+t+".js?v="+e.version;if("remote-config"===t&&(r="/array/"+e.config.token+"/config.js"),"toolbar"===t){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var s=e.requestRouter.endpointFor("assets",r);Et(e,s,i)},p.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);Et(e,r,i)};var xt={};function St(e,t,i){if(I(e))if(r&&e.forEach===r)e.forEach(t,i);else if("length"in e&&e.length===+e.length)for(var n=0,s=e.length;n<s;n++)if(n in e&&t.call(i,e[n],n)===xt)return}function kt(e,t,i){if(!j(e)){if(I(e))return St(e,t,i);if((e=>e instanceof FormData)(e)){for(var r of e.entries())if(t.call(i,r[1],r[0])===xt)return}else for(var n in e)if(O.call(e,n)&&t.call(i,e[n],n)===xt)return}}var Ot=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return St(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},Pt=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return St(i,function(t){St(t,function(t){e.push(t)})}),e};function It(e){for(var t=Object.keys(e),i=t.length,r=new Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var Tt=function(e){try{return e()}catch(e){return}},At=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){yt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),yt.critical(e)}}},Rt=function(e){var t={};return kt(e,function(e,i){(C(e)&&e.length>0||N(e))&&(t[i]=e)}),t},$t=["herokuapp.com","vercel.app","netlify.app"];function Ct(e){var t=null==e?void 0:e.hostname;if(!C(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of $t)if(i===r)return!1;return!0}function Ft(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function Mt(e,t,i,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:n,passive:s})}function jt(e){return"ph_toolbar_internal"===e.name}var Nt="$people_distinct_id",Dt="__alias",Lt="__timers",Ht="$autocapture_disabled_server_side",qt="$heatmaps_enabled_server_side",Ut="$exception_capture_enabled_server_side",zt="$error_tracking_suppression_rules",Bt="$error_tracking_capture_extension_exceptions",Wt="$web_vitals_enabled_server_side",Vt="$dead_clicks_enabled_server_side",Gt="$product_tours_enabled_server_side",Yt="$web_vitals_allowed_metrics",Jt="$session_recording_remote_config",Kt="$sesid",Xt="$session_is_sampled",Zt="$enabled_feature_flags",Qt="$early_access_features",ei="$feature_flag_details",ti="$stored_person_properties",ii="$stored_group_properties",ri="$surveys",ni="$flag_call_reported",si="$feature_flag_errors",oi="$user_state",ai="$client_session_props",li="$capture_rate_limit",ci="$initial_campaign_params",ui="$initial_referrer_info",di="$initial_person_info",pi="$epp",hi="__POSTHOG_TOOLBAR__",fi="$posthog_cookieless",gi=[Nt,Dt,"__cmpns",Lt,"$session_recording_enabled_server_side",qt,Kt,Zt,zt,oi,Qt,ei,ii,ti,ri,ni,si,ai,li,ci,ui,pi,di];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return N(e)&&isFinite(e)&&Math.floor(e)===e});var _i="0123456789abcdef";class vi{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new vi(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+_i.charAt(this.bytes[t]>>>4)+_i.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new vi(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class mi{constructor(){this.P=0,this.T=0,this.I=new wi}generate(){var e=this.generateOrAbort();if($(e)){this.P=0;var t=this.generateOrAbort();if($(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.C();else{if(!(e+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.C())}return vi.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.T=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var yi,bi=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!$(e.crypto)&&crypto.getRandomValues&&(bi=e=>crypto.getRandomValues(e));class wi{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&(bi(this.R),this.F=0),this.R[this.F++]}}var Ei=()=>xi().toString(),xi=()=>(yi||(yi=new mi)).generate(),Si="",ki=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Oi={O:()=>!!o,M:function(e){yt.error("cookieStore error: "+e)},A:function(e){if(o){try{for(var t=e+"=",i=o.cookie.split(";").filter(e=>e.length),r=0;r<i.length;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},D:function(e){var t;try{t=JSON.parse(Oi.A(e))||{}}catch(e){}return t},j:function(e,t,i,r,n){if(o)try{var s="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),Si)return Si;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),n="dmn_chk_"+Ei();!Si&&r--;){var s=i.slice(r).join("."),a=n+"=1;domain=."+s+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(n)&&(t.cookie=a+";max-age=0",Si=s)}return Si}(e);if(!i){var r=(e=>{var t=e.match(ki);return t?t[0]:""})(e);r!==i&&yt.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(o.location.hostname,r);if(i){var c=new Date;c.setTime(c.getTime()+24*i*60*60*1e3),s="; expires="+c.toUTCString()}n&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+l+a;return u.length>3686.4&&yt.warn("cookieStore warning: large cookie, len="+u.length),o.cookie=u,u}catch(e){return}},L:function(e,t){if(null!=o&&o.cookie)try{Oi.j(e,"",-1,t)}catch(e){return}}},Pi=null,Ii={O:function(){if(!M(Pi))return Pi;var t=!0;if($(e))t=!1;else try{var i="__mplssupport__";Ii.j(i,"xyz"),'"xyz"'!==Ii.A(i)&&(t=!1),Ii.L(i)}catch(e){t=!1}return t||yt.error("localStorage unsupported; falling back to cookie store"),Pi=t,t},M:function(e){yt.error("localStorage error: "+e)},A:function(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(e){Ii.M(e)}return null},D:function(e){try{return JSON.parse(Ii.A(e))||{}}catch(e){}return null},j:function(t,i){try{null==e||e.localStorage.setItem(t,JSON.stringify(i))}catch(e){Ii.M(e)}},L:function(t){try{null==e||e.localStorage.removeItem(t)}catch(e){Ii.M(e)}}},Ti=["$device_id","distinct_id",Kt,Xt,pi,di,oi],Ai={},Ri={O:function(){return!0},M:function(e){yt.error("memoryStorage error: "+e)},A:function(e){return Ai[e]||null},D:function(e){return Ai[e]||null},j:function(e,t){Ai[e]=t},L:function(e){delete Ai[e]}},$i=null,Ci={O:function(){if(!M($i))return $i;if($i=!0,$(e))$i=!1;else try{var t="__support__";Ci.j(t,"xyz"),'"xyz"'!==Ci.A(t)&&($i=!1),Ci.L(t)}catch(e){$i=!1}return $i},M:function(e){yt.error("sessionStorage error: ",e)},A:function(t){try{return null==e?void 0:e.sessionStorage.getItem(t)}catch(e){Ci.M(e)}return null},D:function(e){try{return JSON.parse(Ci.A(e))||null}catch(e){}return null},j:function(t,i){try{null==e||e.sessionStorage.setItem(t,JSON.stringify(i))}catch(e){Ci.M(e)}},L:function(t){try{null==e||e.sessionStorage.removeItem(t)}catch(e){Ci.M(e)}}},Fi=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class Mi{constructor(e){this._instance=e}get N(){return this._instance.config}get consent(){return this.U()?Fi.DENIED:this.H}isOptedOut(){return"always"===this.N.cookieless_mode||this.consent===Fi.DENIED||this.consent===Fi.PENDING&&(this.N.opt_out_capturing_by_default||"on_reject"===this.N.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Fi.DENIED}optInOut(e){this.B.j(this.q,e?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get H(){var e=this.B.A(this.q);return W(e)?Fi.GRANTED:w(V,e)?Fi.DENIED:Fi.PENDING}get B(){if(!this.W){var e=this.N.opt_out_capturing_persistence_type;this.W="localStorage"===e?Ii:Oi;var t="localStorage"===e?Oi:Ii;t.A(this.q)&&(this.W.A(this.q)||this.optInOut(W(t.A(this.q))),t.L(this.q,this.N.cross_subdomain_cookie))}return this.W}U(){return!!this.N.respect_dnt&&!!Ft([null==s?void 0:s.doNotTrack,null==s?void 0:s.msDoNotTrack,p.doNotTrack],e=>W(e))}}var ji=bt("[Dead Clicks]"),Ni=()=>!0,Di=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(Vt)),r=e.instance.config.capture_dead_clicks;return L(r)?r:!!A(r)||i};class Li{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Vt]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.V(()=>{this.J()}):this.stop()}V(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?ji.error("failed to load script",t):e()})}J(){var e;if(o){if(!this.G&&null!=(e=p.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=A(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.G=p.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(o),ji.info("starting...")}}else ji.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,ji.info("stopping..."))}}var Hi=bt("[SegmentIntegration]"),qi="posthog-js";function Ui(e,t){var{organization:i,projectId:r,prefix:n,severityAllowList:s=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{var a,l,c,u,d;if("*"!==s&&!s.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=(null==(a=t.exception)?void 0:a.values)||[],f=h.map(e=>_({},e,{stacktrace:e.stacktrace?_({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>_({},e,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(l=h[0])?void 0:l.value)||t.message,$exception_type:null==(c=h[0])?void 0:c.type,$exception_level:t.level,$exception_list:f,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=h[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(d=h[0])?void 0:d.type,$sentry_tags:t.tags};return i&&r&&(g.$sentry_url=(n||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),o&&e.exceptions.sendExceptionEvent(g),t}}class zi{constructor(e,t,i,r,n,s){this.name=qi,this.setupOnce=function(o){o(Ui(e,{organization:t,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var Bi=e=>{var t=null==o?void 0:o.createElement("a");return $(t)?null:(t.href=e,t)},Wi=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<r.length;n++){var s=r[n].split("=");if(s[0]===t){i=s;break}}if(!I(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){yt.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Vi=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),n=r[0]||"",s=r[1],o=n.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var p=c[d].split("=");I(p)&&(t.includes(p[0])?u.push(p[0]+"="+i):u.push(c[d]))}var h=l;return null!=a&&(h+="?"+u.join("&")),null!=s&&(h+="#"+s),h},Gi=function(e,t){var i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},Yi=null!=e&&e.location?Gi(e.location.hash,"__posthog")||Gi(location.hash,"state"):null,Ji="_postHogToolbarParams",Ki=bt("[Toolbar]"),Xi=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Xi||{});class Zi{constructor(e){this.instance=e}K(e){p.ph_toolbar_state=e}Y(){var e;return null!==(e=p.ph_toolbar_state)&&void 0!==e?e:Xi.UNINITIALIZED}maybeLoadToolbar(t,i,r){if(void 0===t&&(t=void 0),void 0===i&&(i=void 0),void 0===r&&(r=void 0),jt(this.instance.config))return!1;if(!e||!o)return!1;t=null!=t?t:e.location,r=null!=r?r:e.history;try{if(!i){try{e.localStorage.setItem("test","test"),e.localStorage.removeItem("test")}catch(e){return!1}i=null==e?void 0:e.localStorage}var n,s=Yi||Gi(t.hash,"__posthog")||Gi(t.hash,"state"),a=s?Tt(()=>JSON.parse(atob(decodeURIComponent(s))))||Tt(()=>JSON.parse(decodeURIComponent(s))):null;return a&&"ph_authorize"===a.action?((n=a).source="url",n&&Object.keys(n).length>0&&(a.desiredHash?t.hash=a.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((n=JSON.parse(i.getItem(Ji)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token||(this.loadToolbar(n),0))}catch(e){return!1}}X(e){var t=p.ph_load_toolbar||p.ph_load_editor;!j(t)&&T(t)?t(e,this.instance):Ki.warn("No toolbar load function found")}loadToolbar(t){var i=!(null==o||!o.getElementById(hi));if(!e||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=_({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(e.localStorage.setItem(Ji,JSON.stringify(_({},n,{source:void 0}))),this.Y()===Xi.LOADED)this.X(n);else if(this.Y()===Xi.UNINITIALIZED){var s;this.K(Xi.LOADING),null==(s=p.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return Ki.error("[Toolbar] Failed to load",e),void this.K(Xi.UNINITIALIZED);this.K(Xi.LOADED),this.X(n)}),Mt(e,"turbolinks:load",()=>{this.K(Xi.UNINITIALIZED),this.loadToolbar(n)})}return!0}Z(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}class Qi{constructor(e){this.tt=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(yt.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.it=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.et()}et(){var e;this.rt=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.tt)}destroy(){var e;null==(e=this.rt)||e.call(this),this.rt=void 0}doPageView(t,i){var r,n=this.st(t,i);return this.it={pathname:null!==(r=null==e?void 0:e.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:t},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this.st(e,null==(t=this.it)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.it)?void 0:e.pageViewId}}st(e,t){var i=this.it;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=n;if(!($(s)||$(o)||$(a)||$(l)||$(c)||$(u))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=s<=1?1:G(o/s,0,1,yt),p=s<=1?1:G(a/s,0,1,yt),h=l<=1?1:G(c/l,0,1,yt),f=l<=1?1:G(u/l,0,1,yt);r=Ot(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var er=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),tr=Uint8Array,ir=Uint16Array,rr=Uint32Array,nr=new tr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sr=new tr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),or=new tr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ar=function(e,t){for(var i=new ir(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var n=new rr(i[30]);for(r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)n[s]=s-i[r]<<5|r;return[i,n]},lr=ar(nr,2),cr=lr[0],ur=lr[1];cr[28]=258,ur[258]=28;for(var dr=ar(sr,0)[1],pr=new ir(32768),hr=0;hr<32768;++hr){var fr=(43690&hr)>>>1|(21845&hr)<<1;fr=(61680&(fr=(52428&fr)>>>2|(13107&fr)<<2))>>>4|(3855&fr)<<4,pr[hr]=((65280&fr)>>>8|(255&fr)<<8)>>>1}var gr=function(e,t,i){for(var r=e.length,n=0,s=new ir(t);n<r;++n)++s[e[n]-1];var o,a=new ir(t);for(n=0;n<t;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new ir(1<<t);var l=15-t;for(n=0;n<r;++n)if(e[n])for(var c=n<<4|e[n],u=t-e[n],d=a[e[n]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)o[pr[d]>>>l]=c}else for(o=new ir(r),n=0;n<r;++n)o[n]=pr[a[e[n]-1]++]>>>15-e[n];return o},_r=new tr(288);for(hr=0;hr<144;++hr)_r[hr]=8;for(hr=144;hr<256;++hr)_r[hr]=9;for(hr=256;hr<280;++hr)_r[hr]=7;for(hr=280;hr<288;++hr)_r[hr]=8;var vr=new tr(32);for(hr=0;hr<32;++hr)vr[hr]=5;var mr=gr(_r,9,0),yr=gr(vr,5,0),br=function(e){return(e/8|0)+(7&e&&1)},wr=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof ir?ir:e instanceof rr?rr:tr)(i-t);return r.set(e.subarray(t,i)),r},Er=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8},xr=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8,e[r+2]|=i>>>16},Sr=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var n=i.length,s=i.slice();if(!n)return[new tr(0),0];if(1==n){var o=new tr(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=n-1;)a=i[i[c].f<i[d].f?c++:d++],l=i[c!=u&&i[c].f<i[d].f?c++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var p=s[0].s;for(r=1;r<n;++r)s[r].s>p&&(p=s[r].s);var h=new ir(p+1),f=kr(i[u-1],h,0);if(f>t){r=0;var g=0,_=f-t,v=1<<_;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<n;++r){var m=s[r].s;if(!(h[m]>t))break;g+=v-(1<<f-h[m]),h[m]=t}for(g>>>=_;g>0;){var y=s[r].s;h[y]<t?g-=1<<t-h[y]++-1:++r}for(;r>=0&&g;--r){var b=s[r].s;h[b]==t&&(--h[b],++g)}f=t}return[new tr(h),f]},kr=function(e,t,i){return-1==e.s?Math.max(kr(e.l,t,i+1),kr(e.r,t,i+1)):t[e.s]=i},Or=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new ir(++t),r=0,n=e[0],s=1,o=function(e){i[r++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[i.subarray(0,r),t]},Pr=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},Ir=function(e,t,i){var r=i.length,n=br(t+2);e[n]=255&r,e[n+1]=r>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;s<r;++s)e[n+s+4]=i[s];return 8*(n+4+r)},Tr=function(e,t,i,r,n,s,o,a,l,c,u){Er(t,u++,i),++n[256];for(var d=Sr(n,15),p=d[0],h=d[1],f=Sr(s,15),g=f[0],_=f[1],v=Or(p),m=v[0],y=v[1],b=Or(g),w=b[0],E=b[1],x=new ir(19),S=0;S<m.length;++S)x[31&m[S]]++;for(S=0;S<w.length;++S)x[31&w[S]]++;for(var k=Sr(x,7),O=k[0],P=k[1],I=19;I>4&&!O[or[I-1]];--I);var T,A,R,$,C=c+5<<3,F=Pr(n,_r)+Pr(s,vr)+o,M=Pr(n,p)+Pr(s,g)+o+14+3*I+Pr(x,O)+(2*x[16]+3*x[17]+7*x[18]);if(C<=F&&C<=M)return Ir(t,u,e.subarray(l,l+c));if(Er(t,u,1+(M<F)),u+=2,M<F){T=gr(p,h,0),A=p,R=gr(g,_,0),$=g;var j=gr(O,P,0);for(Er(t,u,y-257),Er(t,u+5,E-1),Er(t,u+10,I-4),u+=14,S=0;S<I;++S)Er(t,u+3*S,O[or[S]]);u+=3*I;for(var N=[m,w],D=0;D<2;++D){var L=N[D];for(S=0;S<L.length;++S){var H=31&L[S];Er(t,u,j[H]),u+=O[H],H>15&&(Er(t,u,L[S]>>>5&127),u+=L[S]>>>12)}}}else T=mr,A=_r,R=yr,$=vr;for(S=0;S<a;++S)if(r[S]>255){H=r[S]>>>18&31,xr(t,u,T[H+257]),u+=A[H+257],H>7&&(Er(t,u,r[S]>>>23&31),u+=nr[H]);var q=31&r[S];xr(t,u,R[q]),u+=$[q],q>3&&(xr(t,u,r[S]>>>5&8191),u+=sr[q])}else xr(t,u,T[r[S]]),u+=A[r[S]];return xr(t,u,T[256]),u+A[256]},Ar=new rr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Rr=function(){for(var e=new rr(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),$r=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};var Cr=!!c||!!l,Fr="text/plain",Mr=function(e,t,i){var r;void 0===i&&(i=!0);var[n,s]=e.split("?"),o=_({},t),a=null!==(r=null==s?void 0:s.split("&").map(e=>{var t,[r,n]=e.split("="),s=i&&null!==(t=o[r])&&void 0!==t?t:n;return delete o[r],r+"="+s}))&&void 0!==r?r:[],l=function(e,t){var i,r;void 0===t&&(t="&");var n=[];return kt(e,function(e,t){$(e)||$(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),n[n.length]=r+"="+i)}),n.join(t)}(o);return l&&a.push(l),n+"?"+a.join("&")},jr=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),Nr=e=>{var{data:t,compression:i}=e;if(t){if(i===er.GZipJS){var r=function(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p:function(t){for(var i=e,r=0;r<t.length;++r)i=Rr[255&i^t[r]]^i>>>8;e=i},d:function(){return 4294967295^e}}}(),r=e.length;i.p(e);var n,s=function(e,t,i){return function(e,t,i,r,n,s){var o=e.length,a=new tr(r+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(r,a.length-8),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d<o?c=Ir(l,c,e.subarray(u,d)):(l[u]=s,c=Ir(l,c,e.subarray(u,o)))}else{for(var p=Ar[t-1],h=p>>>13,f=8191&p,g=(1<<i)-1,_=new ir(32768),v=new ir(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new rr(25e3),E=new ir(288),x=new ir(32),S=0,k=0,O=(u=0,0),P=0,I=0;u<o;++u){var T=b(u),A=32767&u,R=v[T];if(_[A]=R,v[T]=A,P<=u){var $=o-u;if((S>7e3||O>24576)&&$>423){c=Tr(e,l,0,w,E,x,k,O,I,u-I,c),O=S=k=0,I=u;for(var C=0;C<286;++C)E[C]=0;for(C=0;C<30;++C)x[C]=0}var F=2,M=0,j=f,N=A-R&32767;if($>2&&T==b(u-N))for(var D=Math.min(h,$)-1,L=Math.min(32767,u),H=Math.min(258,$);N<=L&&--j&&A!=R;){if(e[u+F]==e[u+F-N]){for(var q=0;q<H&&e[u+q]==e[u+q-N];++q);if(q>F){if(F=q,M=N,q>D)break;var U=Math.min(N,q-2),z=0;for(C=0;C<U;++C){var B=u-N+C+32768&32767,W=B-_[B]+32768&32767;W>z&&(z=W,R=B)}}}N+=(A=R)-(R=_[A])+32768&32767}if(M){w[O++]=268435456|ur[F]<<18|dr[M];var V=31&ur[F],G=31&dr[M];k+=nr[V]+sr[G],++E[257+V],++x[G],P=u+F,++S}else w[O++]=e[u],++E[e[u]]}}c=Tr(e,l,s,w,E,x,k,O,I,u-I,c)}return wr(a,0,r+br(c)+8)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,i,0,!0)}(e,t,10+((n=t).filename&&n.filename.length+1||0)),o=s.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&$r(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(s,t),$r(s,o-8,i.d()),$r(s,o-4,r),s}(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new tr(e.length+(e.length>>>1)),r=0,n=function(e){i[r++]=e},s=0;s<t;++s){if(r+5>i.length){var o=new tr(r+8+(t-s<<1));o.set(i),i=o}var a=e.charCodeAt(s);a<128?n(a):a<2048?(n(192|a>>>6),n(128|63&a)):a>55295&&a<57344?(n(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++s))>>>18),n(128|a>>>12&63),n(128|a>>>6&63),n(128|63&a)):(n(224|a>>>12),n(128|a>>>6&63),n(128|63&a))}return wr(i,0,r)}(jr(t)),{mtime:0}),n=new Blob([r],{type:Fr});return{contentType:Fr,body:n,estimatedSize:n.size}}if(i===er.Base64){var s=function(e){var t,i,r,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=function(e){var t,i,r,n,s="";for(t=i=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<r;n++){var o=e.charCodeAt(n),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),M(a)||(i>t&&(s+=e.substring(t,i)),s+=a,t=i=n+1)}return i>t&&(s+=e.substring(t,e.length)),s}(e);do{t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=s>>12&63,r=s>>6&63,n=63&s,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(r)+o.charAt(n)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(jr(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:jr(e)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=jr(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Dr=[];l&&Dr.push({transport:"fetch",method:e=>{var t,i,{contentType:r,body:n,estimatedSize:s}=null!==(t=Nr(e))&&void 0!==t?t:{},o=new Headers;kt(e.headers,function(e,t){o.append(t,e)}),r&&o.append("Content-Type",r);var a=e.url,c=null;if(u){var d=new u;c={signal:d.signal,timeout:setTimeout(()=>d.abort(),e.timeout)}}l(a,_({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&(s||0)<52428.8,body:n,signal:null==(i=c)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){yt.error(e)}null==e.callback||e.callback(r)})).catch(t=>{yt.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>c?clearTimeout(c.timeout):null)}}),c&&Dr.push({transport:"XHR",method:e=>{var t,i=new c;i.open(e.method||"GET",e.url,!0);var{contentType:r,body:n}=null!==(t=Nr(e))&&void 0!==t?t:{};kt(e.headers,function(e,t){i.setRequestHeader(t,e)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(n)}}),null!=s&&s.sendBeacon&&Dr.push({transport:"sendBeacon",method:e=>{var t=Mr(e.url,{beacon:"1"});try{var i,{contentType:r,body:n}=null!==(i=Nr(e))&&void 0!==i?i:{},o="string"==typeof n?new Blob([n],{type:r}):n;s.sendBeacon(t,o)}catch(e){}}});var Lr=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Hr(e,t,i){return jr({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var qr={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>Lr(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Lr(t,e))),icontains:(e,t)=>t.map(Ur).some(t=>e.map(Ur).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(Ur).every(t=>e.map(Ur).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},Ur=e=>e.toLowerCase();function zr(e,t){return!e||Object.entries(e).every(e=>{var[i,r]=e,n=null==t?void 0:t[i];if($(n)||M(n))return!1;var s=[String(n)],o=qr[r.operator];return!!o&&o(r.values,s)})}var Br=bt("[Error tracking]");class Wr{constructor(e){var t,i;this.nt=[],this.ot=new Je([new at,new vt,new ct,new lt,new gt,new ft,new dt,new _t],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var n=[],s=t.split("\n"),o=r;o<s.length;o++){var a=s[o];if(!(a.length>1024)){var l=ot.test(a)?a.replace(ot,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l,e);if(u){n.push(u);break}}if(n.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>{return _({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||Ke});var i})}(n)}}("web:javascript",it,st)),this._instance=e,this.nt=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(zt))&&void 0!==t?t:[]}onRemoteConfig(e){var t,i,r;if("errorTracking"in e){var n=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],s=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.nt=n,this._instance.persistence&&this._instance.persistence.register({[zt]:this.nt,[Bt]:s})}}get ut(){var e,t=!!this._instance.get_property(Bt),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.ot.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ht(t)){if(this.dt(t))return void Br.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(t))return void Br.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(t))return void Br.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:r}=t;return C(i)&&i.length>0&&e.$exception_types.push(i),C(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.nt.some(e=>{var i=e.values.map(e=>{var i,r=qr[e.operator],n=I(e.value)?e.value:[e.value],s=null!==(i=t[e.key])&&void 0!==i?i:[];return n.length>0&&r(n,s)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}vt(e){return e.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ct(e){if(e.length>0){var t,i,r,n,s=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],o=s[s.length-1];return null!==(r=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}ht(e){return!j(e)&&I(e)}}var Vr="https?://(.*)",Gr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Yr=Pt(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Gr),Jr="<masked>",Kr=["li_fat_id"];function Xr(e,t,i){if(!o)return{};var r,n=t?Pt([],Gr,i||[]):[],s=Zr(Vi(o.URL,n,Jr),e),a=(r={},kt(Kr,function(e){var t=Oi.A(e);r[e]=t||null}),r);return Ot(a,s)}function Zr(e,t){var i=Yr.concat(t||[]),r={};return kt(i,function(t){var i=Wi(e,t);r[t]=i||null}),r}function Qr(e){var t=function(e){return e?0===e.search(Vr+"google.([^/?]*)")?"google":0===e.search(Vr+"bing.com")?"bing":0===e.search(Vr+"yahoo.com")?"yahoo":0===e.search(Vr+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",r={};if(!M(t)){r.$search_engine=t;var n=o?Wi(o.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function en(){return navigator.language||navigator.userLanguage}function tn(){return(null==o?void 0:o.referrer)||"$direct"}function rn(e,t){var i=e?Pt([],Gr,t||[]):[],r=null==a?void 0:a.href.substring(0,1e3);return{r:tn().substring(0,1e3),u:r?Vi(r,i,Jr):void 0}}function nn(e){var t,{r:i,u:r}=e,n={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=Bi(i))?void 0:t.host};if(r){n.$current_url=r;var s=Bi(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=Zr(r);Ot(n,o)}if(i){var a=Qr(i);Ot(n,a)}return n}function sn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function on(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function an(t,i){if(!d)return{};var r,n,s,o=t?Pt([],Gr,i||[]):[],[l,c]=function(e){for(var t=0;t<We.length;t++){var[i,r]=We[t],n=i.exec(e),s=n&&(T(r)?r(n,e):r);if(s)return s}return["",""]}(d);return Ot(Rt({$os:l,$os_version:c,$browser:Ue(d,navigator.vendor),$device:Ve(d),$device_type:(n=d,s=Ve(n),s===re||s===ie||"Kobo"===s||"Kindle Fire"===s||s===Ce?te:s===Ee||s===Se||s===xe||s===Ae?"Console":s===se?"Wearable":s?Z:"Desktop"),$timezone:sn(),$timezone_offset:on()}),{$current_url:Vi(null==a?void 0:a.href,o,Jr),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:Be(d,navigator.vendor),$browser_language:en(),$browser_language_prefix:(r=en(),"string"==typeof r?r.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:h.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ln=bt("[FeatureFlags]"),cn=bt("[FeatureFlags]",{debugEnabled:!0}),un="$active_feature_flags",dn="$override_feature_flags",pn="$feature_flag_payloads",hn="$override_feature_flag_payloads",fn="$feature_flag_request_id",gn="$feature_flag_evaluated_at",_n=e=>{var t={};for(var[i,r]of It(e||{}))r&&(t[i]=r);return t},vn=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class mn{constructor(e){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this._instance=e,this.featureFlagEventHandlers=[]}St(){var e,t=null!==(e=this._instance.config.evaluation_contexts)&&void 0!==e?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(ln.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||ln.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}kt(){return this.St().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(ei),t=this._instance.get_property(dn),i=this._instance.get_property(hn);if(!i&&!t)return e||{};var r=Ot({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var s of n){var o,a,l=r[s],c=null==t?void 0:t[s],u=$(c)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!c,d=$(c)?l.variant:"string"==typeof c?c:void 0,p=null==i?void 0:i[s],h=_({},l,{enabled:u,variant:u?null!=d?d:null==l?void 0:l.variant:void 0});u!==(null==l?void 0:l.enabled)&&(h.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(h.original_variant=null==l?void 0:l.variant),p&&(h.metadata=_({},null==l?void 0:l.metadata,{payload:p,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[s]=h}return this._t||(ln.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this._t=!0),r}getFlagVariants(){var e=this._instance.get_property(Zt),t=this._instance.get_property(dn);if(!t)return e||{};for(var i=Ot({},e),r=Object.keys(t),n=0;n<r.length;n++)i[r[n]]=t[r[n]];return this._t||(ln.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._t=!0),i}getFlagPayloads(){var e=this._instance.get_property(pn),t=this._instance.get_property(hn);if(!t)return e||{};for(var i=Ot({},e||{}),r=Object.keys(t),n=0;n<r.length;n++)i[r[n]]=t[r[n]];return this._t||(ln.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this._t=!0),i}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Pt||(this._instance.Tt.emit("featureFlagsReloading",!0),this.Pt=setTimeout(()=>{this.It()},5))}Ct(){clearTimeout(this.Pt),this.Pt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Pt||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.wt=e}It(e){var t;if(this.Ct(),!this._instance.Rt())if(this.yt)this.xt=!0;else{var i=this._instance.config.token,r=this._instance.get_property("$device_id"),n={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(ti)||{}),group_properties:this._instance.get_property(ii),timezone:sn()};M(r)||$(r)||(n.$device_id=r),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0),this.kt()&&(n.evaluation_contexts=this.St());var s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+s);this.yt=!0,this._instance._send_request({method:"POST",url:o,data:n,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,s=!0;if(200===e.statusCode&&(this.xt||(this.$anon_distinct_id=void 0),s=!1),this.yt=!1,!n.disable_flags||this.xt){this.$t
1=!s;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push((e=>"api_error_"+e)(e.statusCode)),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes(vn.FeatureFlags));l&&o.push("quota_limited"),null==(r=this._instance.persistence)||r.register({[si]:o}),l?ln.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(n.disable_flags||this.receivedFeatureFlags(null!==(a=e.json)&&void 0!==a?a:{},s),this.xt&&(this.xt=!1,this.It()))}}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlagResult(e,t);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}ln.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants(),r=e in i,n=i[e],s=this.getFlagPayloads()[e],o=String(n),a=this._instance.get_property(fn)||void 0,l=this._instance.get_property(gn)||void 0,c=this._instance.get_property(ni)||{};if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(o))){var u,d,p,h,f,g,_,v,m,y;I(c[e])?c[e].push(o):c[e]=[o],null==(u=this._instance.persistence)||u.register({[ni]:c});var b=this.getFeatureFlagDetails(e),w=[...null!==(d=this._instance.get_property(si))&&void 0!==d?d:[]];$(n)&&w.push("flag_missing");var E={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this._instance.config.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(h=this._instance.config.bootstrap)||null==(h=h.featureFlagPayloads)?void 0:h[e])||null,$used_bootstrap_value:!this.$t};$(null==b||null==(f=b.metadata)?void 0:f.version)||(E.$feature_flag_version=b.metadata.version);var x,S=null!==(g=null==b||null==(_=b.reason)?void 0:_.description)&&void 0!==g?g:null==b||null==(v=b.reason)?void 0:v.code;S&&(E.$feature_flag_reason=S),null!=b&&null!=(m=b.metadata)&&m.id&&(E.$feature_flag_id=b.metadata.id),$(null==b?void 0:b.original_variant)&&$(null==b?void 0:b.original_enabled)||(E.$feature_flag_original_response=$(b.original_variant)?b.original_enabled:b.original_variant),null!=b&&null!=(y=b.metadata)&&y.original_payload&&(E.$feature_flag_original_payload=null==b||null==(x=b.metadata)?void 0:x.original_payload),w.length&&(E.$feature_flag_error=w.join(",")),this._instance.capture("$feature_flag_called",E)}if(r){var k=s;if(!$(s))try{k=JSON.parse(s)}catch(e){}return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k}}}else ln.warn('getFeatureFlagResult for key "'+e+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(e,t){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.kt()&&(r.evaluation_contexts=this.St()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this._instance.config.disable_compression?void 0:er.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var r,n=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return $(i)?void 0:!!i}ln.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.bt=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,r,n){void 0===i&&(i={}),void 0===r&&(r={}),void 0===n&&(n={});var s=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var i;return[e,null!==(i=t[e].variant)&&void 0!==i?i:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var i;return null==(i=t[e].metadata)?void 0:i.payload}).map(e=>{var i;return[e,null==(i=t[e].metadata)?void 0:i.payload]}))):ln.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),o=s.flags,a=s.featureFlags,l=s.featureFlagPayloads;if(a){var c=e.requestId,u=e.evaluatedAt;if(I(a)){ln.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(a)for(var p=0;p<a.length;p++)d[a[p]]=!0;t&&t.register({[un]:a,[Zt]:d})}else{var h=a,f=l,g=o;if(e.errorsWhileComputingFlags)if(o){var v=new Set(Object.keys(o).filter(e=>{var t;return!(null!=(t=o[e])&&t.failed)}));h=_({},i,Object.fromEntries(Object.entries(h).filter(e=>{var[t]=e;return v.has(t)}))),f=_({},r,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return v.has(t)}))),g=_({},n,Object.fromEntries(Object.entries(g||{}).filter(e=>{var[t]=e;return v.has(t)})))}else h=_({},i,h),f=_({},r,f),g=_({},n,g);t&&t.register(_({[un]:Object.keys(_n(h)),[Zt]:h||{}
vendor: 17,462 bytes, line 1
1,[pn]:f||{},[ei]:g||{}},c?{[fn]:c}:{},u?{[gn]:u}:{}))}}}(e,this._instance.persistence,i,r,n),this.Ft(t)}}override(e,t){void 0===t&&(t=!1),ln.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return ln.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(dn),this._instance.persistence.unregister(hn),this.Ft(),cn.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,i=e;if(this._t=Boolean(null!==(t=i.suppressWarning)&&void 0!==t&&t),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(dn),cn.info("Flag overrides cleared");else if(i.flags){if(I(i.flags)){for(var r={},n=0;n<i.flags.length;n++)r[i.flags[n]]=!0;this._instance.persistence.register({[dn]:r})}else this._instance.persistence.register({[dn]:i.flags});cn.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this._instance.persistence.unregister(hn),cn.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[hn]:i.payloads}),cn.info("Payload overrides set",{payloads:i.payloads}))),void this.Ft()}this.Ft()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.bt){var{flags:t,flagVariants:i}=this.Ot();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,n=(this._instance.get_property(Qt)||[]).find(t=>t.flagKey===e),s={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:s};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var a=_({},this.getFlagVariants(),{[e]:t});null==(r=this._instance.persistence)||r.register({[un]:Object.keys(_n(a)),[Zt]:a}),this.Ft()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this._instance.get_property(Qt),n=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:t=>{var i,r;if(t.json){var n=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(Qt),null==(r=this._instance.persistence)||r.register({[Qt]:n}),e(n)}}})}Ot(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}Ft(e){var{flags:t,flagVariants:i}=this.Ot();this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(ti)||{};this._instance.register({[ti]:_({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ti)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(ii)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=_({},i[t],e[t]),delete e[t]}),this._instance.register({[ii]:_({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(ii)||{};this._instance.register({[ii]:_({},t,{[e]:{}})})}else this._instance.unregister(ii)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Ct(),this._t=!1}}var yn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class bn{constructor(e,t){this.N=e,this.props={},this.Mt=!1,this.At=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.B=this.Dt(e),this.load(),e.debug&&yt.info("Persistence loaded",e.persistence,_({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.jt}Dt(t){-1===yn.indexOf(t.persistence.toLowerCase())&&(yt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var i=function(t){void 0===t&&(t=[]);var i=[...Ti,...t];return _({},Ii,{D:function(e){try{var t={};try{t=Oi.D(e)||{}}catch(e){}var i=Ot(t,JSON.parse(Ii.A(e)||"{}"));return Ii.j(e,i),i}catch(e){}return null},j:function(e,t,r,n,s,o){try{Ii.j(e,t,void 0,void 0,o);var a={};i.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&Oi.j(e,a,r,n,s,o)}catch(e){Ii.M(e)}},L:function(t,i){try{null==e||e.localStorage.removeItem(t),Oi.L(t,i)}catch(e){Ii.M(e)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return"localstorage"===r&&Ii.O()?Ii:"localstorage+cookie"===r&&i.O()?i:"sessionstorage"===r&&Ci.O()?Ci:"memory"===r?Ri:"cookie"===r?Oi:i.O()?i:Oi}properties(){var e={};return kt(this.props,function(t,i){if(i===Zt&&A(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/"+r[s]]=t[r[s]];else a=i,l=!1,(M(o=gi)?l:n&&o.indexOf===n?-1!=o.indexOf(a):(kt(o,function(e){if(l||(l=e===a))return xt}),l))||(e[i]=t);var o,a,l}),e}load(){if(!this.jt){var e=this.B.D(this.At);e&&(this.props=Ot({},e))}}save(){this.jt||this.B.j(this.At,this.props,this.Lt,this.Nt,this.Ut,this.N.debug)}remove(){this.B.L(this.At,!1),this.B.L(this.At,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(A(e)){$(t)&&(t="None"),this.Lt=$(i)?this.zt:i;var r=!1;if(kt(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(A(e)){this.Lt=$(t)?this.zt:t;var i=!1;if(kt(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Mt){var e=Xr(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);R(Rt(e))||this.register(e),this.Mt=!0}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?Qr(e):{})}update_referrer_info(){var e;this.register_once({$referrer:tn(),$referring_domain:null!=o&&o.referrer&&(null==(e=Bi(o.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ci]||this.props[ui]||this.register_once({[di]:rn(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};kt([ui,ci],t=>{var i=this.props[t];i&&kt(i,function(t,i){e["$initial_"+x(i)]=t})});var t,i,r=this.props[di];if(r){var n=(t=nn(r),i={},kt(t,function(e,t){i["$initial_"+x(t)]=e}),i);Ot(e,n)}return e}safe_merge(e){return kt(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.zt=this.Lt=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.Dt(e),n=this.props;this.clear(),this.B=r,this.props=n,this.save()}}set_disabled(e){this.jt=e,this.jt?this.remove():this.save()}set_cross_subdomain(e){e!==this.Nt&&(this.Nt=e,this.remove(),this.save())}set_secure(e){e!==this.Ut&&(this.Ut=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[Lt]||{};i[e]=t,this.props[Lt]=i,this.save()}remove_event_timer(e){var t=(this.props[Lt]||{})[e];return $(t)||(delete this.props[Lt][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var wn=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),En=(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}({}),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}({}),function(e){e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom"}({}),function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({})),xn=(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}({}),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}({}),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}({}),function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({})),Sn=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),kn=function(e){return e.Popover="popover",e.Inline="inline",e}({}),On=bt("[Surveys]"),Pn="seenSurvey_",In=(e,t)=>{var i="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(i="$survey_"+t+"/"+e.id+"/"+e.current_iteration),i},Tn=e=>((e,t)=>{var i=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(i=""+e+t.id+"_"+t.current_iteration),i})(Pn,e),An=[En.Popover,En.Widget,En.API],Rn={ignoreConditions:!1,ignoreDelay:!1,displayType:kn.Popover};class $n{constructor(){this.Ht={},this.Ht={}}on(e,t){return this.Ht[e]||(this.Ht[e]=[]),this.Ht[e].push(t),()=>{this.Ht[e]=this.Ht[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Ht[e]||[])i(t);for(var r of this.Ht["*"]||[])r(e,t)}}function Cn(e,t,i){if(j(e))return!1;switch(i){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class Fn{constructor(e){this.Bt=new $n,this.qt=(e,t)=>this.Wt(e,t)&&this.Gt(e,t)&&this.Vt(e,t)&&this.Jt(e,t),this.Wt=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Kt=new Set,this.Yt=new Set}init(){var e,t;$(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!$(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.Yt)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Kt)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,n=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(n)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Kt.has(e)||this.Kt.has(null==t?void 0:t.event))&&this.Yt&&(null==(i=this.Yt)?void 0:i.size)>0&&this.Yt.forEach(e=>{this.Xt(t,e)&&this.Bt.emit("actionCaptured",e.name)})}Qt(e){this.onAction("actionCaptured",t=>e(t))}Xt(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.qt(e,i))return!0;return!1}onAction(e,t){return this.Bt.on(e,t)}Gt(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Cn(r,t.url,t.url_matching||"contains"))return!1}return!0}Vt(e,t){return!!this.Zt(e,t)&&!!this.ti(e,t)&&!!this.ii(e,t)}Zt(e,t){var i;if(null==t||!t.href)return!0;var r=this.ei(e);if(r.length>0)return r.some(e=>Cn(e.href,t.href,t.href_matching||"exact"));var n,s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!s&&Cn((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}ti(e,t){var i;if(null==t||!t.text)return!0;var r=this.ei(e);if(r.length>0)return r.some(e=>Cn(e.text,t.text,t.text_matching||"exact")||Cn(e.$el_text,t.text,t.text_matching||"exact"));var n,s,o,a=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!j(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),s=t.text,o=t.text_matching||"exact",n.some(e=>Cn(e,s,o)))}ii(e,t){var i,r;if(null==t||!t.selector)return!0;var n=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}ei(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Jt(e,t){return null==t||!t.properties||0===t.properties.length||zr(t.properties.reduce((e,t)=>{var i=I(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class Mn{constructor(e){this._instance=e,this.ri=new Map,this.si=new Map,this.ni=new Map}oi(e,t){return!!e&&zr(e.propertyFilters,null==t?void 0:t.properties)}ai(e,t){var i=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}li(e,t,i){var r=(i===wn.Activation?this.ri:this.si).get(e),n=[];return this.ui(e=>{n=e.filter(e=>null==r?void 0:r.includes(e.id))}),n.filter(r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find(t=>t.name===e);return this.oi(s,t)})}register(e){var t;$(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.hi(e),this.di(e))}di(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.vi&&(this.vi=new Fn(this._instance),this.vi.init(),this.vi.Qt(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(n=this.vi)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach(t=>{if(t&&t.name){var i=this.ni.get(t.name);i&&i.push(e.id),this.ni.set(t.name,i||[e.id])}}))}))}hi(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});0===i.length&&0===r.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.ri=this.ai(e,wn.Activation),this.si=this.ai(e,wn.Cancellation))}onEvent(e,t){var i,r=this.ci(),n=this.fi(),s=this.pi(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[n])||[];if(s===e&&t&&o.length>0){var a,l;r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var c=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(c){var u=o.indexOf(c);u>=0&&(o.splice(u,1),this.gi(o))}}else{if(this.si.has(e)){var d=this.li(e,t,wn.Cancellation);d.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map(e=>e.id)}),d.forEach(e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this.mi(e.id)}),this.gi(o))}if(this.ri.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.ri.get(e)});var p=this.li(e,t,wn.Activation);this.gi(o.concat(p.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.fi(),r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.ni.has(e)&&this.gi(r.concat(this.ni.get(e)||[]))}gi(e){var t,i=this.ci(),r=this.fi(),n=[...new Set(e)].filter(e=>!this.bi(e));i.info("updating activated items",{activatedItems:n}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[r]:n})}getActivatedIds(){var e,t=this.fi();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.ri}yi(){return this.vi}}class jn extends Mn{constructor(e){super(e)}fi(){return"$surveys_activated"}pi(){return xn.SHOWN}ui(e){var t;null==(t=this._instance)||t.getSurveys(e)}mi(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}ci(){return On}bi(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Nn{constructor(e){this.wi=void 0,this._surveyManager=null,this.xi=!1,this.$i=[],this.Ei=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(j(t))return On.warn("Flags not loaded yet. Not loading surveys.");var i=I(t);this.wi=i?t.length>0:t,On.info("flags response received, isSurveysEnabled: "+this.wi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(Pn)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}
1e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.xi)On.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)On.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())On.info("Not loading surveys in cookieless mode without consent.");else{var e=null==p?void 0:p.__PosthogExtensions__;if(e){if(!$(this.wi)||this._instance.config.advanced_enable_surveys){var t=this.wi||this._instance.config.advanced_enable_surveys;this.xi=!0;try{var i=e.generateSurveys;if(i)return void this.Si(i,t);var r=e.loadExternalDependency;if(!r)return void this.ki("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.ki("Could not load surveys script",i):this.Si(e.generateSurveys,t)})}catch(e){throw this.ki("Error initializing surveys",e),e}finally{this.xi=!1}}}else On.error("PostHog Extensions not found.")}}Si(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new jn(this._instance),On.info("Surveys loaded successfully"),this.Pi({isLoaded:!0})}ki(e,t){On.error(e,t),this.Pi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$i.push(e),this._surveyManager&&this.Pi({isLoaded:!0}),()=>{this.$i=this.$i.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return On.info("Disabled. Not loading surveys."),e([]);var i,r=this._instance.get_property(ri);if(r&&!t)return e(r,{isLoaded:!0});"undefined"!=typeof Promise&&this.Ei?this.Ei.then(t=>{var{surveys:i,context:r}=t;return e(i,r)}):("undefined"!=typeof Promise&&(this.Ei=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var r;this.Ei=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;On.error(s);var o={isLoaded:!1,error:s};return e([],o),void(null==i||i({surveys:[],context:o}))}var a,l=t.json.surveys||[],c=l.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e)));c.length>0&&(null==(a=this._surveyEventReceiver)||a.register(c)),null==(r=this._instance.persistence)||r.register({[ri]:l});var u={isLoaded:!0};e(l,u),null==i||i({surveys:l,context:u})}}))}Pi(e){for(var t of this.$i)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){On.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!j(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);On.warn("init was not called")}Ti(e){var t=null;return this.getSurveys(i=>{var r;t=null!==(r=i.find(t=>t.id===e))&&void 0!==r?r:null}),t}Ii(e){if(j(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.Ti(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(j(this._surveyManager))return On.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.Ii(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return j(this._surveyManager)?(On.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var r,n=null!==(r=t.find(t=>t.id===e))&&void 0!==r?r:null;if(n){var s=this.Ii(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(j(this._surveyManager))On.warn("init was not called");else{var n="string"==typeof e?this.Ti(e):e;
1if(null!=n&&n.id)if(An.includes(n.type)){var s=null==o?void 0:o.querySelector(t);if(s)return null!=(r=n.appearance)&&r.surveyPopupDelaySeconds?(On.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;On.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,i),On.info("Survey "+n.id+" rendered")},1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,i);On.warn("Survey element not found")}else On.warn("Surveys of type "+n.type+" cannot be rendered in the app");else On.warn("Survey not found")}}displaySurvey(e,t){var i;if(j(this._surveyManager))On.warn("init was not called");else{var r=this.Ti(e);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=_({},r,{appearance:_({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==kn.Popover&&t.initialResponses&&On.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this.canRenderSurvey(r);if(!s.visible)return void On.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==kn.Inline?this._surveyManager.handlePopoverSurvey(n,t):this.renderSurvey(n,t.selector,t.properties)}else On.warn("Survey not found")}}cancelPendingSurvey(e){j(this._surveyManager)?On.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var Dn=bt("[Conversations]");class Ln{constructor(e){this.Ci=void 0,this._conversationsManager=null,this.Ri=!1,this.Fi=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;j(t)||(L(t)?this.Ci=t:(this.Ci=t.enabled,this.Fi=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ci=void 0,this.Fi=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ri||this._instance.config.disable_conversations||jt(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==p?void 0:p.__PosthogExtensions__;if(e&&!$(this.Ci)&&this.Ci)if(this.Fi&&this.Fi.token){this.Ri=!0;try{var t=e.initConversations;if(t)return this.Oi(t),void(this.Ri=!1);var i=e.loadExternalDependency;if(!i)return void this.Mi("PostHog loadExternalDependency extension not found.");i(this._instance,"conversations",t=>{t||!e.initConversations?this.Mi("Could not load conversations script",t):this.Oi(e.initConversations),this.Ri=!1})}catch(e){this.Mi("Error initializing conversations",e),this.Ri=!1}}else Dn.error("Conversations enabled but missing token in remote config.")}}Oi(e){if(this.Fi)try{this._conversationsManager=e(this.Fi,this._instance),Dn.info("Conversations loaded successfully")}catch(e){this.Mi("Error completing conversations initialization",e)}else Dn.error("Cannot complete initialization: remote config is null")}Mi(e,t){Dn.error(e,t),this._conversationsManager=null,this.Ri=!1}show(){this._conversationsManager?this._conversationsManager.show():Dn.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ci&&!M(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,t,i){var r=this;return g(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(Dn.warn("Conversations not available yet."),null)})()}getMessages(e,t){var i=this;return g(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(Dn.warn("Conversations not available yet."),null)})()}markAsRead(e){var t=this;return g(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Dn.warn("Conversations not available yet."),null)})()}getTickets(e){var t=this;return g(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Dn.warn("Conversations not available yet."),null)})()}requestRestoreLink(e){var t=this;return g(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Dn.warn("Conversations not available yet."),null)})()}restoreFromToken(e){var t=this;return g(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Dn.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var e=this;return g(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Dn.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}}var Hn=function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e}({}),qn=function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e}({});class Un{constructor(e){var t;this.Ai=!1,this.Di=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Ai=!0)}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!j(i)&&i&&(this.Ai=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ai&&!this.Di){var e=bt("[logs]"),t=null==p?void 0:p.__PosthogExtensions__;if(t){var i=t.loadExternalDependency;i?i(this._instance,"logs",i=>{var r;i||null==(r=t.logs)||!r.initializeLogs?e.error("Could not load logs script",i):(t.logs.initializeLogs(this._instance),this.Di=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var zn=bt("[RateLimiter]");class Bn{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
vendor: 85,583 bytes, line 1
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{zn.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void zn.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,i,r;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(li))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=a.tokens<1;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(li,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Wn=bt("[RemoteConfig]");class Vn{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}ji(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Li(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return Wn.info("Using preloaded remote config",this.remoteConfig),this.Ni(this.remoteConfig),void this.Ui();if(this._instance.Rt())return void Wn.warn("Remote config is disabled. Falling back to local config.");this.ji(e=>{if(!e)return Wn.info("No config found after loading remote JS config. Falling back to JSON."),void this.Li(e=>{this.Ni(e),this.Ui()});this.Ni(e),this.Ui()})}catch(e){Wn.error("Error loading remote config",e)}}stop(){this.zi&&(clearInterval(this.zi),this.zi=void 0)}refresh(){this._instance.Rt()||"hidden"===(null==o?void 0:o.visibilityState)||this._instance.featureFlags.reloadFeatureFlags()}Ui(){this.zi||(this.zi=setInterval(()=>{this.refresh()},3e5))}Ni(e){e||Wn.error("Failed to fetch remote config from PostHog."),this._instance.Ni(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Gn=3e3;class Yn{constructor(e,t){this.Hi=!0,this.Bi=[],this.qi=G((null==t?void 0:t.flush_interval_ms)||Gn,250,5e3,yt.createLogger("flush interval"),Gn),this.Wi=e}enqueue(e){this.Bi.push(e),this.Gi||this.Vi()}unload(){this.Ji();var e=this.Bi.length>0?this.Ki():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Wi(_({},e,{transport:"sendBeacon"}))})}enable(){this.Hi=!1,this.Vi()}Vi(){var e=this;this.Hi||(this.Gi=setTimeout(()=>{if(this.Ji(),this.Bi.length>0){var t=this.Ki(),i=function(){var i=t[r],n=(new Date).getTime();i.data&&I(i.data)&&kt(i.data,e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp}),e.Wi(i)};for(var r in t)i()}},this.qi))}Ji(){clearTimeout(this.Gi),this.Gi=void 0}Ki(){var e={};return kt(this.Bi,t=>{var i,r=t,n=(r?r.batchKey:null)||r.url;$(e[n])&&(e[n]=_({},r,{data:[]})),null==(i=e[n].data)||i.push(r.data)}),this.Bi=[],e}}var Jn=["retriesPerformedSoFar"];class Kn{constructor(t){this.Yi=!1,this.Xi=3e3,this.Bi=[],this._instance=t,this.Bi=[],this.Qi=!0,!$(e)&&"onLine"in e.navigator&&(this.Qi=e.navigator.onLine,this.Zi=()=>{this.Qi=!0,this.te()},this.ie=()=>{this.Qi=!1},Mt(e,"online",this.Zi),Mt(e,"offline",this.ie))}get length(){return this.Bi.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=v(e,Jn);D(t)&&(i.url=Mr(i.url,{retry_count:t})),this._instance._send_request(_({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.ee(_({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}ee(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,r=Math.min(18e5,t),n=(Math.random()-.5)*(r-i);return Math.ceil(r+n)}(t),r=Date.now()+i;this.Bi.push({retryAt:r,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),yt.warn(n),this.Yi||(this.Yi=!0,this.re())}re(){if(this.se&&clearTimeout(this.se),0===this.Bi.length)return this.Yi=!1,void(this.se=void 0);this.se=setTimeout(()=>{this.Qi&&this.Bi.length>0&&this.te(),this.re()},this.Xi)}te(){var e=Date.now(),t=[],i=this.Bi.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.Bi=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.se&&(clearTimeout(this.se),this.se=void 0),this.Yi=!1,$(e)||(this.Zi&&(e.removeEventListener("online",this.Zi),this.Zi=void 0),this.ie&&(e.removeEventListener("offline",this.ie),this.ie=void 0)),this.Bi))try{this._instance._send_request(_({},t,{transport:"sendBeacon"}))}catch(e){yt.error(e)}this.Bi=[]}}class Xn{constructor(e){this.ne=()=>{var e,t,i,r;this.oe||(this.oe={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.oe.lastScrollY=Math.ceil(s),this.oe.maxScrollY=Math.max(s,null!==(e=this.oe.maxScrollY)&&void 0!==e?e:0),this.oe.maxScrollHeight=Math.max(o,null!==(t=this.oe.maxScrollHeight)&&void 0!==t?t:0),this.oe.lastContentY=a,this.oe.maxContentY=Math.max(a,null!==(i=this.oe.maxContentY)&&void 0!==i?i:0),this.oe.maxContentHeight=Math.max(l,null!==(r=this.oe.maxContentHeight)&&void 0!==r?r:0)},this._instance=e}getContext(){return this.oe}resetContext(){var e=this.oe;return setTimeout(this.ne,0),e}startMeasuringScrollPosition(){Mt(e,"scroll",this.ne,{capture:!0}),Mt(e,"scrollend",this.ne,{capture:!0}),Mt(e,"resize",this.ne)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==e?void 0:e.document.documentElement;var t=I(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var i of t){var r=null==e?void 0:e.document.querySelector(i);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return e&&(e.scrollY||e.pageYOffset||e.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return e&&(e.scrollX||e.pageXOffset||e.document.documentElement.scrollLeft)||0}}var Zn=e=>rn(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class Qn{constructor(e,t,i,r){this.ae=e=>{var t=this.le();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.ue(this._instance)};this.he.register({[ai]:i})}},this._instance=e,this.de=t,this.he=i,this.ue=r||Zn,this.de.onSessionId(this.ae)}le(){return this.he.props[ai]}getSetOnceProps(){var e,t=null==(e=this.le())?void 0:e.props;return t?"r"in t?nn(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return kt(Rt(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+x(i)]=t}),e}}var es=bt("[SessionId]");class ts{on(e,t){return this.ve.on(e,t)}constructor(e,t,i){var r;if(this.ce=[],this.fe=void 0,this.ve=new $n,this.pe=(e,t)=>!(!D(e)||!D(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=e.config,this.he=e.persistence,this._e=void 0,this.ge=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.me=t||Ei,this.be=i||Ei;var n=this.N.persistence_name||this.N.token,s=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*G(s,60,36e3,es.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ye(),this.we="ph_"+n+"_window_id",this.xe="ph_"+n+"_primary_window_exists",this.$e()){var o=Ci.D(this.we),a=Ci.D(this.xe);o&&!a?this._e=o:Ci.L(this.we),Ci.j(this.xe,!0)}if(null!=(r=this.N.bootstrap)&&r.sessionID)try{var l=(()=>{var e=this.N.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.Ee(this.N.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){es.error("Invalid sessionID in bootstrap",e)}this.Se()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return $(this.ce)&&(this.ce=[]),this.ce.push(e),this.ge&&e(this.ge,this._e),()=>{this.ce=this.ce.filter(t=>t!==e)}}$e(){return"memory"!==this.N.persistence&&!this.he.jt&&Ci.O()}ke(e){e!==this._e&&(this._e=e,this.$e()&&Ci.j(this.we,e))}Pe(){return this._e?this._e:this.$e()?Ci.D(this.we):null}Ee(e,t,i){e===this.ge&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.ge=e,this.he.register({[Kt]:[t,e,i]}))}Te(){var e=this.he.props[Kt];return I(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ee(null,null,null)}destroy(){clearTimeout(this.Ie),this.Ie=void 0,this.fe&&e&&(e.removeEventListener("beforeunload",this.fe,{capture:!1}),this.fe=void 0),this.ce=[]}Se(){this.fe=()=>{this.$e()&&Ci.L(this.xe)},Mt(e,"beforeunload",this.fe,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.N.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[r,n,s]=this.Te(),o=this.Pe(),a=D(s)&&Math.abs(i-s)>864e5,l=!1,c=!n,u=!c&&!e&&this.pe(i,r);c||u||a?(n=this.me(),o=this.be(),es.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),s=i,l=!0):o||(o=this.be(),l=!0);var d=D(r)&&e&&!a?r:i,p=D(s)?s:(new Date).getTime();return this.ke(o),this.Ee(n,d,p),e||this.ye(),l&&this.ce.forEach(e=>e(n,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:r}}ye(){clearTimeout(this.Ie),this.Ie=setTimeout(()=>{var[e]=this.Te();if(this.pe((new Date).getTime(),e)){var t=this.ge;this.resetSessionId(),this.ve.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var is=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&b(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>b(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},rs=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),ns="i.posthog.com";class ss{constructor(e){this.Ce={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+ns,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ce[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=rs.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=rs.EU:this.Ce[this.apiHost]=rs.CUSTOM),this.Ce[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===rs.CUSTOM)return this.apiHost+t;var i=ns+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var os={icontains:(t,i)=>!!e&&i.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,i)=>!!e&&-1===i.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,i)=>!!e&&Lr(i.href,t),not_regex:(t,i)=>!!e&&!Lr(i.href,t),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class as{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{as.Re("retrieved web experiments from the server"),t.Fe=new Map,e.forEach(e=>{if(e.feature_flag_key){var i;t.Fe&&(as.Re("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Fe)||i.set(e.feature_flag_key,e));var r=t._instance.getFeatureFlag(e.feature_flag_key);C(r)&&e.variants[r]&&t.Oe(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];as.Me(s)&&t.Oe(e.name,n,s.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())as.Re("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(j(this.Fe))return this.Fe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();as.Re("applying feature flags",e),e.forEach(e=>{var t;if(this.Fe&&null!=(t=this.Fe)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),n=null==(i=this.Fe)?void 0:i.get(e);r&&null!=n&&n.variants[r]&&this.Oe(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=as.getWindowLocation();if(null!=e&&e.search){var t=Wi(null==e?void 0:e.search,"__experiment_id"),i=Wi(null==e?void 0:e.search,"__experiment_variant");t&&i&&(as.Re("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Ae(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var i=t.json.experiments||[];return e(i)}})}Ae(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(as.Re("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Oe(r[0].name,t,r[0].variants[t].transforms))}static Me(e){return!j(e.conditions)&&as.De(e)&&as.je(e)}static De(e){var t;if(j(e.conditions)||j(null==(t=e.conditions)?void 0:t.url))return!0;var i,r,n,s=as.getWindowLocation();return!!s&&(null==(i=e.conditions)||!i.url||os[null!==(r=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==e?void 0:e.location}static je(e){var t;if(j(e.conditions)||j(null==(t=e.conditions)?void 0:t.utm))return!0;var i=Xr();if(i.utm_source){var r,n,s,o,a,l,c,u,d=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,p=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,h=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==i.utm_term;return d&&h&&f&&p}return!1}static Re(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];yt.info("[WebExperiments] "+e,i)}Oe(e,t,i){this._is_bot()?as.Re("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){var r;as.Re("applying transform of variant "+t+" for experiment "+e+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach(e=>{var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)})}}):as.Re("Control variants leave the page unmodified.")}_is_bot(){return s&&this._instance?is(s,this._instance.config.custom_blocked_useragents):void 0}}var ls=bt("[PostHog ExternalIntegrations]"),cs={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class us{constructor(e){this._instance=e}V(e,t){var i;null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ls.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e=this,t=function(t){var i,n,s;!r||null!=(i=p.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[t]||e.V(cs[t],()=>{var i;null==(i=p.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[t])||i.start(e._instance)}),!r&&null!=(n=p.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]&&(null==(s=p.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[t])||s.stop())};for(var[i,r]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(i)}}}var ds={},ps=0,hs=()=>{},fs="posthog",gs=!Cr&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),_s=t=>{var i;return _({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ct(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:hs,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:a&&C(null==a?void 0:a.search)&&-1!==a.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==e||null==(i=e.location)?void 0:i.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;yt.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Gn},error_tracking:{},_onCapture:hs,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},vs=e=>{var t={};$(e.process_person)||(t.person_profiles=e.process_person),$(e.xhr_headers)||(t.request_headers=e.xhr_headers),$(e.cookie_name)||(t.persistence_name=e.cookie_name),$(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),$(e.store_google)||(t.save_campaign_params=e.store_google),$(e.verbose)||(t.debug=e.verbose);var i=Ot({},t,e);return I(e.property_blacklist)&&($(e.property_denylist)?i.property_denylist=e.property_blacklist:I(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:yt.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class ms{constructor(){this.__forceAllowLocalhost=!1}get Le(){return this.__forceAllowLocalhost}set Le(e){yt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ys{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new ms,this.Ne=!1,this.version=h.LIB_VERSION,this.Tt=new $n,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=_s(),this.SentryIntegration=zi,this.sentryIntegration=e=>function(e,t){var i=Ui(e,t);return{name:qi,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ue=!1,this.ze=null,this.He=null,this.Be=null,this.featureFlags=new mn(this),this.toolbar=new Zi(this),this.scrollManager=new Xn(this),this.pageViewManager=new Qi(this),this.surveys=new Nn(this),this.conversations=new Ln(this),this.logs=new Un(this),this.experiments=new as(this),this.exceptions=new Wr(this),this.rateLimiter=new Bn(this),this.requestRouter=new ss(this),this.consent=new Mi(this),this.externalIntegrations=new us(this),this.people={set:(e,t,i)=>{var r=C(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=C(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>yt.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==fs){var r,n=null!==(r=ds[i])&&void 0!==r?r:new ys;return n._init(e,t,i),ds[i]=n,ds[fs][i]=n,n}return this._init(e,t,i)}_init(t,i,r){var n;if(void 0===i&&(i={}),$(t)||F(t))return yt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},i.debug=this.qe(i.debug),this.We=i,this.Ge=[],i.person_profiles?this.He=i.person_profiles:i.process_person&&(this.He=i.process_person),this.set_config(Ot({},_s(i.defaults),vs(i),{name:r,token:t})),this.config.on_xhr_error&&yt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:er.GZipJS;var s=this.Ve();this.persistence=new bn(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new bn(_({},this.config,{persistence:"sessionStorage"}),s);var o=_({},this.persistence.props),a=_({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Je=new Yn(e=>this.Ke(e),this.config.request_queue_config),this.Ye=new Kn(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new ts(this),this.sessionPropsManager=new Qn(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(yt.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Xe(l)},0)):(yt.info("Initializing extensions synchronously"),this.Xe(l)),h.DEBUG=h.DEBUG||this.config.debug,h.DEBUG&&yt.info("Starting in debug mode",{this:this,config:i,thisC:_({},this.config),p:o,s:a}),void 0!==(null==(n=i.bootstrap)?void 0:n.distinctID)){var c,u,d=this.config.get_device_id(Ei()),p=null!=(c=i.bootstrap)&&c.isIdentifiedID?d:i.bootstrap.distinctID;this.persistence.set_property(oi,null!=(u=i.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:p})}if(this.Qe()){var f,g,v=Object.keys((null==(f=i.bootstrap)?void 0:f.featureFlags)||{}).filter(e=>{var t;return!(null==(t=i.bootstrap)||null==(t=t.featureFlags)||!t[e])}).reduce((e,t)=>{var r;return e[t]=(null==(r=i.bootstrap)||null==(r=r.featureFlags)?void 0:r[t])||!1,e},{}),m=Object.keys((null==(g=i.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>v[e]).reduce((e,t)=>{var r,n;return null!=(r=i.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[t]&&(e[t]=null==(n=i.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:m})}if(l)this.register_once({distinct_id:fi,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(Ei());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(oi,"anonymous")}return Mt(e,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||Ei();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(oi,"identified")),t()},n=i.user();"then"in n&&T(n.then)?n.then(r):r(n)}(e,()=>{i.register((e=>{Promise&&Promise.resolve||Hi.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Hi.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Hi.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.Ze()):this.Ze(),T(this.config._onCapture)&&this.config._onCapture!==hs&&(yt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&yt.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Xe(e){var t=performance.now(),i=_({},ys.__defaultExtensionClasses,this.config.__extensionClasses);i.historyAutocapture&&(this.historyAutocapture=new i.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var r=[];i.tracingHeaders&&r.push(()=>{new i.tracingHeaders(this).startIfEnabledOrStop()}),i.siteApps&&r.push(()=>{var e;this.siteApps=new i.siteApps(this),null==(e=this.siteApps)||e.init()}),!e&&i.sessionRecording&&r.push(()=>{this.sessionRecording=new i.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||r.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.autocapture&&r.push(()=>{this.autocapture=new i.autocapture(this),this.autocapture.startIfEnabled()}),r.push(()=>{this.surveys.loadIfEnabled()}),r.push(()=>{this.logs.loadIfEnabled()}),r.push(()=>{this.conversations.loadIfEnabled()}),i.productTours&&r.push(()=>{this.productTours=new i.productTours(this),this.productTours.loadIfEnabled()}),i.heatmaps&&r.push(()=>{this.heatmaps=new i.heatmaps(this),this.heatmaps.startIfEnabled()}),i.webVitalsAutocapture&&r.push(()=>{this.webVitalsAutocapture=new i.webVitalsAutocapture(this)}),i.exceptionObserver&&r.push(()=>{this.exceptionObserver=new i.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()}),i.deadClicksAutocapture&&r.push(()=>{this.deadClicksAutocapture=new i.deadClicksAutocapture(this,Di),this.deadClicksAutocapture.startIfEnabledOrStop()}),r.push(()=>{if(this.tr){var e=this.tr;this.tr=void 0,this.Ni(e)}}),this.ir(r,t)}ir(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.ir(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){yt.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&yt.info("PostHog extensions initialized ("+r+"ms)")}Ni(e){var t,i,r,n,s,a,l,c,u;if(!o||!o.body)return yt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ni(e)},500);this.config.__preview_deferred_init_extensions&&(this.tr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=w(e.supportedCompression,er.GZipJS)?er.GZipJS:w(e.supportedCompression,er.Base64)?er.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.He?this.He:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(s=this.heatmaps)||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(a=this.productTours)||a.onRemoteConfig(e),null==(l=this.webVitalsAutocapture)||l.onRemoteConfig(e),null==(c=this.exceptionObserver)||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)}Ze(){try{this.config.loaded(this)}catch(e){yt.critical("`loaded` function failed",e)}if(this.er(),this.config.internal_or_test_user_hostname&&null!=a&&a.hostname){var e=a.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.rr()},1),this.sr=new Vn(this),this.sr.load()}er(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Je)||e.enable())}_dom_loaded(){this.is_capturing()&&St(this.__request_queue,e=>this.Ke(e)),this.__request_queue=[],this.er()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this.nr()&&this.capture("$pageleave"),null==(e=this.Je)||e.unload(),null==(t=this.Ye)||t.unload()):this.nr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(gs?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Mr(e.url,{ip:this.config.ip?1:0}),e.headers=_({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,n=_({},e);n.timeout=n.timeout||6e4,n.url=Mr(n.url,{_:(new Date).getTime().toString(),ver:h.LIB_VERSION,compression:n.compression});var s=null!==(t=n.transport)&&void 0!==t?t:"fetch",o=Dr.filter(e=>!n.disableTransport||!e.transport||!n.disableTransport.includes(e.transport)),a=null!==(i=null==(r=Ft(o,e=>e.transport===s))?void 0:r.method)&&void 0!==i?i:o[0].method;if(!a)throw new Error("No available transport method");a(n)})(_({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(r=this.config).on_request_error)||i.call(r,t)),null==e.callback||e.callback(t)}}))))}Ke(e){this.Ye?this.Ye.retriableRequest(e):this._send_request(e)}_execute_array(e){ps++;try{var t,i=[],r=[],n=[];St(e,e=>{e&&(t=e[0],I(t)?n.push(e):T(e)?e.call(this):I(e)&&"alias"===t?i.push(e):I(e)&&-1!==t.indexOf("capture")&&T(this[t])?n.push(e):r.push(e))});var s=function(e,t){St(e,function(e){if(I(e[0])){var i=t;kt(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};s(i,this),s(r,this),s(n,this)}finally{ps--}}Qe(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){if(ps>0&&I(e)&&C(e[0])){var t=ys.prototype[e[0]];T(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Je){if(this.is_capturing())if(!$(e)&&C(e)){var n=!this.config.opt_out_useragent_filter&&this._is_bot();if(!n||this.config.__preview_capture_bot_pageviews){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){null!=t&&t.$current_url&&!C(null==t?void 0:t.$current_url)&&(yt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.ft||yt.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=(null==i?void 0:i.timestamp)||o,l=Ei(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},a,l)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&n&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),s&&(c.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var u,d="$groupidentify"!==e,p=this.ar(null==i?void 0:i.$set_once,d);if(p&&(c.$set_once=p),(c=function(e,t){return i=e,r=e=>C(e)&&!M(t)?e.slice(0,t):e,n=new Set,function e(t,i){return t!==Object(t)?r?r(t):t:n.has(t)?void 0:(n.add(t),I(t)?(s=[],St(t,t=>{s.push(e(t))})):(s={},kt(t,(t,i)=>{n.has(t)||(s[i]=e(t))})),s);var s}(i);var i,r,n}(c,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,$(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=o),e===xn.DISMISSED||e===xn.SENT){var h=null==t?void 0:t[Sn.SURVEY_ID],f=null==t?void 0:t[Sn.SURVEY_ITERATION];u={id:h,current_iteration:f},localStorage.getItem(Tn(u))||localStorage.setItem(Tn(u),"true"),c.$set=_({},c.$set,{[In({id:h,current_iteration:f},e===xn.SENT?"responded":"dismissed")]:!0})}else e===xn.SHOWN&&(c.$set=_({},c.$set,{[Sn.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===Hn.SHOWN){var g=null==t?void 0:t[qn.TOUR_TYPE];g&&(c.$set=_({},c.$set,{[qn.TOUR_LAST_SEEN_DATE+"/"+g]:(new Date).toISOString()}))}var v=_({},c.properties.$set,c.$set);if(R(v)||this.setPersonPropertiesForFlags(v),!j(this.config.before_send)){var m=this.lr(c);if(!m)return;c=m}this.Tt.emit("eventCaptured",c);var y={method:"POST",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Ke(y):this.Je.enqueue(y),c}yt.critical("This capture call is ignored due to client rate limiting.")}}else yt.error("No event name provided to posthog.capture")}else yt.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var s=n?void 0:this.persistence.remove_event_timer(e),a=_({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=_({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!C(a.distinct_id)&&!N(a.distinct_id)||F(a.distinct_id))&&yt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=an(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());a.$session_id=p,a.$window_id=h}this.sessionPropsManager&&Ot(a,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&Ot(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(f=this.Ye)?void 0:f.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===rs.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),a=Ot(a,c),"$pageview"===e&&o&&(a.title=o.title),!$(s)){var g=i.getTime()-s;a.$duration=parseFloat((g/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Ot({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),I(this.config.property_denylist)?kt(this.config.property_denylist,function(e){delete a[e]}):yt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;v&&(yt.error("sanitize_properties is deprecated. Use before_send instead"),a=v(a,e));var m=this.ur();return a.$process_person_profile=m,m&&!n&&this.hr("_calculate_event_properties"),a}ar(e,t){var i;if(void 0===t&&(t=!0),!this.persistence||!this.ur())return e;if(this.Ne)return e;var r=this.persistence.get_initial_props(),n=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),s=Ot({},r,n||{},e||{}),o=this.config.sanitize_properties;return o&&(yt.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),t&&(this.Ne=!0),R(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}dr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var r=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},n=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},s=_({},r,e),o=_({},n,t),a={};for(var[l,c]of Object.entries(s)){var u="string"==typeof c;a[l]={key:l,enabled:!!u||Boolean(c),variant:u?c:void 0,reason:void 0,metadata:$(null==o?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.featureFlags.receivedFeatureFlags({flags:a})}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.Tt.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Rn),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return yt.uninitializedWarning("posthog.identify");if(N(e)&&(e=e.toString(),yt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))yt.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==fi){if(this.hr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==r&&e!==this.get_property(Dt)&&(this.unregister(Dt),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(oi)||"anonymous");e!==r&&s?(this.persistence.set_property(oi,"identified"),this.setPersonPropertiesForFlags(_({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.Be=Hr(e,t,i),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(ni))}}else yt.critical('The string "'+fi+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else yt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.hr("posthog.setPersonProperties")){var i=Hr(this.get_distinct_id(),e,t);this.Be!==i?(this.setPersonPropertiesForFlags(_({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Be=i):yt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:_({},r,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===t||i||this.reloadFeatureFlags()}else yt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.hr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,r,n,s;if(yt.info("reset"),!this.__loaded)return yt.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),null==(r=this.sr)||r.stop(),this.featureFlags.reset(),null==(n=this.persistence)||n.set_property(oi,"anonymous"),null==(s=this.sessionManager)||s.resetSessionId(),this.Be=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:fi,$device_id:null},"");else{var a=this.config.get_device_id(Ei());this.register_once({distinct_id:a,$device_id:e?a:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var n,s=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(e,t){return e===this.get_property(Nt)?(yt.critical("Attempting to create alias for existing People user - aborting."),-2):this.hr("posthog.alias")?($(t)&&(t=this.get_distinct_id()),e!==t?(this.dr(Dt,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(yt.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=_({},this.config);if(A(e)){var i,r,n,s,o,a,l,c;Ot(this.config,vs(e));var u=this.Ve();null==(i=this.persistence)||i.update_config(this.config,t,u),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new bn(_({},this.config,{persistence:"sessionStorage"}),u);var d=this.qe(this.config.debug);L(d)&&(this.config.debug=d),L(this.config.debug)&&(this.config.debug?(h.DEBUG=!0,Ii.O()&&Ii.j("ph_debug","true"),yt.info("set_config",{config:e,oldConfig:t,newConfig:_({},this.config)})):(h.DEBUG=!1,Ii.O()&&Ii.L("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(o=this.heatmaps)||o.startIfEnabled(),null==(a=this.exceptionObserver)||a.startIfEnabledOrStop(),null==(l=this.deadClicksAutocapture)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.vr(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,r,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(_({},r,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:fs;return t!==fs&&(t=fs+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(oi))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(oi))}ur(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&R(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Dt])&&(null==(t=this.persistence)||null==(t=t.props)||!t[pi]))}nr(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.ur()||this.hr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.hr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}hr(e){return"never"===this.config.person_profiles?(yt.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.dr(pi,!0),!0)}Ve(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}vr(){var e,t,i,r,n=this.Ve();return(null==(e=this.persistence)?void 0:e.jt)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.jt)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n}opt_in_capturing(e){var t;if("always"!==this.config.cookieless_mode){if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()){var i,r,n,s,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new ts(this),this.pageViewManager=new Qi(this),this.persistence&&(this.sessionPropsManager=new Qn(this,this.sessionManager,this.persistence));var a=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=ys.__defaultExtensionClasses)?void 0:o.sessionRecording;a&&(this.sessionRecording=new a(this),this.sessionRecording.startIfEnabledOrStop())}var l;this.consent.optInOut(!0),this.vr(),this.er(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),($(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(l=null==e?void 0:e.captureEventName)&&void 0!==l?l:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.rr()}else yt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.vr(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:fi,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.rr())):yt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Fi.GRANTED?"granted":e===Fi.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.vr()}_is_bot(){return s?is(s,this.config.custom_blocked_useragents):void 0}rr(){o&&("visible"===o.visibilityState?this.Ue||(this.Ue=!0,this.capture("$pageview",{title:o.title},{send_instantly:!0}),this.ze&&(o.removeEventListener("visibilitychange",this.ze),this.ze=null)):this.ze||(this.ze=this.rr.bind(this),Mt(o,"visibilitychange",this.ze)))}debug(t){!1===t?(null==e||e.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==e||e.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Rt(){var e,t,i,r,n,s,o=this.We||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(yt.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",r=yt,n=(t="advanced_disable_flags")in(e=o)&&!j(e[t]),s=i in e&&!j(e[i]),n?e[t]:!!s&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]))}lr(e){if(j(this.config.before_send))return e;var t=I(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(i=r(i),j(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return H(e.event)?yt.warn(n+". This can cause unexpected behavior."):yt.info(n),null}i.properties&&!R(i.properties)||yt.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.it)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}qe(e){var t=L(e)&&!e,i=Ii.O()&&"true"===Ii.A("ph_debug");return!t&&(!!i||e)}}function bs(e){return e instanceof Element&&(e.id===hi||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function ws(e){return!!e&&1===e.nodeType}function Es(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function xs(e){return!!e&&3===e.nodeType}function Ss(e){return!!e&&11===e.nodeType}function ks(e){return e?E(e).split(/\s+/):[]}function Os(t){var i=null==e?void 0:e.location.href;return!!(i&&t&&t.some(e=>i.match(e)))}function Ps(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return ks(t)}function Is(e){return j(e)?null:E(e).split(/(\s+)/).filter(e=>Vs(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ts(e){var t="";return Ds(e)&&!Ls(e)&&e.childNodes&&e.childNodes.length&&kt(e.childNodes,function(e){var i;xs(e)&&e.textContent&&(t+=null!==(i=Is(e.textContent))&&void 0!==i?i:"")}),E(t)}function As(e){return $(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}ys.__defaultExtensionClasses={},function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=At(e.prototype[t[i]])}(ys,["identify"]);var Rs=["a","button","form","input","select","textarea","label"];function $s(e,t){if($(t))return!0;var i,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var n of e)if(i=r(n))return i.v;return!1}function Cs(e){var t=e.parentNode;return!(!t||!ws(t))&&t}var Fs=["next","previous","prev",">","<"],Ms=[".ph-no-rageclick",".ph-no-capture"],js=e=>!e||Es(e,"html")||!ws(e),Ns=(t,i)=>{if(!e||js(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[t],s=t;s.parentNode&&!Es(s,"body");)if(Ss(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var o=Cs(s);if(!o)break;if(i||Rs.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var a=e.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}n.push(o),s=o}return{parentIsUsefulElement:r,targetElementList:n}};function Ds(e){for(var t=e;t.parentNode&&!Es(t,"body");t=t.parentNode){var i=Ps(t);if(w(i,"ph-sensitive")||w(i,"ph-no-capture"))return!1}if(w(Ps(e),"ph-include"))return!0;var r=e.type||"";if(C(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!C(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 Ls(e){return!!(Es(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Es(e,"select")||Es(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Hs="(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})",qs=new RegExp("^(?:"+Hs+")$"),Us=new RegExp(Hs),zs="\\d{3}-?\\d{2}-?\\d{4}",Bs=new RegExp("^("+zs+")$"),Ws=new RegExp("("+zs+")");function Vs(e,t){if(void 0===t&&(t=!0),j(e))return!1;if(C(e)){if(e=E(e),(t?qs:Us).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Bs:Ws).test(e))return!1}return!0}function Gs(e){var t=Ts(e);return Vs(t=(t+" "+Ys(e)).trim())?t:""}function Ys(e){var t="";return e&&e.childNodes&&e.childNodes.length&&kt(e.childNodes,function(e){var i;if(e&&"span"===(null==(i=e.tagName)?void 0:i.toLowerCase()))try{var r=Ts(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Ys(e)).trim())}catch(e){yt.error("[AutoCapture]",e)}}),t}function Js(e){return function(e){var t=e.map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))r+="."+n.replace(/"/g,"");var s=_({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return It(s).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return o[Ks(t.toString())]=Ks(i.toString())}),(r+=":")+It(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")});return t.join(";")}(function(e){return e.map(e=>{var t,i,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:Xs(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return It(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r})}(e))}function Ks(e){return e.replace(/"|\\"/g,'\\"')}function Xs(e){var t=e.attr__class;return t?I(t)?t:ks(t):void 0}class Zs{constructor(e){this.disabled=!1===e;var t=A(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var Qs="$copy_autocapture",eo=bt("[AutoCapture]");function to(e,t){return t.length>e?t.slice(0,e)+"...":t}function io(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!ws(t));return t}var ro=bt("[ExceptionAutocapture]");function no(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],n=i(r);return T(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=r}}catch(e){return()=>{}}}var so=bt("[TracingHeaders]"),oo=bt("[Web Vitals]"),ao=9e5;bt("[SessionRecording]");var lo="[SessionRecording]",co=bt(lo),uo=bt("[Heatmaps]");function po(e){return A(e)&&"clientX"in e&&"clientY"in e&&N(e.clientX)&&N(e.clientY)}var ho=bt("[Product Tours]"),fo="ph_product_tours",go=["$set_once","$set"],_o=bt("[SiteApps]"),vo={sessionRecording:class{get started(){var e;return!(null==(e=this.cr)||!e.isStarted)}get status(){return this.cr?this.cr.status:this.pr&&!this._r?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.pr=!1,this.gr=!1,this.mr=void 0,this._instance=e,!this._instance.sessionManager)throw co.error("started without valid sessionManager"),new Error(lo+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(lo+' cannot be used with cookieless_mode="always"')}get _r(){var t,i=!(null==(t=this._instance.get_property(Jt))||!t.enabled),r=!this._instance.config.disable_session_recording,n=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return e&&i&&r&&!n}startIfEnabledOrStop(e){var t;if(!this._r||null==(t=this.cr)||!t.isStarted){var i=!$(Object.assign)&&!$(Array.from);this._r&&i?(this.br(e),co.info("starting")):this.stopRecording()}}br(e){var t,i,r;this._r&&(null!=p&&null!=(t=p.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=p.__PosthogExtensions__)&&i.initSessionRecording?this.yr(e):null==(r=p.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.wr,t=>{if(t)return co.error("could not load recorder",t);this.yr(e)}))}stopRecording(){var e,t;null==(e=this.mr)||e.call(this),this.mr=void 0,null==(t=this.cr)||t.stop()}$r(){var e;null==(e=this._instance.persistence)||e.unregister(Xt)}Er(e){if(this._instance.persistence){var t,i,r=this._instance.persistence,n=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,n=j(i)?null:parseFloat(i);j(n)&&this.$r();var s=null==t?void 0:t.minimumDurationMilliseconds;r.register({[Jt]:_({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:_({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:n,minimumDurationMilliseconds:$(s)?null:s,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};n(),null==(t=this.mr)||t.call(this),this.mr=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.gr=!1,this.Er(e),this.pr=!0,this.startIfEnabledOrStop()):this.pr=!0:co.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.cr)&&i.log?this.cr.log(e,t):co.warn("log called before recorder was ready")}get wr(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Jt);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Sr(){var e,t=this._instance.get_property(Jt);if(!t)return!1;var i=null!==(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)&&void 0!==e?e:Date.now();return Date.now()-i<=3e5}yr(e){var t,i;if(null==(t=p.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.cr||(this.cr=null==(i=p.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.cr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Sr()?this.cr.start(e):this.gr||(this.gr=!0,co.info("persisted remote config is stale, requesting fresh config before starting"),new Vn(this._instance).load())}onRRwebEmit(e){var t;null==(t=this.cr)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.cr||null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}),null==(e=this.cr)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.cr||null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}),null==(e=this.cr)||e.overrideSampling()}overrideTrigger(e){var t,i;this.cr||null==(i=this._instance.persistence)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(t=this.cr)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.cr)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.cr)||!i.tryAddCustomEvent(e,t))}}},mo={autocapture:class{constructor(e){this.kr=!1,this.Pr=null,this.Tr=!1,this.instance=e,this.rageclicks=new Zs(e.config.rageclick),this.Ir=null}get N(){var e,t,i=A(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}Cr(){if(this.isBrowserSupported()){if(e&&o){var t=t=>{t=t||(null==e?void 0:e.event);try{this.Rr(t)}catch(e){eo.error("Failed to capture event",e)}};if(Mt(o,"submit",t,{capture:!0}),Mt(o,"change",t,{capture:!0}),Mt(o,"click",t,{capture:!0}),this.N.capture_copied_text){var i=t=>{t=t||(null==e?void 0:e.event),this.Rr(t,Qs)};Mt(o,"copy",i,{capture:!0}),Mt(o,"cut",i,{capture:!0})}}}else eo.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.kr&&(this.Cr(),this.kr=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Tr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ht]:!!e.autocapture_opt_out}),this.Pr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ir=e}getElementSelectors(e){var t,i=[];return null==(t=this.Ir)||t.forEach(t=>{var r=null==o?void 0:o.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[Ht],r=this.Pr;if(M(r)&&!L(i)&&!this.instance.Rt())return!1;var n=null!==(t=this.Pr)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!n}Rr(t,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r,n=As(t);xs(n)&&(n=n.parentNode||null),"$autocapture"===i&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&function(t,i){if(!e||js(t))return!1;var r,n,s;if(L(i)?(r=!!i&&Ms,n=void 0):(r=null!==(s=null==i?void 0:i.css_selector_ignorelist)&&void 0!==s?s:Ms,n=null==i?void 0:i.content_ignorelist),!1===r)return!1;var{targetElementList:o}=Ns(t,!1);return!function(e,t){if(!1===e||$(e))return!1;var i;if(!0===e)i=Fs;else{if(!I(e))return!1;if(e.length>10)return yt.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:r}=e;return i.some(e=>t.includes(e)||r.includes(e))})}(n,o.map(e=>{var t;return{safeText:Ts(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!$s(o,r)}(n,this.instance.config.rageclick)&&this.Rr(t,"$rageclick");var s=i===Qs;if(n&&function(t,i,r,n,s){var o,a,l,c;if(void 0===r&&(r=void 0),!e||js(t))return!1;if(null!=(o=r)&&o.url_allowlist&&!Os(r.url_allowlist))return!1;if(null!=(a=r)&&a.url_ignorelist&&Os(r.url_ignorelist))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some(e=>i.type===e))return!1}var{parentIsUsefulElement:d,targetElementList:p}=Ns(t,n);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if($(i))return!0;var r,n=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var s of e)if(r=n(s))return r.v;return!1}(p,r))return!1;if(!$s(p,null==(c=r)?void 0:c.css_selector_allowlist))return!1;var h=e.getComputedStyle(t);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===i.type)return!0;var f=t.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(s||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(i.type)>=0;default:return d?(s||["click"]).indexOf(i.type)>=0:(s||["click"]).indexOf(i.type)>=0&&(Rs.indexOf(f)>-1||"true"===t.getAttribute("contenteditable"))}}(n,t,this.N,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(t,i){for(var r,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=i,u=[t],d=t;d.parentNode&&!Es(d,"body");)Ss(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var p,h=[],f={},g=!1,_=!1;if(kt(u,e=>{var t=Ds(e);"a"===e.tagName.toLowerCase()&&(g=e.getAttribute("href"),g=t&&g&&Vs(g)&&g),w(Ps(e),"ph-no-capture")&&(_=!0),h.push(function(e,t,i,r){var n=e.tagName.toLowerCase(),s={tag_name:n};Rs.indexOf(n)>-1&&!i&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=to(1024,Gs(e)):s.$el_text=to(1024,Ts(e)));var o=Ps(e);o.length>0&&(s.classes=o.filter(function(e){return""!==e})),kt(e.attributes,function(i){var n;if((!Ls(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&Vs(i.value)&&(n=i.name,!C(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=ks(o).join(" ")),s["attr__"+i.name]=to(1024,o)}});for(var a=1,l=1,c=e;c=io(c);)a++,c.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(e,o,a,l));var i=function(e){if(!Ds(e))return{};var t={};return kt(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&Vs(r)&&(t[i]=r)}}),t}(e);Ot(f,i)}),_)return{props:{},explicitNoCapture:_};if(a||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?h[0].$el_text=Gs(t):h[0].$el_text=Ts(t)),g){var v,m;h[0].attr__href=g;var y=null==(v=Bi(g))?void 0:v.host,b=null==e||null==(m=e.location)?void 0:m.host;y&&b&&y!==b&&(p=g)}return{props:Ot({$event_type:s.type,$ce_version:1},c?{}:{$elements:h},{$elements_chain:Js(h)},null!=(r=h[0])&&r.$el_text?{$el_text:null==(n=h[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},f)}}(n,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Tr});if(a)return!1;var l=this.getElementSelectors(n);if(l&&l.length>0&&(o.$element_selectors=l),i===Qs){var c,u=Is(null==e||null==(c=e.getSelection())?void 0:c.toString()),d=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(i,o),!0}}}isBrowserSupported(){return T(null==o?void 0:o.querySelectorAll)}},historyAutocapture:class{constructor(t){var i;this._instance=t,this.Fr=(null==e||null==(i=e.location)?void 0:i.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(yt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Or&&this.Or(),this.Or=void 0,yt.info("History API monitoring stopped")}monitorHistoryChanges(){var t,i;if(e&&e.history){var r=this;null!=(t=e.history.pushState)&&t.__posthog_wrapped__||no(e.history,"pushState",e=>function(t,i,n){e.call(this,t,i,n),r.Mr("pushState")}),null!=(i=e.history.replaceState)&&i.__posthog_wrapped__||no(e.history,"replaceState",e=>function(t,i,n){e.call(this,t,i,n),r.Mr("replaceState")}),this.Ar()}}Mr(t){try{var i,r=null==e||null==(i=e.location)?void 0:i.pathname;if(!r)return;r!==this.Fr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Fr=r}catch(e){yt.error("Error capturing "+t+" pageview",e)}}Ar(){if(!this.Or){var t=()=>{this.Mr("popstate")};Mt(e,"popstate",t),this.Or=()=>{e&&e.removeEventListener("popstate",t)}}}},heatmaps:class{constructor(e){var t;this.Dr=!1,this.kr=!1,this.jr=null,this.instance=e,this.Dr=!(null==(t=this.instance.persistence)||!t.props[qt]),this.rageclicks=new Zs(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return A(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return j(this.instance.config.capture_heatmaps)?j(this.instance.config.enable_heatmaps)?this.Dr:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.kr)return;uo.info("starting..."),this.Lr(),this.Nr()}else{var e;clearInterval(null!==(e=this.jr)&&void 0!==e?e:void 0),this.Ur(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[qt]:t}),this.Dr=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}zr(e){this.Hr(e.originalEvent,"deadclick")}Nr(){this.jr&&clearInterval(this.jr),this.jr=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(o)?setInterval(this.te.bind(this),this.flushIntervalMilliseconds):null}Lr(){e&&o&&(this.Br=this.te.bind(this),Mt(e,"beforeunload",this.Br),this.qr=t=>this.Hr(t||(null==e?void 0:e.event)),Mt(o,"click",this.qr,{capture:!0}),this.Wr=t=>this.Gr(t||(null==e?void 0:e.event)),Mt(o,"mousemove",this.Wr,{capture:!0}),this.Vr=new Li(this.instance,Ni,this.zr.bind(this)),this.Vr.startIfEnabledOrStop(),this.Jr=this.Nr.bind(this),Mt(o,"visibilitychange",this.Jr),this.kr=!0)}Ur(){var t;e&&o&&(this.Br&&e.removeEventListener("beforeunload",this.Br),this.qr&&o.removeEventListener("click",this.qr,{capture:!0}),this.Wr&&o.removeEventListener("mousemove",this.Wr,{capture:!0}),this.Jr&&o.removeEventListener("visibilitychange",this.Jr),clearTimeout(this.Kr),null==(t=this.Vr)||t.stop(),this.kr=!1)}Yr(t,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(t,i,r){for(var n=t;n&&ws(n)&&!Es(n,"body");){if(n===r)return!1;if(w(i,null==e?void 0:e.getComputedStyle(n).position))return!0;n=Cs(n)}return!1}(As(t),["fixed","sticky"],s);return{x:t.clientX+(o?0:n),y:t.clientY+(o?0:r),target_fixed:o,type:i}}Hr(e,t){var i;if(void 0===t&&(t="click"),!bs(e.target)&&po(e)){var r=this.Yr(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Xr(_({},r,{type:"rageclick"})),this.Xr(r)}}Gr(e){!bs(e.target)&&po(e)&&(clearTimeout(this.Kr),this.Kr=setTimeout(()=>{this.Xr(this.Yr(e,"mousemove"))},500))}Xr(t){if(e){var i=e.location.href,r=this.instance.config.mask_personal_data_properties,n=this.instance.config.custom_personal_data_properties,s=r?Pt([],Gr,n||[]):[],o=Vi(i,s,Jr);this.R=this.R||{},this.R[o]||(this.R[o]=[]),this.R[o].push(t)}}te(){this.R&&!R(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Li,webVitalsAutocapture:class{constructor(e){var t;this.Dr=!1,this.kr=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Qr=()=>{clearTimeout(this.Zr),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>_({},e,{["$web_vitals_"+t.name+"_event"]:_({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ts=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if($(i))oo.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.es();$(r)||(j(null==e?void 0:e.name)||j(null==e?void 0:e.value)?oo.error("Invalid metric received",e):this.rs&&e.value>=this.rs?oo.error("Ignoring metric with value >= "+this.rs,e):(this.R.url!==r&&(this.Qr(),this.Zr=setTimeout(this.Qr,this.flushToCaptureTimeoutMs)),$(this.R.url)&&(this.R.url=r),this.R.firstMetricTimestamp=$(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.R.metrics.push(_({},e,{$current_url:r,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.Qr()))}},this.ss=()=>{if(!this.kr){var e,t,i,r,n=p.__PosthogExtensions__;$(n)||$(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=n.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.ts.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ts.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ts.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.ts.bind(this)),this.kr=!0):oo.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Dr=!(null==(t=this._instance.persistence)||!t.props[Wt]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=A(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return j(i)?(null==(t=this._instance.persistence)?void 0:t.props[Yt])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(A(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=A(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=e&&e}get rs(){var e=A(this._instance.config.capture_performance)&&N(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ao;return 0<e&&e<=6e4?ao:e}get isEnabled(){var e=null==a?void 0:a.protocol;if("http:"!==e&&"https:"!==e)return oo.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=A(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:L(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return L(t)?t:this.Dr}startIfEnabled(){this.isEnabled&&!this.kr&&(oo.info("enabled, starting..."),this.V(this.ss))}onRemoteConfig(e){if("capturePerformance"in e){var t=A(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=A(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Wt]:t}),this._instance.persistence.register({[Yt]:i})),this.Dr=t,this.startIfEnabled()}}V(e){var t,i;if(null!=(t=p.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,r,t=>{t?oo.error("failed to load script",t):e()})}}es(){var t=e?e.location.href:void 0;if(t){var i=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,n=i?Pt([],Gr,r||[]):[];return Vi(t,n,Jr)}oo.error("Could not determine current URL")}}},yo={exceptionObserver:class{constructor(t){var i,r,n;this.ss=()=>{var t;if(e&&this.isEnabled&&null!=(t=p.__PosthogExtensions__)&&t.errorWrappingFunctions){var i=p.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=p.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=p.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ns&&this.N.capture_unhandled_errors&&(this.ns=i(this.captureException.bind(this))),!this.os&&this.N.capture_unhandled_rejections&&(this.os=r(this.captureException.bind(this))),!this.ls&&this.N.capture_console_errors&&(this.ls=n(this.captureException.bind(this)))}catch(e){ro.error("failed to start",e),this.us()}}},this._instance=t,this.hs=!(null==(i=this._instance.persistence)||!i.props[Ut]),this.ds=new Y({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(n=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==n?n:10,refillInterval:1e4,h:ro}),this.N=this.vs(),this.startIfEnabledOrStop()}vs(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return A(e)?t=_({},t,e):($(e)?this.hs:e)&&(t=_({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ro.info("enabled"),this.us(),this.V(this.ss)):this.us()}V(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return ro.error("failed to load script",t);e()})}us(){var e,t,i;null==(e=this.ns)||e.call(this),this.ns=void 0,null==(t=this.os)||t.call(this),this.os=void 0,null==(i=this.ls)||i.call(this),this.ls=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.hs=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[Ut]:this.hs}),this.N=this.vs(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.vs()}captureException(e){var t,i,r=null!==(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==t?t:"Exception";this.ds.consumeRateLimit(r)?ro.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}},bo={productTours:class{constructor(e){this.cs=null,this.fs=null,this._instance=e}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[Gt]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.cs||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(Gt)||this.V(()=>this.ps())}V(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?ho.error("Could not load product tours script",t):e()})}ps(){var e;!this.cs&&null!=(e=p.__PosthogExtensions__)&&e.generateProductTours&&(this.cs=p.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!I(this.fs)||t){var i=this._instance.persistence;if(i){var r=i.props[fo];if(I(r)&&!t)return this.fs=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{var r=t.statusCode;if(200!==r||!t.json){var n="Product Tours API could not be loaded, status: "+r;return ho.error(n),void e([],{isLoaded:!1,error:n})}var s=I(t.json.product_tours)?t.json.product_tours:[];this.fs=s,i&&i.register({[fo]:s}),e(s,{isLoaded:!0})}})}else e(this.fs,{isLoaded:!0})}getActiveProductTours(e){j(this.cs)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.cs.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.cs)||t.showTourById(e)}previewTour(e){this.cs?this.cs.previewTour(e):this.V(()=>{var t;this.ps(),null==(t=this.cs)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.cs)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.cs)||e.nextStep()}previousStep(){var e;null==(e=this.cs)||e.previousStep()}clearCache(){var e;this.fs=null,null==(e=this._instance.persistence)||e.unregister(fo)}resetTour(e){var t;null==(t=this.cs)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.cs)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.cs)||t.cancelPendingTour(e)}}},wo={siteApps:class{constructor(e){this._instance=e,this._s=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}gs(e,t){if(t){var i=this.globalsForEvent(t);this._s.push(i),this._s.length>1e3&&(this._s=this._s.slice(10))}}get siteAppLoaders(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.gs.bind(this));this.bs=()=>{e(),this._s=[],this.bs=void 0}}}globalsForEvent(e){var t,i,r,n,s,o,a;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[d,p]of Object.entries(u))l[d]={id:c[d],type:d,properties:p};var{$set_once:h,$set:f}=e;return{event:_({},v(e,go),{properties:_({},e.properties,f?{$set:_({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},f)}:{},h?{$set_once:_({},null!==(r=null==(n=e.properties)?void 0:n.$set_once)&&void 0!==r?r:{},h)}:{}),elements_chain:null!==(s=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this._s.length&&(_o.info("Processing "+this._s.length+" events for site app with id "+e.id),this._s.forEac
1h(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.bs)||i.call(this))},r=!1,n=n=>{t.errored=!n,t.loaded=!0,_o.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),r&&i()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:e=>{n(e)}});s&&(t.processEvent=s),r=!0}catch(t){_o.error("Error while initializing PostHog app with config id "+e.id,t),n(!1)}if(r&&t.loaded)try{i()}catch(i){_o.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ys(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ws(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){_o.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,r,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.ys(),void this._instance.on("eventCaptured",e=>this.ws(e))):void _o.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.bs)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var s=function(e){var t;p["__$$ph_site_app_"+e]=n._instance,null==(t=p.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,t=>{if(t)return _o.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)s(o)}else _o.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Eo=_({},vo,mo,yo,bo,wo,{tracingHeaders:class{constructor(e){this.xs=void 0,this.$s=void 0,this.ss=()=>{var e,t;$(this.xs)&&(null==(e=p.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),$(this.$s)&&(null==(t=p.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}V(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return so.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.V(this.ss):(null==(e=this.xs)||e.call(this),null==(t=this.$s)||t.call(this),this.xs=void 0,this.$s=void 0)}}});ys.__defaultExtensionClasses=_({},Eo);var xo,So=(xo=ds[fs]=new ys,function(){function t(){t.done||(t.done=!0,gs=!1,kt(ds,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?t():Mt(o,"DOMContentLoaded",t,{capture:!1}):e&&yt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),xo);function ko(e){return ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ko(e)}var Oo=!1,Po=!1,Io=0,To=null;function Ao(e){return Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ao(e)}function Ro(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function $o(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ro(Object(i),!0).forEach(function(t){Co(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ro(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Co(e,t,i){return(t=function(e){var t=function(e){if("object"!=Ao(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=Ao(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ao(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Fo={limit:null,prefetch_at:2,max_posts:100,seed_strategy:"load_order",pause_when_hidden:!1};function Mo(e){return{afterPostAppended:function(t){var i,r,n=t.post,s=t.postIndex,o=t.container;return e&&(i=!0===n.showAd,(r=e).enabled&&i&&!(Io>=r.max_ads))?(o.appendChild(function(e,t){!function(){if(!Oo){if(window.googletag=window.googletag||{cmd:[]},!document.querySelector('script[src*="securepubads.g.doubleclick.net/tag/js/gpt.js"]')){var e=document.createElement("script");e.async=!0,e.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",document.head.appendChild(e)}Oo=!0}}();var i="div-gpt-ad-ap-stacker-".concat(e);Io++;var r=document.createElement("div");r.className="infinite-scroll-ad-wrapper",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.width="100%",r.style.margin="20px 0";var n=document.createElement("div");return n.id=i,n.style.minWidth="".concat(t.sizes[0],"px"),n.style.minHeight="".concat(t.sizes[1],"px"),n.setAttribute("data-ap-placement","stacker"),n.setAttribute("data-ap-page-number",String(e+1)),n.setAttribute("data-ap-post-index",String(e)),r.appendChild(n),r}(s,e)),function(e,t,i){var r="div-gpt-ad-ap-stacker-".concat(e);window.googletag.cmd.push(function(){Po||function(){try{var e;return"function"==typeof(null===(e=window.googletag)||void 0===e?void 0:e.pubads)&&"object"===ko(window.googletag.pubads())}catch(e){return!1}}()||(window.googletag.pubads().enableSingleRequest(),window.googletag.enableServices()),Po=!0;var n=window.googletag.defineSlot(t.slot_path,t.sizes,r);n&&(null!=i&&i.ai_category&&n.setTargeting("ai_category",i.ai_category),null!=i&&i.ai_sub_category&&n.setTargeting("ai_sub_category",i.ai_sub_category),n.addService(window.googletag.pubads()),window.googletag.display(r),window.googletag.pubads().refresh([n]),To&&To.capture("$infinite_scroll_ad_rendered",{ad_slot_path:t.slot_path,ad_slot_id:r,ad_sizes:t.sizes.join("x"),ad_index:Io,post_index:e,page_url:window.location.href}))})}(s,e,{ai_category:n.ai_category,ai_sub_category:n.ai_sub_category}),{adInserted:!0}):{adInserted:!1}}}}var jo="data-ap-scope",No=/^:(?:before|after|first-line|first-letter)(?![\w-])
1/i;function Do(e,t){var i=0;return e.querySelectorAll('style[id^="elementor-post-dynamic-"]').forEach(function(e){if(!e.hasAttribute(jo)&&e.sheet){e.setAttribute(jo,t);try{i+=Lo(e.sheet.cssRules,t)}catch(e){console.warn("Infinite Scroll: could not scope appended styles",e)}}}),i}function Lo(e,t){for(var i=0,r=0;r<e.length;r+=1){var n=e[r];if(1===n.type){var s=n,o=s.selectorText;s.selectorText=Ho(o,t),s.selectorText!==o&&(i+=1)}else 7!==n.type&&"cssRules"in n&&(i+=Lo(n.cssRules,t))}return i}function Ho(e,t){return(i=e,r=[],n=0,qo(i,function(e){","===i[e]&&(r.push(i.slice(n,e)),n=e+1)}),r.push(i.slice(n)),r.map(function(e){return e.trim()}).filter(Boolean)).map(function(e){return function(e,t){var i=function(e){var t=-1;return qo(e,function(i){return":"!==e[i]||":"!==e[i+1]&&!No.test(e.slice(i))||(t=i,!1)}),t}(e);if(-1===i)return"".concat(t," :is(").concat(e,")");var r=e.slice(0,i);return r.trim()&&!/[\s>+~]$/.test(r)||(r+="*"),"".concat(t," :is(").concat(r.trim(),")").concat(e.slice(i))}(e,t)}).join(", ");var i,r,n}function qo(e,t){for(var i=0,r="",n=0;n<e.length;n+=1){var s=e[n];if("\\"===s)n+=1;else if(r)s===r&&(r="");else if('"'===s||"'"===s)r=s;else if("("===s||"["===s)i+=1;else if(")"===s||"]"===s)i-=1;else if(0===i&&!1===t(n))return}}function Uo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,s,o,a=[],l=!0,c=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(r=s.call(i)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw n}}return a}}(e,t)||Bo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zo(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=Bo(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function Bo(e,t){if(e){if("string"==typeof e)return Wo(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Wo(e,t):void 0}}function Wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function Vo(e){if(!Array.isArray(e)||0===e.length)return null;var t=("number"==typeof e[0]?[e]:e).filter(function(e){return Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]&&e[0]>0&&e[1]>0});return t.length?t.map(function(e){return[e[0],e[1]]}):null}function Go(e){if(null==e||""===e)return null;try{return JSON.parse(e)}catch(e){return}}function Yo(e,t,i){if(!e||!i)return null;var r=[[[t?970:728,0],e]];return t&&r.push([[728,0],t]),r.push([[0,0],i]),r}function Jo(e,t,i){if(!e||0===e.length)return function(e){return"fluid"===e?[]:Vo(e)||[]}(t);var r,n=Number.isFinite(i)?i:0,s=zo(e);try{for(s.s();!(r=s.n()).done;){var o=Uo(r.value,2),a=Uo(o[0],1)[0],l=o[1];if(n>=a)return l}}catch(e){s.e(e)}finally{s.f()}return e[e.length-1][1]}function Ko(e){return 0===e.length?{widthPx:0,heightPx:0}:{widthPx:e.reduce(function(e,t){return t[0]>e?t[0]:e},0),heightPx:e.reduce(function(e,t){return t[1]<e?t[1]:e},e[0][1])}}function Xo(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function Zo(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
1t%2?Xo(Object(i),!0).forEach(function(t){Qo(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Xo(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Qo(e,t,i){return(t=function(e){var t=function(e){if("object"!=ea(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=ea(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ea(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ea(e){return ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ea(e)}var ta={activate:!0,skip_slotnames:[],max_per_post:3,pos:null},ia={desktop_min:970,tablet_min:728},ra={mobile_max_pct:30},na={fetch_margin_px:1200},sa={pos:"infinite_scroll"},oa={enabled:!1,min_seconds:30,require_viewable:!0,max_per_slot:3,pause_when_hidden:!0,exclude_sponsored:!0,persistent:{on_post_enter:!0,include_slotnames:[],exclude_sponsored:!0}},aa={limit:5,prefetch_at:2,max_posts:100,seed_strategy:"dwell",pause_when_hidden:!0},la=/^[a-z0-9_-]{1,32}$/;function ca(e){return"object"===ea(e)&&null!==e&&!Array.isArray(e)}function ua(e,t,i,r){var n="number"==typeof e?e:Number(e);if(!Number.isFinite(n))return r;var s=Math.round(n);return s<t?t:s>i?i:s}function da(e,t){return"boolean"==typeof e?e:"true"===e||"1"===e||1===e||"false"!==e&&"0"!==e&&0!==e&&t}function pa(e){return Array.isArray(e)?e.filter(function(e){return"string"==typeof e&&""!==e}):[]}function ha(e){return ca(e)?Vo(e.sizes):null}function fa(e){var t=ta;return ca(e)?{activate:da(e.activate,t.activate),skip_slotnames:pa(e.skip_slotnames),max_per_post:ua(e.max_per_post,0,10,t.max_per_post),pos:"string"==typeof e.pos&&""!==e.pos?e.pos:null}:Zo(Zo({},t),{},{skip_slotnames:[]})}function ga(e){var t=oa;if(!ca(e))return Zo(Zo({},t),{},{persistent:Zo(Zo({},t.persistent),{},{include_slotnames:[]})});var i=ca(e.persistent)?e.persistent:{};return{enabled:da(e.enabled,t.enabled),min_seconds:Math.max(30,ua(e.min_seconds,0,3600,t.min_seconds)),require_viewable:da(e.require_viewable,t.require_viewable),max_per_slot:ua(e.max_per_slot,0,10,t.max_per_slot),pause_when_hidden:da(e.pause_when_hidden,t.pause_when_hidden),exclude_sponsored:da(e.exclude_sponsored,t.exclude_sponsored),persistent:{on_post_enter:da(i.on_post_enter,t.persistent.on_post_enter),include_slotnames:pa(i.include_slotnames),exclude_sponsored:da(i.exclude_sponsored,t.persistent.exclude_sponsored)}}}function _a(e){var t=aa;return ca(e)?{limit:null===e.limit?null:ua(e.limit,1,10,t.limit),prefetch_at:ua(e.prefetch_at,0,10,t.prefetch_at),max_posts:ua(e.max_posts,1,100,t.max_posts),seed_strategy:"load_order"===e.seed_strategy?"load_order":"dwell",pause_when_hidden:da(e.pause_when_hidden,t.pause_when_hidden)}:Zo({},t)}var va={left:"left",center:"center",right:"right"};function ma(e,t){return-1!==e.indexOf(t)}var ya={"Neonatal Maladjustment Syndrome Dummy Foal":"Neonatal Maladjustment Synd. Dummy Foal","Exercise Induced Pulmonary Hemorrhage EIPH":"Exercise Induced Pulmonary Hemorr. EIPH"};function ba(e){return(void 0!==ya[e]?ya[e]:e).replace(/&/g,"and").replace(/[,']/g,"").replace(/\//g,"-")}function wa(e){return e.split("/").filter(function(e){return""!==e})}function Ea(e,t){return"ap-native-".concat(e,"-").concat(t)}function xa(e,t){var i={"content-type":"article"},r=t.sponsorId||e.sponsorId;r&&(i.sponlineitemid=[r]),t.pos&&(i.pos=t.pos),t.engamLi&&(i.engam_li=t.engamLi),e.categories.length&&(i.categories=e.categories.slice()),e.subcategories.length&&(i.subcategories=e.subcategories.slice());var n=String(e.id);return i.postid=n,i.path=wa(e.url).concat(e.categories,e.subcategories,[n]),e.aiCategory&&(i.ai_category=[ba(e.aiCategory)]),e.aiSubCategory&&(i.ai_sub_category=[ba(e.aiSubCategory)]),i}function Sa(e,t){return t?"".concat(e,"/").concat(t):e}function ka(e){return ka="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}
1,ka(e)}function Oa(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function Pa(e,t,i){return(t=function(e){var t=function(e){if("object"!=ka(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=ka(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ka(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ia(e,t,i,r,n,s,o){var a=[],l=[],c=[],u={networkPrefix:o.networkPrefix,viewportWidth:n.viewportWidth,device:r},d=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Oa(Object(i),!0).forEach(function(t){Pa(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Oa(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({},e.insertedByRule),p=e.adHeightPx,h=i.map(function(e){return function(e,t){var i,r=Go(e.sizedesktop),n=Go(e.sizetablet),s=Go(e.sizemobile),o=Go(e.sizes),a=Vo(r),l=Vo(n),c=Vo(s),u=Array.isArray(o)?o:"fluid",d=void 0===r||void 0===n||void 0===s||void 0===o,p=e.slotname&&""!==e.slotname?e.slotname:null,h={slotname:p,align:(i=e.align,i&&va[i]||"center"),sizes:u,desktop:a,tablet:l,mobile:c,mapping:Yo(a,l,c),sponsorId:e.sponsorid&&""!==e.sponsorid?e.sponsorid:null,pos:e.pos&&""!==e.pos?e.pos:t.pos,engamLi:e.engamLi&&""!==e.engamLi?e.engamLi:null,fluid:void 0!==e.fluid&&""!==e.fluid&&"0"!==e.fluid,skip:null,malformedSizes:d};return t.activate?e.claimed?h.skip="claimed":e.schedOff?h.skip="sched_off":function(e){return void 0!==e&&""!==e&&"false"!==e}(e.popup)?h.skip="popup":ma(e.classes,"engam-masthead-ad")?h.skip="masthead":ma(e.classes,"engam-billboard-ad")?h.skip="billboard":null!==p&&-1!==t.skip_slotnames.indexOf(p)?h.skip="skip_slotname":"fluid"!==u||a||c||(h.skip="no_sizes"):h.skip="disabled",h}(e,s.native)}),f=function(e,t){var i=[],r=[];return e.forEach(function(e,n){e.skip?r.push({index:n,reason:e.skip}):i.length>=t.max_per_post?r.push({index:n,reason:"disabled"}):i.push(n)}),{activate:i,skipped:r}}(h,s.native);f.activate.forEach(function(e,i){var r=function(e,t,i,r,n){var s=Ko(Jo(e.mapping,e.sizes,n.viewportWidth));return{divId:Ea(i.index,t),path:Sa(n.networkPrefix,e.slotname),sizes:e.sizes,mapping:e.mapping,targeting:xa(i,{pos:e.pos||r.pos,sponsorId:e.sponsorId,engamLi:e.engamLi}),placement:"native",feedRule:null,slotname:e.slotname,postIndex:i.index,pageNumber:i.index+1,align:e.align,reservedWidthPx:s.widthPx,reservedHeightPx:s.heightPx,fullWidth:!1,sponsored:Boolean(e.sponsorId||i.sponsorId)}}(h[e],i,t,s.native,u);a.push({spec:r,wrapperIndex:e}),p+=r.reservedHeightPx}),f.skipped.forEach(function(e){c.push({kind:"native",name:"wrapper[".concat(e.index,"]"),reason:e.reason})}),s.feed.forEach(function(i){if(function(e,t){return!e||("mobile"===e?"mobile"===t:"desktop"===t||"tablet"===t)}(i.only,r)){if(function(e,t){return!(t<=0||t<=e.offset||(t-e.offset)%e.every!==0)}(i,t.index)){var o=d[i.name]||0;if(o>=i.max_ads)c.push({kind:"feed",name:i.name,reason:"max_ads"});else{var a=function(e,t,i,r){var n,s,o=e.tablet?e.tablet.sizes:null,a=Yo(e.desktop.sizes,o,e.mobile.sizes),l=function(){for(var e={},t=[],i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];for(var s=0,o=r;s<o.length;s++){var a=o[s];if(a){var l,c=zo(a);try{for(c.s();!(l=c.n()).done;){var u=l.value,d=u[0]+"x"+u[1];e[d]||(e[d]=!0,t.push([u[0],u[1]]))}}catch(e){c.e(e)}finally{c.f()}}}return t}(e.desktop.sizes,o,e.mobile.sizes),c=Ko(Jo(a,l,r.viewportWidth));return{divId:(n=t.index,s=e.name,"ap-feed-".concat(n,"-").concat(s)),path:Sa(r.networkPrefix,e.unit.slotname),sizes:l,mapping:a,targeting:xa(t,{pos:i,sponsorId:null,engamLi:null}),placement:"feed",feedRule:e.name,slotname:e.unit.slotname,postIndex:t.index,pageNumber:t.index+1,align:"center",reservedWidthPx:c.widthPx,reservedHeightPx:c.heightPx,fullWidth:"mobile"===r.device&&e.mobile.full_width,sponsored:Boolean(t.sponsorId)}}(i,t,s.targeting.pos,u);"mobile"!==r||function(e,t,i,r){if(r>=100)return!0;var n=Number.isFinite(t.postHeightPx)?t.postHeightPx:0,s=e.contentHeightPx+n;if(s<=0)return!0;var o=e.adHeightPx+i;return 100*o/(s+o)<=r}(e,n,a.reservedHeightPx,s.density.mobile_max_pct)?(l.push(a),d[i.name]=o+1,p+=a.reservedHeightPx):c.push({kind:"feed",name:i.name,reason:"density"})}}}else c.push({kind:"feed",name:i.name,reason:"device_".concat(r)})});var g={insertedByRule:d,nativeActivated:e.nativeActivated+a.length,contentHeightPx:e.contentHeightPx+(Number.isFinite(n.postHeightPx)?n.postHeightPx:0),adHeightPx:p,slots:e.slots.concat(a.map(function(e){var t=e.spec;return{divId:t.divId,placement:t.placement,postIndex:t.postIndex,feedRule:t.feedRule}}),l.map(function(e){return{divId:e.divId,placement:e.placement,postIndex:e.postIndex,feedRule:e.feedRule}}))};return{activate:a,insert:l,skipped:c,nextState:g}}function Ta(e){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(e)}function Aa(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function Ra(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function $a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
1t%2?Ra(Object(i),!0).forEach(function(t){Ca(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ra(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Ca(e,t,i){return(t=function(e){var t=function(e){if("object"!=Ta(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=Ta(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ta(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Fa(e,t,i){if(!t.enabled)return null;if("persistent"===e.kind)return null;if(e.empty)return null;if(e.refreshCount>=t.max_per_slot)return null;if(e.sponsored&&t.exclude_sponsored)return null;if(i&&t.pause_when_hidden)return null;if(null===e.viewSince)return null;if(t.require_viewable&&null===e.viewableAt)return null;var r=[e.viewSince];return null!==e.viewableAt?r.push(e.viewableAt):null!==e.renderedAt&&r.push(e.renderedAt),null!==e.lastRefreshAt&&r.push(e.lastRefreshAt),Math.max.apply(Math,r)+1e3*t.min_seconds}function Ma(e,t){return $a($a({},e),{},{refresh:"1",refresh_seq:String(t)})}function ja(e,t){e.refreshCount+=1,e.lastRefreshAt=t,e.viewableAt=null,e.renderedAt=null,e.empty=!1}function Na(e,t,i){var r=function(e){var t={};return Object.keys(e.slots).forEach(function(i){var r;t[i]=$a($a({},r=e.slots[i]),{},{baseTargeting:$a({},r.baseTargeting)})}),{slots:t,hidden:e.hidden,lastEnteredIndex:e.lastEnteredIndex}}(e),n=[];switch(t.type){case"slot:registered":r.slots[t.divId]={divId:t.divId,kind:t.kind,slotname:t.slotname,sponsored:t.sponsored,baseTargeting:$a({},t.baseTargeting),refreshCount:0,lastRefreshAt:null,renderedAt:null,empty:!1,viewableAt:null,viewSince:null,lastRatio:0};break;case"slot:unregistered":delete r.slots[t.divId];break;case"slot:rendered":var s=r.slots[t.divId];s&&(s.renderedAt=t.now,s.empty=t.isEmpty,s.viewableAt=null);break;case"slot:viewable":var o=r.slots[t.divId];o&&null===o.viewableAt&&(o.viewableAt=t.now);break;case"slot:inview":var a=r.slots[t.divId];a&&(a.lastRatio=t.ratio,t.ratio>=.5&&!r.hidden?null===a.viewSince&&(a.viewSince=t.now):a.viewSince=null);break;case"page:hidden":r.hidden=t.hidden,Object.keys(r.slots).forEach(function(e){var i=r.slots[e];t.hidden?i.viewSince=null:i.lastRatio>=.5&&(i.viewSince=t.now)});break;case"post:entered":if(t.postIndex===r.lastEnteredIndex)break;r.lastEnteredIndex=t.postIndex;var l=t.post;Object.keys(r.slots).sort().forEach(function(e){var s=r.slots[e];if(function(e,t,i){return!(!t.enabled||!t.persistent.on_post_enter||"persistent"!==e.kind||-1===t.persistent.include_slotnames.indexOf(e.slotname||"")||e.sponsored&&t.persistent.exclude_sponsored||e.refreshCount>=t.max_per_slot||t.pause_when_hidden&&e.empty||null!==e.lastRefreshAt&&i-e.lastRefreshAt<1e3*t.min_seconds)}(s,i,t.now)){ja(s,t.now);var o=l?$a($a({},s.baseTargeting),function(e){var t={},i=String(e.id);return t.postid=i,t.path=wa(e.url).concat(e.categories,e.subcategories,[i]),e.categories.length&&(t.categories=e.categories.slice()),e.subcategories.length&&(t.subcategories=e.subcategories.slice()),e.aiCategory&&(t.ai_category=[ba(e.aiCategory)]),e.aiSubCategory&&(t.ai_sub_category=[ba(e.aiSubCategory)]),t}(l)):s.baseTargeting;n.push({type:"refresh",divId:e,reason:"post_enter",targeting:Ma(o,s.refreshCount),refreshSeq:s.refreshCount})}})}var c="now"in t?t.now:null;return null!==c&&(n.push.apply(n,function(e){return function(e){if(Array.isArray(e))return Aa(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Aa(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Aa(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(function(e,t,i){var r=[];
1return Object.keys(e.slots).sort().forEach(function(n){var s=e.slots[n],o=Fa(s,t,e.hidden);null===o||o>i||(ja(s,i),r.push({type:"refresh",divId:n,reason:"viewable_timer",targeting:Ma(s.baseTargeting,s.refreshCount),refreshSeq:s.refreshCount}))}),r}(r,i,c))),n.push(function(e,t,i){var r=[];return Object.keys(e.slots).forEach(function(n){var s=Fa(e.slots[n],t,e.hidden);null!==s&&s>i&&r.push(s)}),{type:"schedule_tick",at:r.length?Math.min.apply(Math,r):null}}(r,i,c))),{state:r,decisions:n}}function Da(e){return Da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Da(e)}function La(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function Ha(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function qa(e,t,i){return(t=function(e){var t=function(e){if("object"!=Da(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=Da(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Da(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Ua="publisher_ads";function za(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;e.googletag||(e.googletag={cmd:[]});var t={},i=[],r=function(e){i.push(function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ha(Object(i),!0).forEach(function(t){qa(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ha(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({seq:i.length+1},e))},n=function(){return e.googletag},s=function(e){try{n().cmd.push(e)}catch(e){o("cmd.push failed",e)}};function o(){for(var e,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];"undefined"!=typeof console&&console.debug&&(e=console).debug.apply(e,["[ap-feed-ads]"].concat(i))}return{ready:s,define:function(e){s(function(){try{var i=n();if(t[e.divId])return;i.pubadsReady||(i.enableServices(),r({op:"enableServices"}));var s=i.defineSlot(e.path,e.sizes,e.divId);if(!s)return void o("defineSlot returned null",e.divId,e.path);s.addService(i.pubads());var a=function(e,t){if(!t||0===t.length)return null;var i=e.sizeMapping();return t.forEach(function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,s,o,a=[],l=!0,c=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(r=s.call(i)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return La(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?La(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),r=t[0],n=t[1];i=i.addSize(r,n)}),i.build()}(i,e.mapping);a&&s.defineSizeMapping(a),Object.keys(e.targeting).forEach(function(t){s.setTargeting(t,e.targeting[t])}),t[e.divId]=s,r({op:"define",divId:e.divId,path:e.path,sizes:e.sizes,mapping:e.mapping}),i.display(e.divId),r({op:"display",divId:e.divId})}catch(t){o("define failed",e.divId,t)}})},refresh:function(e,i){var a=t[e];
1return!!a&&(s(function(){try{Object.keys(i).forEach(function(e){return a.setTargeting(e,i[e])}),n().pubads().refresh([a]),r({op:"refresh",divId:e,kv:i})}catch(t){o("refresh failed",e,t)}}),!0)},updateTargeting:function(e,i){var n=t[e];return!!n&&(s(function(){try{Object.keys(i).forEach(function(e){return n.setTargeting(e,i[e])}),r({op:"targeting",divId:e,kv:i})}catch(t){o("updateTargeting failed",e,t)}}),!0)},destroy:function(e){var i=t[e];return!!i&&(delete t[e],s(function(){try{n().destroySlots([i]),r({op:"destroy",divId:e})}catch(t){o("destroy failed",e,t)}}),!0)},has:function(e){return Boolean(t[e])},findExternalSlots:function(e){var i=[];try{n().pubads().getSlots().forEach(function(r){var n=r.getSlotElementId();if(!t[n]){var s=e(n);if(s){var o=r.getTargetingMap()||{},a={};Object.keys(o).forEach(function(e){a[e]=o[e]}),i.push({divId:n,path:r.getAdUnitPath(),slotname:s.slotname,sponsored:Boolean(s.sponsorId)||Boolean(o.sponlineitemid),targeting:a}),t[n]=r}}})}catch(e){o("findExternalSlots failed",e)}return i},onRendered:function(e){s(function(){try{n().pubads().addEventListener("slotRenderEnded",function(t){try{if(t.serviceName&&t.serviceName!==Ua)return;e({divId:t.slot.getSlotElementId(),isEmpty:Boolean(t.isEmpty),size:(i=t.size,Array.isArray(i)&&"number"==typeof i[0]&&"number"==typeof i[1]?[i[0],i[1]]:null),lineItemId:t.lineItemId,advertiserId:t.advertiserId})}catch(e){o("slotRenderEnded handler failed",e)}var i})}catch(e){o("onRendered failed",e)}})},onViewable:function(e){s(function(){try{n().pubads().addEventListener("impressionViewable",function(t){try{if(t.serviceName&&t.serviceName!==Ua)return;e(t.slot.getSlotElementId())}catch(e){o("impressionViewable handler failed",e)}})}catch(e){o("onViewable failed",e)}})},requestLog:i}}var Ba="equinenetworkad",Wa="ap-native-wrapper",Va="ap-feed-ad";function Ga(e){var t=e.dataset;return{classes:Array.prototype.slice.call(e.classList),sizedesktop:t.sizedesktop,sizetablet:t.sizetablet,sizemobile:t.sizemobile,sizes:t.sizes,align:t.align,popup:t.popup,sponsorid:t.sponsorid,slotname:t.slotname,pos:t.pos,engamLi:t.engamLi,fluid:t.fluid,schedOff:Boolean(e.closest(".engam-car-sched[data-engam-sched-off]")),claimed:Boolean(e.querySelector("div[id]"))}}function Ya(e){e.setAttribute("data-ap-slot",""),e.classList.remove(Ba),e.classList.add(Wa)}function Ja(e,t){e.setAttribute("data-ap-placement",t.placement),e.setAttribute("data-ap-page-number",String(t.pageNumber)),e.setAttribute("data-ap-post-index",String(t.postIndex)),t.feedRule&&e.setAttribute("data-ap-feed-rule",t.feedRule),t.slotname&&e.setAttribute("data-ap-slotname",t.slotname)}function Ka(e){var t=e.getBoundingClientRect();return Number.isFinite(t.height)?t.height:0}function Xa(){for(var e,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];"undefined"!=typeof console&&console.debug&&(e=console).debug.apply(e,["[ap-feed-ads]"].concat(i))}function Za(e){var t=e.win||window,i=e.doc||t.document,r=e.now||function(){return Date.now()},n=e.config,s=function(e){var t=e.equinenetwork_gam_v2_id;return"string"==typeof t&&""!==t?t:null}(t);if(!s)return Xa("no equinenetwork_gam_v2_id on this page; feed ads inactive"),null;var o,a=e.gpt||za(t),l=n.refresh.enabled,c={insertedByRule:{},nativeActivated:0,contentHeightPx:(o={contentHeightPx:e.landingElement?Ka(e.landingElement):0})&&o.contentHeightPx?o.contentHeightPx:0,adHeightPx:0,slots:[]},u={slots:{},hidden:!1,lastEnteredIndex:-1},d={},p=[],h=null;function f(e){if(l)try{var t=Na(u,e,n.refresh);u=t.state,t.decisions.forEach(function(e){if("refresh"!==e.type){if(null!==h&&(clearTimeout(h),h=null),null!==e.at){var t=Math.max(0,e.at-r());h=setTimeout(function(){h=null,f({type:"tick",now:r()})},t)}}else a.refresh(e.divId,e.targeting)})}catch(e){Xa("refresh policy failed",e)}}function g(e,t){l&&(f({type:"slot:registered",divId:e.divId,kind:e.placement,slotname:e.slotname,sponsored:e.sponsored,baseTargeting:e.targeting}),p.push(function(t){if("undefined"==typeof IntersectionObserver)return function(){};var i=new IntersectionObserver(function(t){return t.forEach(function(t){return i=t.intersectionRatio,f({type:"slot:inview",divId:e.divId,ratio:i,now:r()});var i})},{threshold:[0,.5]});return i.observe(t),function(){return i.disconnect()}}(t)))}function _(e,t){p.push(function(e,t,i){if("undefined"==typeof IntersectionObserver)return i(),function(){};var r=new IntersectionObserver(function(e){e.some(function(e){return e.isIntersecting})&&(r.disconnect(),i())},{rootMargin:"0px 0px ".concat(t,"px 0px"),threshold:0});return r.observe(e),function(){return r.disconnect()}}(t,n.lazy.fetch_margin_px,function(){return a.define(e)}))}return a.onRendered(function(e){try{e.isEmpty?function(e,t){var i=e.getElementById(t);if(i){var r=i.closest(".".concat(Va));if(r){r.classList.add("ap-feed-ad--empty"),r.setAttribute("data-ap-empty","1"),r.style.minHeight="0",r.style.height="20px";var n=i.parentElement;n&&(n.style.minHeight="0")}}}(i,e.divId):function(e,t,i){var r=e.getElementById(t);if(r){var n=r.parentElement,s=r.closest(".".concat(Va)),o=i?"".concat(i[1],"px"):"";if(s)s.style.minHeight=o,n&&(n.style.minHeight=o);else{var a=r.closest(".".concat(Ba));a&&(a.style.minHeight="")}}}(i,e.divId,e.size)}catch(t){Xa("render settle failed",e.divId,t)}
1f({type:"slot:rendered",divId:e.divId,isEmpty:e.isEmpty,now:r()})}),a.onViewable(function(e){return f({type:"slot:viewable",divId:e,now:r()})}),p.push(e.bus.on("post:entered",function(e){var t=e.postIndex;return f({type:"post:entered",postIndex:t,post:d[t]||null,now:r()})})),p.push(e.bus.on("visibility",function(e){return f({type:"page:hidden",hidden:e.hidden,now:r()})})),l&&n.refresh.persistent.on_post_enter&&n.refresh.persistent.include_slotnames.length&&function(e,t){"loading"===e.readyState?e.addEventListener("DOMContentLoaded",t,{once:!0}):t()}(i,function(){a.ready(function(){var e=n.refresh.persistent.include_slotnames,t=a.findExternalSlots(function(t){var r=i.getElementById(t),n=r?r.closest(".equinenetworkad"):null,s=n&&n.dataset.slotname?n.dataset.slotname:null;return s&&-1!==e.indexOf(s)?{slotname:s,sponsorId:n&&n.dataset.sponsorid?n.dataset.sponsorid:null}:null});t.forEach(function(e){var t=i.getElementById(e.divId);t&&function(e,t){e.setAttribute("data-ap-placement","persistent"),t&&e.setAttribute("data-ap-slotname",t)}(t,e.slotname),f({type:"slot:registered",divId:e.divId,kind:"persistent",slotname:e.slotname,sponsored:e.sponsored,baseTargeting:e.targeting})}),t.length&&Xa("persistent slots adopted",t.map(function(e){return e.divId}))})}),{afterPostAppended:function(e){try{var r=function(e,t){return{index:e,id:t.id,url:t.url,aiCategory:t.ai_category||"",aiSubCategory:t.ai_sub_category||"",categories:Array.isArray(t.categories)?t.categories.slice():[],subcategories:Array.isArray(t.subcategories)?t.subcategories.slice():[],sponsorId:t.sponsor_id||null}}(e.postIndex,e.post);d[e.postIndex]=r;var o=(m=e.wrapper,Array.prototype.slice.call(m.querySelectorAll(".".concat(Ba,":not([data-ap-slot])")))),a=o.map(Ga);o.forEach(Ya);var l=function(e){return e.innerWidth||e.document.documentElement.clientWidth||0}(t),u=(f=l,v=n.device,Number.isFinite(f)?f>=v.desktop_min?"desktop":f>=v.tablet_min?"tablet":"mobile":"mobile"),p={postHeightPx:Ka(e.element),viewportWidth:l},h=Ia(c,r,a,u,p,n,{networkPrefix:s});return c=h.nextState,h.activate.forEach(function(e){var t=e.spec,i=e.wrapperIndex,r=function(e,t){e.classList.remove(Wa),e.classList.add(Ba);var i=e.ownerDocument.createElement("div");i.setAttribute("align",t.align);var r=e.ownerDocument.createElement("div");return r.id=t.divId,r.style.textAlign=t.align,r.setAttribute("align",t.align),Ja(r,t),i.appendChild(r),e.appendChild(i),t.reservedHeightPx>0&&(e.style.minHeight="".concat(t.reservedHeightPx,"px")),r}(o[i],t);_(t,r),g(t,r)}),h.insert.forEach(function(t){var r=function(e,t){var i=e.createElement("div");i.className=Va,i.setAttribute("data-ap-placement","feed"),i.setAttribute("data-ap-post-index",String(t.postIndex)),i.setAttribute("data-ap-page-number",String(t.pageNumber)),t.feedRule&&i.setAttribute("data-ap-feed-rule",t.feedRule),i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="flex-start",i.style.width="100%",i.style.boxSizing="border-box",i.style.margin="20px 0",t.reservedHeightPx>0&&(i.style.minHeight="".concat(t.reservedHeightPx,"px")),t.fullWidth&&(i.style.width="100vw",i.style.maxWidth="100vw",i.style.marginLeft="calc(50% - 50vw)",i.style.marginRight="calc(50% - 50vw)");var r=e.createElement("div");r.className="ap-feed-ad__sizer",r.style.textAlign="center",t.reservedWidthPx>0&&(r.style.minWidth="".concat(t.reservedWidthPx,"px")),t.reservedHeightPx>0&&(r.style.minHeight="".concat(t.reservedHeightPx,"px"));var n=e.createElement("div");return n.id=t.divId,Ja(n,t),r.appendChild(n),i.appendChild(r),{container:i,slot:n}}(i,t),n=r.container,s=r.slot;e.wrapper.insertAdjacentElement("afterend",n),_(t,s),g(t,s)}),h.skipped.length&&Xa("skipped",e.postIndex,h.skipped),{adInserted:h.insert.length>0}}catch(e){return Xa("afterPostAppended failed",e),{adInserted:!1}}var f,v,m},get planner(){return c},get refresh(){return u},destroy:function(){null!==h&&clearTimeout(h),h=null,p.forEach(function(e){try{e()}catch(e){}}),p.length=0}}}function Qa(e){return Qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qa(e)}function el(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function tl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
1t%2?el(Object(i),!0).forEach(function(t){il(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):el(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function il(e,t,i){return(t=function(e){var t=function(e){if("object"!=Qa(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=Qa(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qa(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function rl(e){var t,i=function(){if("undefined"==typeof window||"undefined"==typeof performance)return null;var e,t=performance.getEntriesByType?performance.getEntriesByType("navigation"):[],i=t.length>0?t[0]:null;if(i&&"number"==typeof(e=i).responseStart&&"number"==typeof e.requestStart){var r=i.responseStart-i.requestStart;if(Number.isFinite(r)&&r>=0)return Math.round(r)}if(performance.timing&&performance.timing.responseStart&&performance.timing.requestStart){var n=performance.timing.responseStart-performance.timing.requestStart;if(Number.isFinite(n)&&n>=0)return Math.round(n)}return null}();if(null!==i){var r=null!==(t=artificial_poets_script_data.processing_time_ms)&&void 0!==t?t:0,n={ttfb_ms:i,processing_time_ms:r,total_ms:r+i,path:"".concat(window.location.pathname).concat(window.location.search),post_id:artificial_poets_script_data.post_id,post_type:artificial_poets_script_data.post_type,site_id:artificial_poets_script_data.site_id,organization_id:artificial_poets_script_data.organization_id};"post"!==artificial_poets_script_data.post_type||artificial_poets_script_data.is_category||!artificial_poets_script_data.infinite_scroll_enabled||artificial_poets_script_data.is_search||(n.loaded_by="wp"),e.capture("$pageview",n)}}function nl(e){return nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nl(e)}function sl(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function ol(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sl(Object(i),!0).forEach(function(t){al(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sl(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function al(e,t,i){return(t=function(e){var t=function(e){if("object"!=nl(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=nl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ll=["pos","content-type","ai_category","ai_sub_category","sponlineitemid","engam_li","refresh","refresh_seq"],cl="publisher_ads",ul="__apSignalsGamImpressions";function dl(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]?{ad_size:e[0]+"x"+e[1],ad_width:e[0],ad_height:e[1]}:"string"==typeof e&&""!==e?{ad_size:e,ad_width:null,ad_height:null}:{ad_size:"unknown",ad_width:null,ad_height:null}}function pl(e){try{var t=document.getElementById(e),i=t?t.querySelector("iframe"):null,r=i?parseInt(i.getAttribute("width")||"",10):NaN,n=i?parseInt(i.getAttribute("height")||"",10):NaN;if(Number.isFinite(r)&&Number.isFinite(n))return dl([r,n])}catch(e){}return dl(null)}function hl(e,t){return{line_item_id:e&&null!=e.lineItemId?e.lineItemId:null,creative_id:e&&null!=e.creativeId?e.creativeId:null,advertiser_id:e&&null!=e.advertiserId?e.advertiserId:null,campaign_id:e&&null!=e.campaignId?e.campaignId:null,is_backfill:t}}function fl(e,t,i){var r={ad_unit_path:null,ad_slot_id:null};try{r.ad_unit_path=e.getAdUnitPath()}catch(e){}try{r.ad_slot_id=e.getSlotElementId()}catch(e){}var n={};try{n=e.getTargetingMap()||{}}catch(e){}var s=function(e){var t;try{var i=document.getElementById(e);t=i?i.dataset:void 0}catch(e){}var r=t&&t.apPageNumber?parseInt(t.apPageNumber,10):Number.NaN;return{placement:t&&t.apPlacement?t.apPlacement:null,feed_rule:t&&t.apFeedRule?t.apFeedRule:null,ad_page_number:Number.isFinite(r)?r:null}}(String(r.ad_slot_id||""));return r.placement=s.placement,r.feed_rule=s.feed_rule,r.ad_page_number=s.ad_page_number,i.forEac
1h(function(e){var i=n[e];if(!i||0===i.length)try{i=t.getTargeting(e)}catch(e){i=[]}i&&i.length>0&&(r[function(e){return"targeting_"+e.toLowerCase().replace(/[^a-z0-9]+/g,"_")}(e)]=String(i[0]).slice(0,100))}),r}var gl={type:"gam_impressions",init:function(e){if("undefined"!=typeof window&&"undefined"!=typeof document){var t=function(){var e=window;return e.googletag||(e.googletag={cmd:[]}),e.googletag}(),i=t;if(!i[ul]){i[ul]=!0;var r=e.options,n=Array.isArray(r.capture)?r.capture:["rendered","viewable"],s=-1!==n.indexOf("rendered"),o=-1!==n.indexOf("viewable"),a=!0===r.include_empty,l=Array.isArray(r.targeting_keys)?r.targeting_keys.filter(function(e){return"string"==typeof e&&""!==e}):ll,c=new Map;t.cmd.push(function(){var i;try{i=t.pubads()}catch(e){return}if(i&&"function"==typeof i.addEventListener){i.addEventListener("slotRenderEnded",function(t){try{if(t.serviceName&&t.serviceName!==cl)return;var r=function(e){var t=c.get(e)||{seq:0,viewable:new Set};return t.seq+=1,c.set(e,t),t}(t.slot.getSlotElementId());if(t.isEmpty)return void(a&&e.capture("$ad_slot_empty",ol(ol({},fl(t.slot,i,l)),{},{render_seq:r.seq})));if(!s)return;e.capture("$ad_impression",ol(ol(ol(ol({},fl(t.slot,i,l)),hl(t,!0===t.isBackfill)),dl(t.size)),{},{render_seq:r.seq,late:!1}))}catch(t){e.debug("slotRenderEnded handler failed",t)}}),o&&i.addEventListener("impressionViewable",function(t){try{if(t.serviceName&&t.serviceName!==cl)return;var r=t.slot.getSlotElementId(),n=c.get(r),s=n||{seq:1,viewable:new Set};if(n||c.set(r,s),s.viewable.has(s.seq))return;s.viewable.add(s.seq);var o=null;try{o=t.slot.getResponseInformation()}catch(e){}e.capture("$ad_impression_viewable",ol(ol(ol(ol({},fl(t.slot,i,l)),hl(o,null)),pl(r)),{},{render_seq:s.seq,orphan:!n}))}catch(t){e.debug("impressionViewable handler failed",t)}});var r=0,n=[];try{n=i.getSlots()||[]}catch(e){n=[]}n.forEach(function(t){try{var n=t.getSlotElementId();if(c.has(n))return;var o=t.getResponseInformation();if(!o)return;if(c.set(n,{seq:1,viewable:new Set}),r+=1,!s)return;e.capture("$ad_impression",ol(ol(ol(ol({},fl(t,i,l)),hl(o,null)),pl(n)),{},{render_seq:1,late:!0}))}catch(t){e.debug("late scan failed for a slot",t)}}),e.debug("attached",{late_slots:r,rendered:s,viewable:o,include_empty:a})}})}}}};const _l=gl;function vl(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function ml(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?vl(Object(i),!0).forEach(function(t){yl(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):vl(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function yl(e,t,i){return(t=function(e){var t=function(e){if("object"!=bl(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=bl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function bl(e){return bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bl(e)}function wl(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return El(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?El(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function El(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}var xl=/^\$?[a-z][a-z0-9_]{0,63}$/,Sl=new WeakMap;function kl(e){return String(null==e?"":e).toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,40)}function Ol(e,t){for(var i=e.classList,r=0;r<i.length;r++){var n=i[r];if(n.length>t.length&&0===n.indexOf(t)){var s=kl(n.slice(t.length));if(""!==s)return s}}return null}
1function Pl(){var e=globalThis.artificial_poets_script_data;return e&&"object"===bl(e)?e:{}}function Il(e){var t="number"==typeof e?e:parseInt(String(null==e?"":e),10);return Number.isFinite(t)&&t>0?t:null}function Tl(e){var t=e.closest("[data-post-index]"),i=t?parseInt(t.getAttribute("data-post-index")||"",10):Number.NaN;return t&&Number.isFinite(i)&&i>0?{article_post_id:Il(t.getAttribute("data-post-id")),article_position:"appended",article_index:i}:{article_post_id:Il(Pl().post_id),article_position:"landing",article_index:0}}const Al={type:"ui_clicks",init:function(e){if("undefined"!=typeof window&&"undefined"!=typeof document&&!Sl.has(document)){var t=e.options,i=function(e,t){if(!Array.isArray(e))return[];var i,r=[],n=wl(e);try{for(n.s();!(i=n.n()).done;){var s=i.value;if(r.length>=20)break;if(s&&"object"===bl(s)){var o=s,a="string"==typeof o.selector?o.selector.trim():"",l=kl(o.action);if(""!==a&&""!==l){try{t.querySelector(a)}catch(e){continue}var c="string"==typeof o.detail_class_prefix?o.detail_class_prefix:"";r.push(""!==c?{selector:a,action:l,detail_class_prefix:c}:{selector:a,action:l})}}}}catch(e){n.e(e)}finally{n.f()}return r}(t.rules,document);if(0!==i.length){var r="string"==typeof t.event&&xl.test(t.event)?t.event:"$article_action",n=new WeakMap,s=function(t,s){try{if(!(t instanceof Element))return;var o,a=wl(i);try{for(a.s();!(o=a.n()).done;){var l=o.value,c=t.closest(l.selector);if(c){var u=Date.now(),d=n.get(c);if(void 0!==d&&u-d<500)return;n.set(c,u);var p=l.detail_class_prefix?Ol(c,l.detail_class_prefix):null;return void e.capture(r,ml(ml({action:p?l.action+"_"+p:l.action,action_group:l.action,action_detail:p},Tl(c)),{},{input:s,logged_in:null!==Il(Pl().user_id)}))}}}catch(e){a.e(e)}finally{a.f()}}catch(t){e.debug("click not recorded",t)}},o={click:function(e){s(e.target,0===e.detail?"keyboard":"pointer")},keydown:function(e){var t=e;t.repeat||"Enter"!==t.key&&" "!==t.key||t.target instanceof Element&&t.target.closest("a[href], button, input, select, textarea, summary")||s(t.target,"keyboard")}};document.addEventListener("click",o.click,!0),document.addEventListener("keydown",o.keydown,!0),Sl.set(document,o),e.debug("attached",{rules:i.length,event:r})}else e.debug("no usable rules; not attached")}}};function Rl(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function $l(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Rl(Object(i),!0).forEach(function(t){Fl(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Rl(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Cl(e){return Cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cl(e)}function Fl(e,t,i){return(t=function(e){var t=function(e){if("object"!=Cl(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=Cl(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Cl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Ml,jl=Fl(Fl({},_l.type,_l),Al.type,Al);function Nl(){if("undefined"!=typeof console&&"function"==typeof console.debug){for(var e,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];(e=console).debug.apply(e,["[ap-signals]"].concat(i))}}function Dl(){var e=window.artificialPoetsInfiniteScroll,t=e&&"number"==typeof e.pageNumber?e.pageNumber:1;return Number.isFinite(t)&&t>=1?t:1}So.init(artificial_poets_script_data.POSTHOG_API_KEY,{api_host:"https://us.i.posthog.com",person_profiles:"always",capture_pageview:!1,properties:{site_domain:artificial_poets_script_data.site_domain,site_name:artificial_poets_script_data.site_name,site:artificial_poet
1s_script_data.site_id,organization:artificial_poets_script_data.organization_id}}),So.group("organization",artificial_poets_script_data.organization_id,{name:artificial_poets_script_data.site_name}),So.group("site",artificial_poets_script_data.site_id,{name:artificial_poets_script_data.site_name}),So.group("website",artificial_poets_script_data.website,{name:artificial_poets_script_data.site_name}),artificial_poets_script_data.user_id&&So.identify(artificial_poets_script_data.user_id,{email:artificial_poets_script_data.user_email,name:artificial_poets_script_data.user_name,site_domain:artificial_poets_script_data.site_domain,site_name:artificial_poets_script_data.site_name,site:artificial_poets_script_data.site_id,user_role:artificial_poets_script_data.user_role,wp_user_id:artificial_poets_script_data.user_id,organization:artificial_poets_script_data.organization_id}),function(e){To=e;var t,i,r=(t={},{on:function(e,i){var r=t[e]=t[e]||[];return r.push(i),function(){var e=r.indexOf(i);-1!==e&&r.splice(e,1)}},emit:function(e,i){var r=t[e];r&&r.slice().forEach(function(t){try{t(i)}catch(t){"undefined"!=typeof console&&console.debug&&console.debug("[ap-infinite-scroll] listener failed",e,t)}})}}),n=function(e,t,i){var r={version:1,on:i.on};return Object.defineProperty(r,"currentPostIndex",{get:function(){return t.currentPostIndex},enumerable:!0}),Object.defineProperty(r,"pageNumber",{get:function(){return t.currentPostIndex+1},enumerable:!0}),Object.defineProperty(r,"postCount",{get:function(){return t.postCount},enumerable:!0}),e.artificialPoetsInfiniteScroll=Object.freeze(r),t}(window,{currentPostIndex:0,postCount:1},r),s=parseInt(artificial_poets_script_data.post_id.toString(),10);if("post"===artificial_poets_script_data.post_type&&!artificial_poets_script_data.is_category&&artificial_poets_script_data.infinite_scroll_enabled&&!artificial_poets_script_data.is_search){var o,a,l,c=function(){var e=function(){for(var e=window.innerHeight/2,t=P.length-1;t>0;t-=1){var i,r=null===(i=P[t].element)||void 0===i?void 0:i.getBoundingClientRect();if(r&&r.height>0&&r.top<=e)return t}return 0}(),t=P[e];e!==S&&t&&t.url&&(S=e,u(t.url,e,t.id,t.title,e+1,t.proximityRatio,t.source))},u=function(t,i,s,o,a,l,c){var u=Date.now(),d=Math.max(0,u-O),p=Math.max(0,u-k);O=u,n.currentPostIndex=i,r.emit("post:entered",{postIndex:i,pageNumber:a,postId:s,url:t,title:o}),window.history&&window.history.pushState&&window.history.pushState({},"",t),document.title=o;try{var h={loaded_by:"infinite_scroll",page_number:a,post_type:artificial_poets_script_data.post_type,post_id:s.toString(),post_title:o,post_url:t,post_proximity_ratio:(null==l?void 0:l.toString())||"",recommendation_source:c||"",first_post_id:artificial_poets_script_data.post_id,time_to_page_change_ms:d,cumulative_time_to_page_change_ms:p};e.capture("$pageview",h)}catch(e){}},d=function(){if(!((e={isLoading:w,loadedCount:I.length,maxPosts:v,hidden:document.hidden,pauseWhenHidden:_.pause_when_hidden}).isLoading||e.loadedCount>=e.maxPosts||e.hidden&&e.pauseWhenHidden)){var e;w=!0;var t,i,r,n,s,o,a,l,c,u,d,f=artificial_poets_script_data.endpoints,g="dwell"===_.seed_strategy?(t=I,i=P.map(function(e){return e.id}),c=y,u=Date.now(),d=$o({},c.accumulatedMs),Object.keys(c.activeSince).forEach(function(e){var t=Number(e);d[t]=(d[t]||0)+Math.max(0,u-c.activeSince[t])}),r=d,n=S,s=new Set(t),o=i.map(function(e,t){return{id:e,index:t}}).filter(function(e){return s.has(e.id)}).sort(function(e,t){if(e.index===n)return-1;if(t.index===n)return 1;var i=(r[t.index]||0)-(r[e.index]||0);return 0!==i?i:e.index-t.index}).map(function(e){return e.id}),a=new Set(o),l=t.filter(function(e){return!a.has(e)}),o.concat(l)):I,m=function(e,t,i){var r=t.map(function(e){return"post_ids[]=".concat(e)}).join("&"),n="".concat(e.wpAddress,"/wp-json/").concat(e.namespace).concat(e.route,"?").concat(r);return null===i?n:"".concat(n,"&limit=").concat(i)}({wpAddress:artificial_poets_script_data.wp_address,namespace:null==f?void 0:f.NAMESPACE_V1,route:null==f?void 0:f.INFINITE_SCROLL_GET_NEXT_POSTS},g,_.limit);fetch(m,{method:"GET",cache:"default"}).then(function(e){if(!e.ok)throw new Error("HTTP error! status: ".concat(e.status));return e.json()}).then(function(e){var t="string"==typeof e.source&&e.source?e.source:"unknown";e.success&&e.posts&&Array.isArray(e.posts)&&e.posts.length>
10?(e.posts.forEach(function(e){I.includes(e.id)||(I.push(e.id),T.push(tl(tl({},e),{},{resolvedSource:"string"==typeof e.source&&e.source?e.source:t})))}),P.length<=1&&T.length>0&&p(),h(),console.log("Recommendations buffered: ".concat(T.length," ready, ").concat(I.length,"/").concat(v," claimed"))):console.warn("No posts to load or invalid response")}).catch(function(e){console.error("Error loading posts:",e)}).finally(function(){w=!1})}},p=function(){var e;if(0!==T.length){var t=T.shift(),i=P.length,s=t.proximityRatio?parseFloat(t.proximityRatio):void 0,o=t.resolvedSource,a=document.querySelector('[data-elementor-type="single-post"]'),c=(null==a?void 0:a.querySelector(".elementor-section.elementor-top-section"))||a||document.querySelector(".post_content")||document.querySelector("main")||document.querySelector(".site-main")||document.querySelector("#main")||document.querySelector(".content-area")||(null===(e=document.querySelector("article"))||void 0===e?void 0:e.parentElement)||document.body,u=document.querySelector(".infinite-scroll-posts-container");if(u||((u=document.createElement("div")).className="infinite-scroll-posts-container",c.appendChild(u)),A){var p=document.createElement("div");p.className="infinite-scroll-post-separator",p.style.height="20px",p.style.width="100%",u.appendChild(p),A=!1}var f=document.createElement("div");f.className="infinite-scroll-post-wrapper",f.setAttribute("data-post-index",i.toString()),f.setAttribute("data-post-id",t.id.toString()),f.setAttribute("data-post-url",t.url),f.setAttribute("data-post-title",t.title),void 0!==s&&f.setAttribute("data-post-proximity-ratio",s.toString()),f.setAttribute("data-post-source",o),f.innerHTML=t.html;var g=f.querySelector(".infinite-scroll-post")||f.querySelector("article")||f.querySelector('[data-elementor-type="single-post"]')||f.firstElementChild;g&&(g.setAttribute("data-post-index",i.toString()),g.setAttribute("data-post-id",t.id.toString()),g.setAttribute("data-post-url",t.url),g.setAttribute("data-post-title",t.title),void 0!==s&&g.setAttribute("data-post-proximity-ratio",s.toString()),g.setAttribute("data-post-source",o)),P.push({id:t.id,url:t.url,title:t.title,proximityRatio:s,source:o,element:g||f}),n.postCount=P.length,u.appendChild(f),Do(f,'.infinite-scroll-post-wrapper[data-post-index="'.concat(i,'"]'));var _={postIndex:i,pageNumber:i+1,post:t,element:g||f,wrapper:f,container:u},v=l.afterPostAppended(_);v.adInserted||(A=!0),r.emit("post:appended",tl(tl({},_),{},{adInserted:v.adInserted})),x&&x.observe(g||f),h(),T.length<=m&&d()}else d()},h=function(){if(E&&(E.disconnect(),E=null),0===T.length&&I.length>=v)console.log("Maximum posts limit reached (".concat(v,"). Stopping infinite scroll."));else{var e=P[P.length-1];e&&e.element&&(E=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&p()})},{rootMargin:b,threshold:0})).observe(e.element)}},f=artificial_poets_script_data.infinite_scroll_ads,g=function(e){var t=[];if(!ca(e))return{config:null,warnings:t};if(1!==e.version)return t.push("unsupported config version ".concat(JSON.stringify(e.version))),{config:null,warnings:t};if(!0!==da(e.enabled,!1))return{config:null,warnings:t};var i={},r=Array.isArray(e.feed)?e.feed:[],n=[];r.forEach(function(e,r){var s=function(e,t,i,r){if(!ca(e))return i.push("feed[".concat(t,"]: not an object")),null;var n="string"==typeof e.name?e.name:"";if(!la.test(n))return i.push("feed[".concat(t,"]: invalid name ").concat(JSON.stringify(e.name))),null;if(r[n])return i.push("feed[".concat(t,']: duplicate name "').concat(n,'"')),null;var s=ha(e.desktop),o=ha(e.mobile);if(!s||!o)return i.push("feed[".concat(t,'] "').concat(n,'": needs valid desktop and mobile sizes')),null;var a=ha(e.tablet),l="mobile"===e.only||"desktop"===e.only?e.only:null;void 0!==e.only&&null!==e.only&&null===l&&i.push("feed[".concat(t,'] "').concat(n,'": unknown only ').concat(JSON.stringify(e.only),", ignored"));var c=ca(e.unit)?e.unit:{},u="string"==typeof c.slotname&&""!==c.slotname?c.slotname:null,d=!!ca(e.mobile)&&da(e.mobile.full_width,!1);r[n]=!0;var p=a?{sizes:a}:null;return{name:n,every:ua(e.every,1,100,2),offset:ua(e.offset,0,100,0),unit:{slotname:u},desktop:{sizes:s},tablet:p,mobile:{sizes:o,full_width:d},only:l,max_ads:ua(e.max_ads,0,100,20)}}(e,r,t,i);s&&n.push(s)});var s=ca(e.device)?e.device:{},o=ua(s.tablet_min,1,4e3,ia.tablet_min),a=Math.max(o,ua(s.desktop_min,1,8e3,ia.desktop_min)),l=ca(e.density)?e.density:{},c=ca(e.lazy)?e.lazy:{},u=ca(e.targeting)?e.targeting:{};return{config:{version:1,enabled:!0,native:fa(e.native),feed:n,device:{desktop_min:a,tablet_min:o},density:{mobile_max_pct:ua(l.mobile_max_pct,0,100,ra.mobile_max_pct)},lazy:{fetch_margin_px:ua(c.fetch_margin_px,0,1e5,na.fetch_margin_px)},targeting:{pos:"string"==typeof u.pos&&""!==u.pos?u.pos:sa.pos},refresh:ga(e.refresh),batch:_a(e.batch)},warnings:t}}(f&&f.enabled?f.config:null).config,_=(i=g)?i.batch:Fo,v=_.max_posts,m=_.prefetch_at,y={activeSince:{},accumulatedMs:{}},b="0px 0px 1500px 0px",w=!1,E=null,x=null,S=0,k=Date.now(),O=Date.now(),P=[],I=[],T=[],A=!1;!function(){var e=document.querySelector('[data-elementor-type="single-post"]')||document.querySelector("article")||document.querySelector(".post_content")||document.querySelector("main");if(e){var t,i=e.querySelector("h1, h2, .entry-title, .post-title"),r=i&&(null===(t=i.textContent)||void 0===t?void 0:t.trim())||document.title,n={id:s,url:window.location.href,title:r,element:e};e.setAttribute("data-post-index","0"),e.setAttribute("data-post-id",n.id.toString()),e.setAttribute("data-post-url",n.url),e.setAttribute("data-post-title",n.title),P.push(n),I.push(s),x&&x.observe(e)}}(),x&&x.disconnect(),x=new IntersectionObserver(function(e){e.forEach(function(e){var t,i,r,n=parseInt(e.target.getAttribute("data-post-index")||"0"),s=Date.now();y=e.isIntersecting&&e.intersectionRatio>=.1?(i=n,r=s,void 0!==(t=y).activeSince[i]?t:{activeSince:$o($o({},t.activeSince),{},Co({},i,r)),accumulatedMs:t.accumulatedMs}):function(e,t,i){var r=e.activeSince[t];if(void 0===r)return e;var n=$o({},e.activeSince);return delete n[t],{activeSince:n,accumulatedMs:$o($o({},e.accumulatedMs),{},Co({},t,(e.accumulatedMs[t]||0)+Math.max(0,i-r)))}}(y,n,s)}),c()},{root:null,rootMargin:"0px",threshold:[.1,.5,.9]}),P.forEach(function(e){var t;e.element&&(null===(t=x)||void 0===t||t.observe(e.element))}),l=g&&Za({config:g,bus:r,landingElement:null!==(o=null===(a=P[0])||void 0===a?void 0:a.element)&&void 0!==o?o:null}
1)||Mo(artificial_poets_script_data.gam_stacker),document.addEventListener("visibilitychange",function(){r.emit("visibility",{hidden:document.hidden}),_.pause_when_hidden&&!document.hidden&&T.length<=m&&d()}),d(),h();var R=null;window.addEventListener("scroll",function(){R||(R=setTimeout(function(){R=null,c()},100))})}}(So),Ml=So,"undefined"!=typeof window&&("complete"===document.readyState?rl(Ml):window.addEventListener("load",function(){return rl(Ml)},{once:!0}));var Ll=artificial_poets_script_data.signals;!function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Math.random,r=[];if("undefined"==typeof window)return r;try{if(!t||"object"!==Cl(t)||!Array.isArray(t.signals))return r;if(1!==t.version)return Nl("unsupported config version",t.version,"- nothing started"),r;t.signals.forEach(function(t){if(t&&"string"==typeof t.type&&!1!==t.enabled){var n=jl[t.type];if(n){var s=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Math.random,r=t.options&&"object"===Cl(t.options)?t.options:{},n=function(e){var t="number"==typeof e?e:Number(e);return!Number.isFinite(t)||t<=0||t>1?1:t}(r.sample_rate),s=n>=1||i()<n;return{type:t.type,options:r,sampled:s,sampleRate:n,capture:function(i,r){if(s)try{var o,a,l,c="undefined"!=typeof artificial_poets_script_data?artificial_poets_script_data:{};e.capture(i,$l($l({},r||{}),{},{signal:t.type,signal_version:1,sample_rate:n,page_url:window.location.origin+window.location.pathname,page_number:Dl(),post_id:null!==(o=c.post_id)&&void 0!==o?o:null,post_type:null!==(a=c.post_type)&&void 0!==a?a:null,plugin_version:null!==(l=c.plugin_version)&&void 0!==l?l:null}))}catch(e){Nl(t.type,"capture failed",e)}},debug:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return Nl.apply(void 0,[t.type+":"].concat(i))}}}(e,t,i);if(s.sampled)try{n.init(s),r.push(t.type)}catch(e){Nl(t.type,"init failed",e)}else Nl(t.type,"not sampled on this page load (rate "+s.sampleRate+")")}else Nl('unknown signal type "'+t.type+'" ignored')}})}catch(e){Nl("init failed",e)}window.artificialPoetsSignals={version:1,active:r.slice()}}(So,Ll&&Ll.enabled?Ll.config:null)})(); 2//# sourceMappingURL=frontend-index-init.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.