@askdialog/dialog-vue 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dialog-vue.js +525 -524
- package/dist/dialog-vue.umd.cjs +4 -4
- package/package.json +3 -3
package/dist/dialog-vue.umd.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(Ee,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],v):(Ee=typeof globalThis<"u"?globalThis:Ee||self,v(Ee["dialog-vue"]={},Ee.Vue))})(this,(function(Ee,v){"use strict";var
|
|
2
|
-
`),o=s;o<a.length;o++){var l=a[o];if(!(l.length>1024)){var c=mr.test(l)?l.replace(mr,"$1"):l;if(!c.match(/\S*Error: /)){for(var u of e){var d=u(c);if(d){n.push(d);break}}if(n.length>=yr)break}}}return(function(f){if(!f.length)return[];var p=Array.from(f);return p.reverse(),p.slice(0,yr).map((g=>{return E({},g,{filename:g.filename||(_=p,_[_.length-1]||{}).filename,function:g.function||He});var _}))})(n)}}class An{constructor(e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i=[]),this.coercers=e,this.modifiers=i,this.stackParser=Mn(...t)}buildFromUnknown(e,t){t===void 0&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(),a=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var t=this;return ur((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&F(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:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return e.cause!=null&&(i=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),E({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map((i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i)))}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 ur((function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i}))()}convertToExceptionList(e,t){var i,s,n,a={type:e.type,value:e.value,mechanism:{type:(i=t.type)!==null&&i!==void 0?i:"generic",handled:(s=t.handled)===null||s===void 0||s,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,E({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:Pn(this.stackParser)}}buildCoercingContext(e,t,i){i===void 0&&(i=0);var s=(n,a)=>{if(a<=4){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return E({},t,{syntheticException:i==0?t.syntheticException:void 0,mechanism:e,apply:n=>s(n,i),next:n=>s(n,i+1)})}}class Nn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=B(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 Ft(e,"DOMException")}isDOMError(e){return Ft(e,"DOMError")}}class Ln{match(e){return(t=>t 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&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class Bn{constructor(){}match(e){return Ft(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var i,s=t.apply(e.error);return s||{type:"ErrorEvent",value:e.message,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}var Un=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class qn{match(e){return typeof e=="string"}coerce(e,t){var i,[s,n]=this.getInfos(e);return{type:s??"Error",value:n??e,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(Un);return s&&(t=s[1],i=s[2]),[t,i]}}var jn=["fatal","error","warning","log","info","debug"];function br(r,e){e===void 0&&(e=40);var t=Object.keys(r);if(t.sort(),!t.length)return"[object has no keys]";for(var i=t.length;i>0;i--){var s=t.slice(0,i).join(", ");if(!(s.length>e))return i===t.length||s.length<=e?s:s.slice(0,e)+"..."}return""}class Vn{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(i=t.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return gr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+br(e)}isSeverityLevel(e){return B(e)&&!ai(e)&&jn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(Cn(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class Hn{match(e){return gr(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+br(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Gn{match(e){return oi(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Wn{match(e){return Ft(e,"PromiseRejectionEvent")}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return oi(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){if(oi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var wr=r=>{var e={k:function(t){if(h&&(ge.DEBUG||x.POSTHOG_DEBUG)&&!m(h.console)&&h.console){for(var i=("__rrweb_original__"in h.console[t])?h.console[t].__rrweb_original__:h.console[t],s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];i(r,...n)}},info:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(r,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>wr(r+" "+t)};return e},b=wr("[PostHog.js]"),U=b.createLogger,zn=U("[ExternalScriptsLoader]"),Er=(r,e,t)=>{if(r.config.disable_external_dependency_loading)return zn.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=y==null?void 0:y.querySelectorAll("script");if(i){for(var s,n=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,t(void 0,c)})),l.onerror=c=>t(c),{v:void 0})}},a=0;a<i.length;a++)if(s=n())return s.v}var o=()=>{if(!y)return t("document not found");var l=y.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,t(void 0,d)},l.onerror=d=>t(d),r.config.prepare_external_dependency_script&&(l=r.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");var c,u=y.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):y.body.appendChild(l)};y!=null&&y.body?o():y==null||y.addEventListener("DOMContentLoaded",o)};x.__PosthogExtensions__=x.__PosthogExtensions__||{},x.__PosthogExtensions__.loadExternalDependency=(r,e,t)=>{var i="/static/"+e+".js?v="+r.version;if(e==="remote-config"&&(i="/array/"+r.config.token+"/config.js"),e==="toolbar"){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}var n=r.requestRouter.endpointFor("assets",i);Er(r,n,t)},x.__PosthogExtensions__.loadSiteApp=(r,e,t)=>{var i=r.requestRouter.endpointFor("api",e);Er(r,i,t)};var Rt={};function Se(r,e,t){if(F(r)){if(ar&&r.forEach===ar)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,s=r.length;i<s;i++)if(i in r&&e.call(t,r[i],i)===Rt)return}}}function O(r,e,t){if(!R(r)){if(F(r))return Se(r,e,t);if(wn(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===Rt)return}else for(var s in r)if(fr.call(r,s)&&e.call(t,r[s],s)===Rt)return}}var A=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Se(t,(function(s){for(var n in s)s[n]!==void 0&&(r[n]=s[n])})),r},Ge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Se(t,(function(s){Se(s,(function(n){r.push(n)}))})),r};function Dt(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var kr=function(r){try{return r()}catch{return}},Yn=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(s){b.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),b.critical(s)}}},di=function(r){var e={};return O(r,(function(t,i){(B(t)&&t.length>0||oe(t))&&(e[i]=t)})),e};function Xn(r,e){return t=r,i=n=>B(n)&&!_e(e)?n.slice(0,e):n,s=new Set,(function n(a,o){return a!==Object(a)?i?i(a,o):a:s.has(a)?void 0:(s.add(a),F(a)?(l=[],Se(a,(c=>{l.push(n(c))}))):(l={},O(a,((c,u)=>{s.has(c)||(l[u]=n(c,u))}))),l);var l})(t);var t,i,s}var Kn=["herokuapp.com","vercel.app","netlify.app"];function Jn(r){var e=r==null?void 0:r.hostname;if(!B(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of Kn)if(t===i)return!1;return!0}function xr(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}function L(r,e,t,i){var{capture:s=!1,passive:n=!0}=i??{};r==null||r.addEventListener(e,t,{capture:s,passive:n})}var Sr="$people_distinct_id",nt="__alias",at="__timers",Cr="$autocapture_disabled_server_side",hi="$heatmaps_enabled_server_side",Pr="$exception_capture_enabled_server_side",pi="$error_tracking_suppression_rules",$r="$error_tracking_capture_extension_exceptions",Ir="$web_vitals_enabled_server_side",Tr="$dead_clicks_enabled_server_side",Fr="$web_vitals_allowed_metrics",fi="$session_recording_remote_config",Mt="$sesid",Or="$session_is_sampled",We="$enabled_feature_flags",ot="$early_access_features",gi="$feature_flag_details",lt="$stored_person_properties",Me="$stored_group_properties",_i="$surveys",At="$surveys_activated",Nt="$flag_call_reported",ve="$user_state",vi="$client_session_props",mi="$capture_rate_limit",yi="$initial_campaign_params",bi="$initial_referrer_info",Lt="$initial_person_info",Bt="$epp",Rr="__POSTHOG_TOOLBAR__",ct="$posthog_cookieless",Zn=[Sr,nt,"__cmpns",at,"$session_recording_enabled_server_side",hi,Mt,We,pi,ve,ot,gi,Me,lt,_i,Nt,vi,mi,yi,bi,Bt,Lt];function Dr(r){return r instanceof Element&&(r.id===Rr||!(r.closest==null||!r.closest(".toolbar-global-fade-container")))}function Ut(r){return!!r&&r.nodeType===1}function Ce(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function Mr(r){return!!r&&r.nodeType===3}function Ar(r){return!!r&&r.nodeType===11}function wi(r){return r?It(r).split(/\s+/):[]}function Nr(r){var e=h==null?void 0:h.location.href;return!!(e&&r&&r.some((t=>e.match(t))))}function qt(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return wi(e)}function Lr(r){return R(r)?null:It(r).split(/(\s+)/).filter((e=>dt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ut(r){var e="";return xi(r)&&!Gr(r)&&r.childNodes&&r.childNodes.length&&O(r.childNodes,(function(t){var i;Mr(t)&&t.textContent&&(e+=(i=Lr(t.textContent))!==null&&i!==void 0?i:"")})),It(e)}function Br(r){return m(r.target)?r.srcElement||null:(e=r.target)!=null&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var Ei=["a","button","form","input","select","textarea","label"];function Ur(r,e){if(m(e))return!0;var t,i=function(n){if(e.some((a=>n.matches(a))))return{v:!0}};for(var s of r)if(t=i(s))return t.v;return!1}function qr(r){var e=r.parentNode;return!(!e||!Ut(e))&&e}var Qn=["next","previous","prev",">","<"],jr=10,Vr=[".ph-no-rageclick",".ph-no-capture"];function ea(r,e){if(!h||ki(r))return!1;var t,i,s;if(xe(e)?(t=!!e&&Vr,i=void 0):(t=(s=e==null?void 0:e.css_selector_ignorelist)!==null&&s!==void 0?s:Vr,i=e==null?void 0:e.content_ignorelist),t===!1)return!1;var{targetElementList:n}=Hr(r,!1);return!(function(a,o){if(a===!1||m(a))return!1;var l;if(a===!0)l=Qn;else{if(!F(a))return!1;if(a.length>jr)return b.error("[PostHog] content_ignorelist array cannot exceed "+jr+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return o.some((c=>{var{safeText:u,ariaLabel:d}=c;return l.some((f=>u.includes(f)||d.includes(f)))}))})(i,n.map((a=>{var o;return{safeText:ut(a).toLowerCase(),ariaLabel:((o=a.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!Ur(n,t)}var ki=r=>!r||Ce(r,"html")||!Ut(r),Hr=(r,e)=>{if(!h||ki(r))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,i=[r],s=r;s.parentNode&&!Ce(s,"body");)if(Ar(s.parentNode))i.push(s.parentNode.host),s=s.parentNode.host;else{var n=qr(s);if(!n)break;if(e||Ei.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var a=h.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}i.push(n),s=n}return{parentIsUsefulElement:t,targetElementList:i}};function ta(r,e,t,i,s){var n,a,o,l;if(t===void 0&&(t=void 0),!h||ki(r)||(n=t)!=null&&n.url_allowlist&&!Nr(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&Nr(t.url_ignorelist))return!1;if((o=t)!=null&&o.dom_event_allowlist){var c=t.dom_event_allowlist;if(c&&!c.some((g=>e.type===g)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=Hr(r,i);if(!(function(g,_){var w=_==null?void 0:_.element_allowlist;if(m(w))return!0;var k,S=function(P){if(w.some((N=>P.tagName.toLowerCase()===N)))return{v:!0}};for(var I of g)if(k=S(I))return k.v;return!1})(d,t)||!Ur(d,(l=t)==null?void 0:l.css_selector_allowlist))return!1;var f=h.getComputedStyle(r);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=r.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return u?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(Ei.indexOf(p)>-1||r.getAttribute("contenteditable")==="true")}}function xi(r){for(var e=r;e.parentNode&&!Ce(e,"body");e=e.parentNode){var t=qt(e);if(C(t,"ph-sensitive")||C(t,"ph-no-capture"))return!1}if(C(qt(r),"ph-include"))return!0;var i=r.type||"";if(B(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var s=r.name||r.id||"";return!(B(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Gr(r){return!!(Ce(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||Ce(r,"select")||Ce(r,"textarea")||r.getAttribute("contenteditable")==="true")}var Wr="(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})",ia=new RegExp("^(?:"+Wr+")$"),ra=new RegExp(Wr),zr="\\d{3}-?\\d{2}-?\\d{4}",sa=new RegExp("^("+zr+")$"),na=new RegExp("("+zr+")");function dt(r,e){return e===void 0&&(e=!0),!(R(r)||B(r)&&(r=It(r),(e?ia:ra).test((r||"").replace(/[- ]/g,""))||(e?sa:na).test(r)))}function Yr(r){var e=ut(r);return dt(e=(e+" "+Xr(r)).trim())?e:""}function Xr(r){var e="";return r&&r.childNodes&&r.childNodes.length&&O(r.childNodes,(function(t){var i;if(t&&((i=t.tagName)==null?void 0:i.toLowerCase())==="span")try{var s=ut(t);e=(e+" "+s).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Xr(t)).trim())}catch(n){b.error("[AutoCapture]",n)}})),e}function aa(r){return(function(e){var t=e.map((i=>{var s,n,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))a+="."+o.replace(/"/g,"");var l=E({},i.text?{text:i.text}:{},{"nth-child":(s=i.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(n=i.nth_of_type)!==null&&n!==void 0?n:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return Dt(l).sort(((u,d)=>{var[f]=u,[p]=d;return f.localeCompare(p)})).forEach((u=>{var[d,f]=u;return c[Kr(d.toString())]=Kr(f.toString())})),a+=":",a+=Dt(c).map((u=>{var[d,f]=u;return d+'="'+f+'"'})).join("")}));return t.join(";")})((function(e){return e.map((t=>{var i,s,n={text:(i=t.$el_text)==null?void 0:i.slice(0,400),tag_name:t.tag_name,href:(s=t.attr__href)==null?void 0:s.slice(0,2048),attr_class:oa(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dt(t).filter((a=>{var[o]=a;return o.indexOf("attr__")===0})).forEach((a=>{var[o,l]=a;return n.attributes[o]=l})),n}))})(r))}function Kr(r){return r.replace(/"|\\"/g,'\\"')}function oa(r){var e=r.attr__class;return e?F(e)?e:wi(e):void 0}class Jr{constructor(e){this.disabled=e===!1;var t=q(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 s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&i-s.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 Si="$copy_autocapture",me=(function(r){return r.GZipJS="gzip-js",r.Base64="base64",r})({}),jt=r=>{var e=y==null?void 0:y.createElement("a");return m(e)?null:(e.href=r,e)},la=function(r,e){var t,i;e===void 0&&(e="&");var s=[];return O(r,(function(n,a){m(n)||m(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(n)?n.name:n.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+t)})),s.join(e)},Vt=function(r,e){for(var t,i=((r.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<i.length;s++){var n=i[s].split("=");if(n[0]===e){t=n;break}}if(!F(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{b.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},ht=function(r,e,t){if(!r||!e||!e.length)return r;for(var i=r.split("#"),s=i[0]||"",n=i[1],a=s.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],d=0;d<c.length;d++){var f=c[d].split("=");F(f)&&(e.includes(f[0])?u.push(f[0]+"="+t):u.push(c[d]))}var p=l;return o!=null&&(p+="?"+u.join("&")),n!=null&&(p+="#"+n),p},Ht=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Zr=U("[AutoCapture]");function Ci(r,e){return e.length>r?e.slice(0,r)+"...":e}function ca(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!Ut(e));return e}function ua(r,e,t,i){var s=r.tagName.toLowerCase(),n={tag_name:s};Ei.indexOf(s)>-1&&!t&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?n.$el_text=Ci(1024,Yr(r)):n.$el_text=Ci(1024,ut(r)));var a=qt(r);a.length>0&&(n.classes=a.filter((function(u){return u!==""}))),O(r.attributes,(function(u){var d;if((!Gr(r)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&dt(u.value)&&(d=u.name,!B(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=u.value;u.name==="class"&&(f=wi(f).join(" ")),n["attr__"+u.name]=Ci(1024,f)}}));for(var o=1,l=1,c=r;c=ca(c);)o++,c.tagName===r.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}function da(r,e){for(var t,i,{e:s,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,c=[r],u=r;u.parentNode&&!Ce(u,"body");)Ar(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,f=[],p={},g=!1,_=!1;if(O(c,(P=>{var N=xi(P);P.tagName.toLowerCase()==="a"&&(g=P.getAttribute("href"),g=N&&g&&dt(g)&&g),C(qt(P),"ph-no-capture")&&(_=!0),f.push(ua(P,n,a,o));var ne=(function(J){if(!xi(J))return{};var $={};return O(J.attributes,(function(de){if(de.name&&de.name.indexOf("data-ph-capture-attribute")===0){var Z=de.name.replace("data-ph-capture-attribute-",""),ae=de.value;Z&&ae&&dt(ae)&&($[Z]=ae)}})),$})(P);A(p,ne)})),_)return{props:{},explicitNoCapture:_};if(a||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?f[0].$el_text=Yr(r):f[0].$el_text=ut(r)),g){var w,k;f[0].attr__href=g;var S=(w=jt(g))==null?void 0:w.host,I=h==null||(k=h.location)==null?void 0:k.host;S&&I&&S!==I&&(d=g)}return{props:A({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:aa(f)},(t=f[0])!=null&&t.$el_text?{$el_text:(i=f[0])==null?void 0:i.$el_text}:{},d&&s.type==="click"?{$external_click_url:d}:{},p)}}class ha{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new Jr(e.config.rageclick),this.R=null}get C(){var e,t,i=q(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((s=>new RegExp(s))),i.url_ignorelist=(t=i.url_ignorelist)==null?void 0:t.map((s=>new RegExp(s))),i}O(){if(this.isBrowserSupported()){if(h&&y){var e=i=>{i=i||(h==null?void 0:h.event);try{this.F(i)}catch(s){Zr.error("Failed to capture event",s)}};if(L(y,"submit",e,{capture:!0}),L(y,"change",e,{capture:!0}),L(y,"click",e,{capture:!0}),this.C.capture_copied_text){var t=i=>{i=i||(h==null?void 0:h.event),this.F(i,Si)};L(y,"copy",t,{capture:!0}),L(y,"cut",t,{capture:!0})}}}else Zr.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.O(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Cr]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.R=e}getElementSelectors(e){var t,i=[];return(t=this.R)==null||t.forEach((s=>{var n=y==null?void 0:y.querySelectorAll(s);n==null||n.forEach((a=>{e===a&&i.push(s)}))})),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)==null?void 0:e.props[Cr],s=this.T;if(_e(s)&&!xe(i)&&!this.instance.M())return!1;var n=(t=this.T)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!n}F(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var i,s=Br(e);Mr(s)&&(s=s.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&ea(s,this.instance.config.rageclick)&&this.F(e,"$rageclick");var n=t===Si;if(s&&ta(s,e,this.C,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=da(s,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.C.element_attribute_ignorelist,elementsChainAsString:this.I});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===Si){var c,u=Lr(h==null||(c=h.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return ke(y==null?void 0:y.querySelectorAll)}}Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return oe(r)&&isFinite(r)&&Math.floor(r)===r});var Qr="0123456789abcdef";class Gt{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>1073741823||s>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]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new Gt(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Qr.charAt(this.bytes[t]>>>4)+Qr.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Gt(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}class pa{constructor(){this.A=0,this.D=0,this.j=new fa}generate(){var e=this.generateOrAbort();if(m(e)){this.A=0;var t=this.generateOrAbort();if(m(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return Gt.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var es,ts=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};h&&!m(h.crypto)&&crypto.getRandomValues&&(ts=r=>crypto.getRandomValues(r));class fa{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(ts(this.N),this.U=0),this.N[this.U++]}}var Pe=()=>ga().toString(),ga=()=>(es||(es=new pa)).generate(),pt="",_a=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function va(r,e){if(e){var t=(function(s,n){if(n===void 0&&(n=y),pt)return pt;if(!n||["localhost","127.0.0.1"].includes(s))return"";for(var a=s.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Pe();!pt&&o--;){var c=a.slice(o).join("."),u=l+"=1;domain=."+c+";path=/";n.cookie=u+";max-age=3",n.cookie.includes(l)&&(n.cookie=u+";max-age=0",pt=c)}return pt})(r);if(!t){var i=(s=>{var n=s.match(_a);return n?n[0]:""})(r);i!==t&&b.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var ce={H:()=>!!y,B:function(r){b.error("cookieStore error: "+r)},q:function(r){if(y){try{for(var e=r+"=",t=y.cookie.split(";").filter((n=>n.length)),i=0;i<t.length;i++){for(var s=t[i];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},W:function(r){var e;try{e=JSON.parse(ce.q(r))||{}}catch{}return e},G:function(r,e,t,i,s){if(y)try{var n="",a="",o=va(y.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}s&&(a="; secure");var c=r+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return c.length>3686.4&&b.warn("cookieStore warning: large cookie, len="+c.length),y.cookie=c,c}catch{return}},V:function(r,e){if(y!=null&&y.cookie)try{ce.G(r,"",-1,e)}catch{return}}},Pi=null,M={H:function(){if(!_e(Pi))return Pi;var r=!0;if(m(h))r=!1;else try{var e="__mplssupport__";M.G(e,"xyz"),M.q(e)!=='"xyz"'&&(r=!1),M.V(e)}catch{r=!1}return r||b.error("localStorage unsupported; falling back to cookie store"),Pi=r,r},B:function(r){b.error("localStorage error: "+r)},q:function(r){try{return h==null?void 0:h.localStorage.getItem(r)}catch(e){M.B(e)}return null},W:function(r){try{return JSON.parse(M.q(r))||{}}catch{}return null},G:function(r,e){try{h==null||h.localStorage.setItem(r,JSON.stringify(e))}catch(t){M.B(t)}},V:function(r){try{h==null||h.localStorage.removeItem(r)}catch(e){M.B(e)}}},ma=["distinct_id",Mt,Or,Bt,Lt],Wt=E({},M,{W:function(r){try{var e={};try{e=ce.W(r)||{}}catch{}var t=A(e,JSON.parse(M.q(r)||"{}"));return M.G(r,t),t}catch{}return null},G:function(r,e,t,i,s,n){try{M.G(r,e,void 0,void 0,n);var a={};ma.forEach((o=>{e[o]&&(a[o]=e[o])})),Object.keys(a).length&&ce.G(r,a,t,i,s,n)}catch(o){M.B(o)}},V:function(r,e){try{h==null||h.localStorage.removeItem(r),ce.V(r,e)}catch(t){M.B(t)}}}),zt={},ya={H:function(){return!0},B:function(r){b.error("memoryStorage error: "+r)},q:function(r){return zt[r]||null},W:function(r){return zt[r]||null},G:function(r,e){zt[r]=e},V:function(r){delete zt[r]}},Ae=null,j={H:function(){if(!_e(Ae))return Ae;if(Ae=!0,m(h))Ae=!1;else try{var r="__support__";j.G(r,"xyz"),j.q(r)!=='"xyz"'&&(Ae=!1),j.V(r)}catch{Ae=!1}return Ae},B:function(r){b.error("sessionStorage error: ",r)},q:function(r){try{return h==null?void 0:h.sessionStorage.getItem(r)}catch(e){j.B(e)}return null},W:function(r){try{return JSON.parse(j.q(r))||null}catch{}return null},G:function(r,e){try{h==null||h.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){j.B(t)}},V:function(r){try{h==null||h.sessionStorage.removeItem(r)}catch(e){j.B(e)}}},ye=(function(r){return r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED",r})({});class ba{constructor(e){this._instance=e}get C(){return this._instance.config}get consent(){return this.J()?ye.DENIED:this.K}isOptedOut(){return this.C.cookieless_mode==="always"||this.consent===ye.DENIED||this.consent===ye.PENDING&&(this.C.opt_out_capturing_by_default||this.C.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ye.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.C.cookie_expiration,this.C.cross_subdomain_cookie,this.C.secure_cookie)}reset(){this.Y.V(this.X,this.C.cross_subdomain_cookie)}get X(){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 K(){var e=this.Y.q(this.X);return li(e)?ye.GRANTED:C(xn,e)?ye.DENIED:ye.PENDING}get Y(){if(!this.Z){var e=this.C.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?M:ce;var t=e==="localStorage"?ce:M;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(li(t.q(this.X))),t.V(this.X,this.C.cross_subdomain_cookie))}return this.Z}J(){return!!this.C.respect_dnt&&!!xr([K==null?void 0:K.doNotTrack,K==null?void 0:K.msDoNotTrack,x.doNotTrack],(e=>li(e)))}}var Yt=U("[Dead Clicks]"),wa=()=>!0,Ea=r=>{var e,t=!((e=r.instance.persistence)==null||!e.get_property(Tr)),i=r.instance.config.capture_dead_clicks;return xe(i)?i:t};class is{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Tr]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Yt.error("failed to load script",s):e()}))}et(){var e;if(y){if(!this.tt&&(e=x.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=q(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=x.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(y),Yt.info("starting...")}}else Yt.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Yt.info("stopping..."))}}var ft=U("[ExceptionAutocapture]");class ka{constructor(e){var t,i,s;this.rt=()=>{var n;if(h&&this.isEnabled&&(n=x.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var a=x.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=x.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=x.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.C.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.C.capture_unhandled_rejections&&(this.nt=o(this.captureException.bind(this))),!this.ot&&this.C.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){ft.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((t=this._instance.persistence)==null||!t.props[Pr]),this.C=this.ht(),this.dt=new Sn({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,h:ft}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return q(e)?t=E({},t,e):(m(e)?this.ut:e)&&(t=E({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.C.capture_console_errors||this.C.capture_unhandled_errors||this.C.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(ft.info("enabled"),this.it(this.rt))}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(s=>{if(s)return ft.error("failed to load script",s);e()}))}lt(){var e,t,i;(e=this.st)==null||e.call(this),this.st=void 0,(t=this.nt)==null||t.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ut=!!t||!1,this.C=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Pr]:this.ut}),this.startIfEnabled()}captureException(e){var t,i,s=(t=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&t!==void 0?t:"Exception";this.dt.consumeRateLimit(s)?ft.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(e)}}function rs(r,e,t){try{if(!(e in r))return()=>{};var i=r[e],s=t(i);return ke(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),r[e]=s,()=>{r[e]=i}}catch{return()=>{}}}class xa{constructor(e){var t;this._instance=e,this.vt=(h==null||(t=h.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(b.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,b.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(h&&h.history){var i=this;(e=h.history.pushState)!=null&&e.__posthog_wrapped__||rs(h.history,"pushState",(s=>function(n,a,o){s.call(this,n,a,o),i.ft("pushState")})),(t=h.history.replaceState)!=null&&t.__posthog_wrapped__||rs(h.history,"replaceState",(s=>function(n,a,o){s.call(this,n,a,o),i.ft("replaceState")})),this.gt()}}ft(e){try{var t,i=h==null||(t=h.location)==null?void 0:t.pathname;if(!i)return;i!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.vt=i}catch(s){b.error("Error capturing "+e+" pageview",s)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};L(h,"popstate",e),this.ct=()=>{h&&h.removeEventListener("popstate",e)}}}}var $i=U("[SegmentIntegration]");function Sa(r,e){var t=r.config.segment;if(!t)return e();(function(i,s){var n=i.config.segment;if(!n)return s();var a=l=>{var c=()=>l.anonymousId()||Pe();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(ve,"identified")),s()},o=n.user();"then"in o&&ke(o.then)?o.then((l=>a(l))):a(o)})(r,(()=>{t.register((i=>{Promise&&Promise.resolve||$i.warn("This browser does not have Promise support, and can not use the segment integration");var s=(n,a)=>{if(!a)return n;n.event.userId||n.event.anonymousId===i.get_distinct_id()||($i.info("No userId set, resetting PostHog"),i.reset()),n.event.userId&&n.event.userId!==i.get_distinct_id()&&($i.info("UserId set, identifying with PostHog"),i.identify(n.event.userId));var o=i.calculateEventProperties(a,n.event.properties);return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>s(n,n.event.event),page:n=>s(n,"$pageview"),identify:n=>s(n,"$identify"),screen:n=>s(n,"$screen")}})(r)).then((()=>{e()}))}))}var ss="posthog-js";function ns(r,e){var{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,c,u,d,f;if(!(n==="*"||n.includes(o.level))||!r.__loaded)return o;o.tags||(o.tags={});var p=r.requestRouter.endpointFor("ui","/project/"+r.config.token+"/person/"+r.get_distinct_id());o.tags["PostHog Person URL"]=p,r.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var g=((l=o.exception)==null?void 0:l.values)||[],_=g.map((k=>E({},k,{stacktrace:k.stacktrace?E({},k.stacktrace,{type:"raw",frames:(k.stacktrace.frames||[]).map((S=>E({},S,{platform:"web:javascript"})))}):void 0}))),w={$exception_message:((c=g[0])==null?void 0:c.value)||o.message,$exception_type:(u=g[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((d=g[0])==null?void 0:d.value)||o.message,$sentry_exception_type:(f=g[0])==null?void 0:f.type,$sentry_tags:o.tags};return t&&i&&(w.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),a&&r.exceptions.sendExceptionEvent(w),o}}class Ca{constructor(e,t,i,s,n,a){this.name=ss,this.setupOnce=function(o){o(ns(e,{organization:t,projectId:i,prefix:s,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}var Pa=h!=null&&h.location?Ht(h.location.hash,"__posthog")||Ht(location.hash,"state"):null,as="_postHogToolbarParams",os=U("[Toolbar]"),$e=(function(r){return r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED",r})($e||{});class $a{constructor(e){this.instance=e}_t(e){x.ph_toolbar_state=e}yt(){var e;return(e=x.ph_toolbar_state)!==null&&e!==void 0?e:$e.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),!h||!y)return!1;e=e??h.location,i=i??h.history;try{if(!t){try{h.localStorage.setItem("test","test"),h.localStorage.removeItem("test")}catch{return!1}t=h==null?void 0:h.localStorage}var s,n=Pa||Ht(e.hash,"__posthog")||Ht(e.hash,"state"),a=n?kr((()=>JSON.parse(atob(decodeURIComponent(n)))))||kr((()=>JSON.parse(decodeURIComponent(n)))):null;return a&&a.action==="ph_authorize"?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(as)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}bt(e){var t=x.ph_load_toolbar||x.ph_load_editor;!R(t)&&ke(t)?t(e,this.instance):os.warn("No toolbar load function found")}loadToolbar(e){var t=!(y==null||!y.getElementById(Rr));if(!h||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=E({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(h.localStorage.setItem(as,JSON.stringify(E({},s,{source:void 0}))),this.yt()===$e.LOADED)this.bt(s);else if(this.yt()===$e.UNINITIALIZED){var n;this._t($e.LOADING),(n=x.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return os.error("[Toolbar] Failed to load",a),void this._t($e.UNINITIALIZED);this._t($e.LOADED),this.bt(s)})),L(h,"turbolinks:load",(()=>{this._t($e.UNINITIALIZED),this.loadToolbar(s)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var Ia=U("[TracingHeaders]");class Ta{constructor(e){this.xt=void 0,this.$t=void 0,this.rt=()=>{var t,i;m(this.xt)&&((t=x.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),m(this.$t)&&((i=x.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(s=>{if(s)return Ia.error("failed to load script",s);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(t=this.$t)==null||t.call(this),this.xt=void 0,this.$t=void 0)}}var ee="Mobile",Xt="iOS",ue="Android",gt="Tablet",ls=ue+" "+gt,cs="iPad",us="Apple",ds=us+" Watch",_t="Safari",ze="BlackBerry",hs="Samsung",ps=hs+"Browser",fs=hs+" Internet",Ne="Chrome",Fa=Ne+" OS",gs=Ne+" "+Xt,Ii="Internet Explorer",_s=Ii+" "+ee,Ti="Opera",Oa=Ti+" Mini",Fi="Edge",vs="Microsoft "+Fi,Ye="Firefox",ms=Ye+" "+Xt,vt="Nintendo",mt="PlayStation",Xe="Xbox",ys=ue+" "+ee,bs=ee+" "+_t,yt="Windows",Oi=yt+" Phone",ws="Nokia",Ri="Ouya",Es="Generic",Ra=Es+" "+ee.toLowerCase(),ks=Es+" "+gt.toLowerCase(),Di="Konqueror",H="(\\d+(\\.\\d+)?)",Mi=new RegExp("Version/"+H),Da=new RegExp(Xe,"i"),Ma=new RegExp(mt+" \\w+","i"),Aa=new RegExp(vt+" \\w+","i"),Ai=new RegExp(ze+"|PlayBook|BB10","i"),Na={"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"},La=(r,e)=>e&&C(e,us)||(function(t){return C(t,_t)&&!C(t,Ne)&&!C(t,ue)})(r),xs=function(r,e){return e=e||"",C(r," OPR/")&&C(r,"Mini")?Oa:C(r," OPR/")?Ti:Ai.test(r)?ze:C(r,"IE"+ee)||C(r,"WPDesktop")?_s:C(r,ps)?fs:C(r,Fi)||C(r,"Edg/")?vs:C(r,"FBIOS")?"Facebook "+ee:C(r,"UCWEB")||C(r,"UCBrowser")?"UC Browser":C(r,"CriOS")?gs:C(r,"CrMo")||C(r,Ne)?Ne:C(r,ue)&&C(r,_t)?ys:C(r,"FxiOS")?ms:C(r.toLowerCase(),Di.toLowerCase())?Di:La(r,e)?C(r,ee)?bs:_t:C(r,Ye)?Ye:C(r,"MSIE")||C(r,"Trident/")?Ii:C(r,"Gecko")?Ye:""},Ba={[_s]:[new RegExp("rv:"+H)],[vs]:[new RegExp(Fi+"?\\/"+H)],[Ne]:[new RegExp("("+Ne+"|CrMo)\\/"+H)],[gs]:[new RegExp("CriOS\\/"+H)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+H)],[_t]:[Mi],[bs]:[Mi],[Ti]:[new RegExp("(Opera|OPR)\\/"+H)],[Ye]:[new RegExp(Ye+"\\/"+H)],[ms]:[new RegExp("FxiOS\\/"+H)],[Di]:[new RegExp("Konqueror[:/]?"+H,"i")],[ze]:[new RegExp(ze+" "+H),Mi],[ys]:[new RegExp("android\\s"+H,"i")],[fs]:[new RegExp(ps+"\\/"+H)],[Ii]:[new RegExp("(rv:|MSIE )"+H)],Mozilla:[new RegExp("rv:"+H)]},Ua=function(r,e){var t=xs(r,e),i=Ba[t];if(m(i))return null;for(var s=0;s<i.length;s++){var n=i[s],a=r.match(n);if(a)return parseFloat(a[a.length-2])}return null},Ss=[[new RegExp(Xe+"; "+Xe+" (.*?)[);]","i"),r=>[Xe,r&&r[1]||""]],[new RegExp(vt,"i"),[vt,""]],[new RegExp(mt,"i"),[mt,""]],[Ai,[ze,""]],[new RegExp(yt,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Oi,""];if(new RegExp(ee).test(e)&&!/IEMobile\b/.test(e))return[yt+" "+ee,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],s=Na[i]||"";return/arm/i.test(e)&&(s="RT"),[yt,s]}return[yt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[Xt,e.join(".")]}return[Xt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=m(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+ue+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ue+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[ue,e.join(".")]}return[ue,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Fa,""]],[/Linux|debian/i,["Linux",""]]],Cs=function(r){return Aa.test(r)?vt:Ma.test(r)?mt:Da.test(r)?Xe:new RegExp(Ri,"i").test(r)?Ri:new RegExp("("+Oi+"|WPDesktop)","i").test(r)?Oi:/iPad/.test(r)?cs:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?ds:Ai.test(r)?ze:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(ws,"i").test(r)?ws:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(ee).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?ue:ls:ue:new RegExp("(pda|"+ee+")","i").test(r)?Ra:new RegExp(gt,"i").test(r)&&!new RegExp(gt+" pc","i").test(r)?ks:""},Kt="https?://(.*)",Ke=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],qa=Ge(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Ke),bt="<masked>",ja=["li_fat_id"];function Ps(r,e,t){if(!y)return{};var i,s=e?Ge([],Ke,t||[]):[],n=$s(ht(y.URL,s,bt),r),a=(i={},O(ja,(function(o){var l=ce.q(o);i[o]=l||null})),i);return A(a,n)}function $s(r,e){var t=qa.concat(e||[]),i={};return O(t,(function(s){var n=Vt(r,s);i[s]=n||null})),i}function Is(r){var e=(function(n){return n?n.search(Kt+"google.([^/?]*)")===0?"google":n.search(Kt+"bing.com")===0?"bing":n.search(Kt+"yahoo.com")===0?"yahoo":n.search(Kt+"duckduckgo.com")===0?"duckduckgo":null:null})(r),t=e!="yahoo"?"q":"p",i={};if(!_e(e)){i.$search_engine=e;var s=y?Vt(y.referrer,t):"";s.length&&(i.ph_keyword=s)}return i}function Ts(){return navigator.language||navigator.userLanguage}function Fs(){return(y==null?void 0:y.referrer)||"$direct"}function Os(r,e){var t=r?Ge([],Ke,e||[]):[],i=z==null?void 0:z.href.substring(0,1e3);return{r:Fs().substring(0,1e3),u:i?ht(i,t,bt):void 0}}function Rs(r){var e,{r:t,u:i}=r,s={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=jt(t))==null?void 0:e.host};if(i){s.$current_url=i;var n=jt(i);s.$host=n==null?void 0:n.host,s.$pathname=n==null?void 0:n.pathname;var a=$s(i);A(s,a)}if(t){var o=Is(t);A(s,o)}return s}function Ds(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Va(){try{return new Date().getTimezoneOffset()}catch{return}}function Ha(r,e){if(!Y)return{};var t,i,s,n=r?Ge([],Ke,e||[]):[],[a,o]=(function(l){for(var c=0;c<Ss.length;c++){var[u,d]=Ss[c],f=u.exec(l),p=f&&(ke(d)?d(f,l):d);if(p)return p}return["",""]})(Y);return A(di({$os:a,$os_version:o,$browser:xs(Y,navigator.vendor),$device:Cs(Y),$device_type:(i=Y,s=Cs(i),s===cs||s===ls||s==="Kobo"||s==="Kindle Fire"||s===ks?gt:s===vt||s===Xe||s===mt||s===Ri?"Console":s===ds?"Wearable":s?ee:"Desktop"),$timezone:Ds(),$timezone_offset:Va()}),{$current_url:ht(z==null?void 0:z.href,n,bt),$host:z==null?void 0:z.host,$pathname:z==null?void 0:z.pathname,$raw_user_agent:Y.length>1e3?Y.substring(0,997)+"...":Y,$browser_version:Ua(Y,navigator.vendor),$browser_language:Ts(),$browser_language_prefix:(t=Ts(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:h==null?void 0:h.screen.height,$screen_width:h==null?void 0:h.screen.width,$viewport_height:h==null?void 0:h.innerHeight,$viewport_width:h==null?void 0:h.innerWidth,$lib:"web",$lib_version:ge.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Ie=U("[Web Vitals]"),Ms=9e5;class Ga{constructor(e){var t;this.St=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Et=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,s)=>E({},i,{["$web_vitals_"+s.name+"_event"]:E({},s),["$web_vitals_"+s.name+"_value"]:s.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var s,n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(m(n))Ie.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();m(a)||(R(i==null?void 0:i.name)||R(i==null?void 0:i.value)?Ie.error("Invalid metric received",i):this.It&&i.value>=this.It?Ie.error("Ignoring metric with value >= "+this.It,i):(this.N.url!==a&&(this.Et(),this.kt=setTimeout(this.Et,this.flushToCaptureTimeoutMs)),m(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=m(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(E({},i,{$current_url:a,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Et()))}},this.rt=()=>{var i,s,n,a,o=x.__PosthogExtensions__;m(o)||m(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:s,onFCP:n,onINP:a}=o.postHogWebVitalsCallbacks),i&&s&&n&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Ie.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.St=!((t=this._instance.persistence)==null||!t.props[Ir]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=q(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return m(i)?((t=this._instance.persistence)==null?void 0:t.props[Fr])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(q(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get It(){var e=q(this._instance.config.capture_performance)&&oe(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Ms;return 0<e&&e<=6e4?Ms:e}get isEnabled(){var e=z==null?void 0:z.protocol;if(e!=="http:"&&e!=="https:")return Ie.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=q(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:xe(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return xe(t)?t:this.St}startIfEnabled(){this.isEnabled&&!this.P&&(Ie.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=q(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=q(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ir]:t}),this._instance.persistence.register({[Fr]:i})),this.St=t,this.startIfEnabled()}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(s=>{s?Ie.error("failed to load script",s):e()}))}Tt(){var e=h?h.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,s=t?Ge([],Ke,i||[]):[];return ht(e,s,bt)}Ie.error("Could not determine current URL")}}var Wa=U("[Heatmaps]");function As(r){return q(r)&&"clientX"in r&&"clientY"in r&&oe(r.clientX)&&oe(r.clientY)}class za{constructor(e){var t;this.St=!1,this.P=!1,this.Rt=null,this.instance=e,this.St=!((t=this.instance.persistence)==null||!t.props[hi]),this.rageclicks=new Jr(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return q(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 m(this.instance.config.capture_heatmaps)?m(this.instance.config.enable_heatmaps)?this.St:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;Wa.info("starting..."),this.Ct(),this.Ot()}else{var e;clearInterval((e=this.Rt)!==null&&e!==void 0?e:void 0),this.Ft(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[hi]:t}),this.St=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Mt(e){this.At(e.originalEvent,"deadclick")}Ot(){this.Rt&&clearInterval(this.Rt),this.Rt=(function(e){return(e==null?void 0:e.visibilityState)==="visible"})(y)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ct(){h&&y&&(this.jt=this.Dt.bind(this),L(h,"beforeunload",this.jt),this.Lt=e=>this.At(e||(h==null?void 0:h.event)),L(y,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||(h==null?void 0:h.event)),L(y,"mousemove",this.Nt,{capture:!0}),this.zt=new is(this.instance,wa,this.Mt.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ot.bind(this),L(y,"visibilitychange",this.Ht),this.P=!0)}Ft(){var e;h&&y&&(this.jt&&h.removeEventListener("beforeunload",this.jt),this.Lt&&y.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&y.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&y.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=(function(o,l,c){for(var u=o;u&&Ut(u)&&!Ce(u,"body");){if(u===c)return!1;if(C(l,h==null?void 0:h.getComputedStyle(u).position))return!0;u=qr(u)}return!1})(Br(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}At(e,t){var i;if(t===void 0&&(t="click"),!Dr(e.target)&&As(e)){var s=this.qt(e,t);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(E({},s,{type:"rageclick"})),this.Wt(s)}}Ut(e){!Dr(e.target)&&As(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(h){var t=h.location.href,i=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=i?Ge([],Ke,s||[]):[],a=ht(t,n,bt);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!Ve(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ya{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.Gt(e,t);return this.Vt={pathname:(i=h==null?void 0:h.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Gt(e,(t=this.Vt)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,t){var i=this.Vt;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=n;if(!(m(a)||m(o)||m(l)||m(c)||m(u)||m(d))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var f=a<=1?1:le(o/a,0,1,b),p=a<=1?1:le(l/a,0,1,b),g=c<=1?1:le(u/c,0,1,b),_=c<=1?1:le(d/c,0,1,b);s=A(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var te=Uint8Array,X=Uint16Array,Je=Uint32Array,Ni=new te([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]),Li=new te([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]),Ns=new te([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ls=function(r,e){for(var t=new X(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var s=new Je(t[30]);for(i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return[t,s]},Bs=Ls(Ni,2),Xa=Bs[0],Bi=Bs[1];Xa[28]=258,Bi[258]=28;for(var Us=Ls(Li,0)[1],qs=new X(32768),D=0;D<32768;++D){var Le=(43690&D)>>>1|(21845&D)<<1;Le=(61680&(Le=(52428&Le)>>>2|(13107&Le)<<2))>>>4|(3855&Le)<<4,qs[D]=((65280&Le)>>>8|(255&Le)<<8)>>>1}var wt=function(r,e,t){for(var i=r.length,s=0,n=new X(e);s<i;++s)++n[r[s]-1];var a,o=new X(e);for(s=0;s<e;++s)o[s]=o[s-1]+n[s-1]<<1;for(a=new X(i),s=0;s<i;++s)a[s]=qs[o[r[s]-1]++]>>>15-r[s];return a},Be=new te(288);for(D=0;D<144;++D)Be[D]=8;for(D=144;D<256;++D)Be[D]=9;for(D=256;D<280;++D)Be[D]=7;for(D=280;D<288;++D)Be[D]=8;var Jt=new te(32);for(D=0;D<32;++D)Jt[D]=5;var Ka=wt(Be,9),Ja=wt(Jt,5),js=function(r){return(r/8>>0)+(7&r&&1)},Vs=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof X?X:r instanceof Je?Je:te)(t-e);return i.set(r.subarray(e,t)),i},be=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},Et=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},Ui=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});var s=t.length,n=t.slice();if(!s)return[new te(0),0];if(s==1){var a=new te(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort((function(N,ne){return N.f-ne.f})),t.push({s:-1,f:25001});var o=t[0],l=t[1],c=0,u=1,d=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=s-1;)o=t[t[c].f<t[d].f?c++:d++],l=t[c!=u&&t[c].f<t[d].f?c++:d++],t[u++]={s:-1,f:o.f+l.f,l:o,r:l};var f=n[0].s;for(i=1;i<s;++i)n[i].s>f&&(f=n[i].s);var p=new X(f+1),g=qi(t[u-1],p,0);if(g>e){i=0;var _=0,w=g-e,k=1<<w;for(n.sort((function(N,ne){return p[ne.s]-p[N.s]||N.f-ne.f}));i<s;++i){var S=n[i].s;if(!(p[S]>e))break;_+=k-(1<<g-p[S]),p[S]=e}for(_>>>=w;_>0;){var I=n[i].s;p[I]<e?_-=1<<e-p[I]++-1:++i}for(;i>=0&&_;--i){var P=n[i].s;p[P]==e&&(--p[P],++_)}g=e}return[new te(p),g]},qi=function(r,e,t){return r.s==-1?Math.max(qi(r.l,e,t+1),qi(r.r,e,t+1)):e[r.s]=t},Hs=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new X(++e),i=0,s=r[0],n=1,a=function(l){t[i++]=l},o=1;o<=e;++o)if(r[o]==s&&o!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=r[o]}return[t.subarray(0,i),e]},kt=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},ji=function(r,e,t){var i=t.length,s=js(e+2);r[s]=255&i,r[s+1]=i>>>8,r[s+2]=255^r[s],r[s+3]=255^r[s+1];for(var n=0;n<i;++n)r[s+n+4]=t[n];return 8*(s+4+i)},Gs=function(r,e,t,i,s,n,a,o,l,c,u){be(e,u++,t),++s[256];for(var d=Ui(s,15),f=d[0],p=d[1],g=Ui(n,15),_=g[0],w=g[1],k=Hs(f),S=k[0],I=k[1],P=Hs(_),N=P[0],ne=P[1],J=new X(19),$=0;$<S.length;++$)J[31&S[$]]++;for($=0;$<N.length;++$)J[31&N[$]]++;for(var de=Ui(J,7),Z=de[0],ae=de[1],ie=19;ie>4&&!Z[Ns[ie-1]];--ie);var we,he,pe,it,Fe=c+5<<3,je=kt(s,Be)+kt(n,Jt)+a,fe=kt(s,f)+kt(n,_)+a+14+3*ie+kt(J,Z)+(2*J[16]+3*J[17]+7*J[18]);if(Fe<=je&&Fe<=fe)return ji(e,u,r.subarray(l,l+c));if(be(e,u,1+(fe<je)),u+=2,fe<je){we=wt(f,p),he=f,pe=wt(_,w),it=_;var Oe=wt(Z,ae);for(be(e,u,I-257),be(e,u+5,ne-1),be(e,u+10,ie-4),u+=14,$=0;$<ie;++$)be(e,u+3*$,Z[Ns[$]]);u+=3*ie;for(var rt=[S,N],G=0;G<2;++G){var re=rt[G];for($=0;$<re.length;++$){var Q=31&re[$];be(e,u,Oe[Q]),u+=Z[Q],Q>15&&(be(e,u,re[$]>>>5&127),u+=re[$]>>>12)}}}else we=Ka,he=Be,pe=Ja,it=Jt;for($=0;$<o;++$)if(i[$]>255){Q=i[$]>>>18&31,Et(e,u,we[Q+257]),u+=he[Q+257],Q>7&&(be(e,u,i[$]>>>23&31),u+=Ni[Q]);var st=31&i[$];Et(e,u,pe[st]),u+=it[st],st>3&&(Et(e,u,i[$]>>>5&8191),u+=Li[st])}else Et(e,u,we[i[$]]),u+=he[i[$]];return Et(e,u,we[256]),u+he[256]},Za=new Je([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qa=(function(){for(var r=new Je(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r})(),eo=function(r,e,t,i,s){return(function(n,a,o,l,c,u){var d=n.length,f=new te(l+d+5*(1+Math.floor(d/7e3))+c),p=f.subarray(l,f.length-c),g=0;if(!a||d<8)for(var _=0;_<=d;_+=65535){var w=_+65535;w<d?g=ji(p,g,n.subarray(_,w)):(p[_]=u,g=ji(p,g,n.subarray(_,d)))}else{for(var k=Za[a-1],S=k>>>13,I=8191&k,P=(1<<o)-1,N=new X(32768),ne=new X(P+1),J=Math.ceil(o/3),$=2*J,de=function(ir){return(n[ir]^n[ir+1]<<J^n[ir+2]<<$)&P},Z=new Je(25e3),ae=new X(288),ie=new X(32),we=0,he=0,pe=(_=0,0),it=0,Fe=0;_<d;++_){var je=de(_),fe=32767&_,Oe=ne[je];if(N[fe]=Oe,ne[je]=fe,it<=_){var rt=d-_;if((we>7e3||pe>24576)&&rt>423){g=Gs(n,p,0,Z,ae,ie,he,pe,Fe,_-Fe,g),pe=we=he=0,Fe=_;for(var G=0;G<286;++G)ae[G]=0;for(G=0;G<30;++G)ie[G]=0}var re=2,Q=0,st=I,Re=fe-Oe&32767;if(rt>2&&je==de(_-Re))for(var il=Math.min(S,rt)-1,rl=Math.min(32767,_),sl=Math.min(258,rt);Re<=rl&&--st&&fe!=Oe;){if(n[_+re]==n[_+re-Re]){for(var De=0;De<sl&&n[_+De]==n[_+De-Re];++De);if(De>re){if(re=De,Q=Re,De>il)break;var nl=Math.min(Re,De-2),fn=0;for(G=0;G<nl;++G){var tr=_-Re+G+32768&32767,gn=tr-N[tr]+32768&32767;gn>fn&&(fn=gn,Oe=tr)}}}Re+=(fe=Oe)-(Oe=N[fe])+32768&32767}if(Q){Z[pe++]=268435456|Bi[re]<<18|Us[Q];var _n=31&Bi[re],vn=31&Us[Q];he+=Ni[_n]+Li[vn],++ae[257+_n],++ie[vn],it=_+re,++we}else Z[pe++]=n[_],++ae[n[_]]}}g=Gs(n,p,u,Z,ae,ie,he,pe,Fe,_-Fe,g)}return Vs(f,0,l+js(g)+c)})(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!0)},Vi=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8};function to(r,e){e===void 0&&(e={});var t=(function(){var o=4294967295;return{p:function(l){for(var c=o,u=0;u<l.length;++u)c=Qa[255&c^l[u]]^c>>>8;o=c},d:function(){return 4294967295^o}}})(),i=r.length;t.p(r);var s,n=eo(r,e,10+((s=e).filename&&s.filename.length+1||0),8),a=n.length;return(function(o,l){var c=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&Vi(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){o[3]=8;for(var u=0;u<=c.length;++u)o[u+10]=c.charCodeAt(u)}})(n,e),Vi(n,a-8,t.d()),Vi(n,a-4,i),n}var io=function(r){var e,t,i,s,n="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,`
|
|
1
|
+
(function(Ee,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],v):(Ee=typeof globalThis<"u"?globalThis:Ee||self,v(Ee["dialog-vue"]={},Ee.Vue))})(this,(function(Ee,v){"use strict";var $t;(function(r){r.OPEN_ASSISTANT="open_assistant",r.CLOSE_ASSISTANT="close_assistant",r.SEND_MESSAGE="PRODUCT_QUESTION",r.SEND_GENERIC_QUESTION="GENERIC_QUESTION",r.TRACK_ADD_TO_CART="TRACK_ADD_TO_CART",r.TRACK_SUBMIT_CHECKOUT="TRACK_SUBMIT_CHECKOUT"})($t||($t={}));var sr;(function(r){r.USER_OPENED_ASSISTANT="userOpenedAssistant",r.USER_CLOSED_ASSISTANT="userClosedAssistant",r.USER_SENT_MESSAGE="userSentMessage",r.USER_CLICKED_ON_PRODUCT_CARD="userClickedOnProductCard",r.USER_OPENED_RECOMMENDATION="userOpenedRecommendation",r.USER_ADDED_TO_CART="userAddedToCart",r.USER_SEND_POSITIVE_FEEDBACK="userSendPositiveFeedback",r.USER_SEND_NEGATIVE_FEEDBACK="userSendNegativeFeedback"})(sr||(sr={})),$t.TRACK_ADD_TO_CART,$t.TRACK_SUBMIT_CHECKOUT;var h=typeof window<"u"?window:void 0,W=typeof globalThis<"u"?globalThis:h,nr=Array.prototype,ar=nr.forEach,or=nr.indexOf,X=W==null?void 0:W.navigator,y=W==null?void 0:W.document,z=W==null?void 0:W.location,si=W==null?void 0:W.fetch,ni=W!=null&&W.XMLHttpRequest&&"withCredentials"in new W.XMLHttpRequest?W.XMLHttpRequest:void 0,lr=W==null?void 0:W.AbortController,Y=X==null?void 0:X.userAgent,x=h??{},ge={DEBUG:!1,LIB_VERSION:"1.293.0"};function cr(r,e,t,i,s,n,a){try{var o=r[n](a),l=o.value}catch(c){return void t(c)}o.done?e(l):Promise.resolve(l).then(i,s)}function ur(r){return function(){var e=this,t=arguments;return new Promise((function(i,s){var n=r.apply(e,t);function a(l){cr(n,i,s,a,o,"next",l)}function o(l){cr(n,i,s,a,o,"throw",l)}a(void 0)}))}}function E(){return E=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},E.apply(null,arguments)}function dr(r,e){if(r==null)return{};var t={};for(var i in r)if({}.hasOwnProperty.call(r,i)){if(e.indexOf(i)!==-1)continue;t[i]=r[i]}return t}var mn=["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"],hr=function(r,e){if(e===void 0&&(e=[]),!r)return!1;var t=r.toLowerCase();return mn.concat(e).some((i=>{var s=i.toLowerCase();return t.indexOf(s)!==-1}))},yn=["$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"];function C(r,e){return r.indexOf(e)!==-1}var Tt=function(r){return r.trim()},ai=function(r){return r.replace(/^\$/,"")},bn=Array.isArray,pr=Object.prototype,fr=pr.hasOwnProperty,Ft=pr.toString,F=bn||function(r){return Ft.call(r)==="[object Array]"},ke=r=>typeof r=="function",q=r=>r===Object(r)&&!F(r),Ve=r=>{if(q(r)){for(var e in r)if(fr.call(r,e))return!1;return!0}return!1},m=r=>r===void 0,B=r=>Ft.call(r)=="[object String]",oi=r=>B(r)&&r.trim().length===0,_e=r=>r===null,R=r=>m(r)||_e(r),oe=r=>Ft.call(r)=="[object Number]",xe=r=>Ft.call(r)==="[object Boolean]",wn=r=>r instanceof FormData,En=r=>C(yn,r);function li(r){return r===null||typeof r!="object"}function Ot(r,e){return Object.prototype.toString.call(r)==="[object "+e+"]"}function gr(r){return!m(Event)&&(function(e,t){try{return e instanceof t}catch{return!1}})(r,Event)}var kn=[!0,"true",1,"1","yes"],ci=r=>C(kn,r),xn=[!1,"false",0,"0","no"];function le(r,e,t,i,s){return e>t&&(i.warn("min cannot be greater than max."),e=t),oe(r)?r>t?(i.warn(" cannot be greater than max: "+t+". Using max value instead."),t):r<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):r:(i.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+s),le(s||t,e,t,i))}class Sn{constructor(e){this.t={},this.i=e.i,this.o=le(e.bucketSize,0,100,e.h),this.m=le(e.refillRate,0,this.o,e.h),this.$=le(e.refillInterval,0,864e5,e.h)}S(e,t){var i=t-e.lastAccess,s=Math.floor(i/this.$);if(s>0){var n=s*this.m;e.tokens=Math.min(e.tokens+n,this.o),e.lastAccess=e.lastAccess+s*this.$}}consumeRateLimit(e){var t,i=Date.now(),s=String(e),n=this.t[s];return n?this.S(n,i):(n={tokens:this.o,lastAccess:i},this.t[s]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.i)==null||t.call(this,e)),n.tokens===0)}stop(){this.t={}}}var Rt,_r,ui,Cn=r=>r instanceof Error;function Pn(r){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return ui&&t.length===_r||(_r=t.length,ui=t.reduce(((i,s)=>{Rt||(Rt={});var n=Rt[s];if(n)i[n[0]]=n[1];else for(var a=r(s),o=a.length-1;o>=0;o--){var l=a[o],c=l==null?void 0:l.filename,u=e[s];if(c&&u){i[c]=u,Rt[s]=[c,u];break}}return i}),{})),ui}}var He="?";function di(r,e,t,i){var s={platform:"web:javascript",filename:r,function:e==="<anonymous>"?He:e,in_app:!0};return m(t)||(s.lineno=t),m(i)||(s.colno=i),s}var vr=(r,e)=>{var t=r.indexOf("safari-extension")!==-1,i=r.indexOf("safari-web-extension")!==-1;return t||i?[r.indexOf("@")!==-1?r.split("@")[0]:He,t?"safari-extension:"+e:"safari-web-extension:"+e]:[r,e]},In=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,$n=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Fn=r=>{var e=In.exec(r);if(e){var[,t,i,s]=e;return di(t,He,+i,+s)}var n=$n.exec(r);if(n){if(n[2]&&n[2].indexOf("eval")===0){var a=Tn.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}var[o,l]=vr(n[1]||He,n[2]);return di(l,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},On=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,An=r=>{var e=On.exec(r);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=Rn.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var i=e[3],s=e[1]||He;return[s,i]=vr(s,i),di(i,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},mr=/\(error: (.*)\)/,yr=50;function Dn(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(i,s){s===void 0&&(s=0);for(var n=[],a=i.split(`
|
|
2
|
+
`),o=s;o<a.length;o++){var l=a[o];if(!(l.length>1024)){var c=mr.test(l)?l.replace(mr,"$1"):l;if(!c.match(/\S*Error: /)){for(var u of e){var d=u(c);if(d){n.push(d);break}}if(n.length>=yr)break}}}return(function(f){if(!f.length)return[];var p=Array.from(f);return p.reverse(),p.slice(0,yr).map((g=>{return E({},g,{filename:g.filename||(_=p,_[_.length-1]||{}).filename,function:g.function||He});var _}))})(n)}}class Mn{constructor(e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i=[]),this.coercers=e,this.modifiers=i,this.stackParser=Dn(...t)}buildFromUnknown(e,t){t===void 0&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(),a=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var t=this;return ur((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&F(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:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return e.cause!=null&&(i=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),E({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map((i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i)))}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 ur((function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i}))()}convertToExceptionList(e,t){var i,s,n,a={type:e.type,value:e.value,mechanism:{type:(i=t.type)!==null&&i!==void 0?i:"generic",handled:(s=t.handled)===null||s===void 0||s,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,E({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:Pn(this.stackParser)}}buildCoercingContext(e,t,i){i===void 0&&(i=0);var s=(n,a)=>{if(a<=4){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return E({},t,{syntheticException:i==0?t.syntheticException:void 0,mechanism:e,apply:n=>s(n,i),next:n=>s(n,i+1)})}}class Nn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=B(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 Ot(e,"DOMException")}isDOMError(e){return Ot(e,"DOMError")}}class Ln{match(e){return(t=>t 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&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class Bn{constructor(){}match(e){return Ot(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var i,s=t.apply(e.error);return s||{type:"ErrorEvent",value:e.message,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}var Un=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class qn{match(e){return typeof e=="string"}coerce(e,t){var i,[s,n]=this.getInfos(e);return{type:s??"Error",value:n??e,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(Un);return s&&(t=s[1],i=s[2]),[t,i]}}var jn=["fatal","error","warning","log","info","debug"];function br(r,e){e===void 0&&(e=40);var t=Object.keys(r);if(t.sort(),!t.length)return"[object has no keys]";for(var i=t.length;i>0;i--){var s=t.slice(0,i).join(", ");if(!(s.length>e))return i===t.length||s.length<=e?s:s.slice(0,e)+"..."}return""}class Vn{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(i=t.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return gr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+br(e)}isSeverityLevel(e){return B(e)&&!oi(e)&&jn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(Cn(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class Hn{match(e){return gr(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+br(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Gn{match(e){return li(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Wn{match(e){return Ot(e,"PromiseRejectionEvent")}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return li(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){if(li(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var wr=r=>{var e={k:function(t){if(h&&(ge.DEBUG||x.POSTHOG_DEBUG)&&!m(h.console)&&h.console){for(var i=("__rrweb_original__"in h.console[t])?h.console[t].__rrweb_original__:h.console[t],s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];i(r,...n)}},info:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(r,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>wr(r+" "+t)};return e},b=wr("[PostHog.js]"),U=b.createLogger,zn=U("[ExternalScriptsLoader]"),Er=(r,e,t)=>{if(r.config.disable_external_dependency_loading)return zn.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=y==null?void 0:y.querySelectorAll("script");if(i){for(var s,n=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,t(void 0,c)})),l.onerror=c=>t(c),{v:void 0})}},a=0;a<i.length;a++)if(s=n())return s.v}var o=()=>{if(!y)return t("document not found");var l=y.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,t(void 0,d)},l.onerror=d=>t(d),r.config.prepare_external_dependency_script&&(l=r.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");var c,u=y.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):y.body.appendChild(l)};y!=null&&y.body?o():y==null||y.addEventListener("DOMContentLoaded",o)};x.__PosthogExtensions__=x.__PosthogExtensions__||{},x.__PosthogExtensions__.loadExternalDependency=(r,e,t)=>{var i="/static/"+e+".js?v="+r.version;if(e==="remote-config"&&(i="/array/"+r.config.token+"/config.js"),e==="toolbar"){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}var n=r.requestRouter.endpointFor("assets",i);Er(r,n,t)},x.__PosthogExtensions__.loadSiteApp=(r,e,t)=>{var i=r.requestRouter.endpointFor("api",e);Er(r,i,t)};var At={};function Se(r,e,t){if(F(r)){if(ar&&r.forEach===ar)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,s=r.length;i<s;i++)if(i in r&&e.call(t,r[i],i)===At)return}}}function O(r,e,t){if(!R(r)){if(F(r))return Se(r,e,t);if(wn(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===At)return}else for(var s in r)if(fr.call(r,s)&&e.call(t,r[s],s)===At)return}}var M=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Se(t,(function(s){for(var n in s)s[n]!==void 0&&(r[n]=s[n])})),r},Ge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Se(t,(function(s){Se(s,(function(n){r.push(n)}))})),r};function Dt(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var kr=function(r){try{return r()}catch{return}},Yn=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(s){b.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),b.critical(s)}}},hi=function(r){var e={};return O(r,(function(t,i){(B(t)&&t.length>0||oe(t))&&(e[i]=t)})),e};function Kn(r,e){return t=r,i=n=>B(n)&&!_e(e)?n.slice(0,e):n,s=new Set,(function n(a,o){return a!==Object(a)?i?i(a,o):a:s.has(a)?void 0:(s.add(a),F(a)?(l=[],Se(a,(c=>{l.push(n(c))}))):(l={},O(a,((c,u)=>{s.has(c)||(l[u]=n(c,u))}))),l);var l})(t);var t,i,s}var Xn=["herokuapp.com","vercel.app","netlify.app"];function Jn(r){var e=r==null?void 0:r.hostname;if(!B(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of Xn)if(t===i)return!1;return!0}function xr(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}function L(r,e,t,i){var{capture:s=!1,passive:n=!0}=i??{};r==null||r.addEventListener(e,t,{capture:s,passive:n})}var Sr="$people_distinct_id",nt="__alias",at="__timers",Cr="$autocapture_disabled_server_side",pi="$heatmaps_enabled_server_side",Pr="$exception_capture_enabled_server_side",fi="$error_tracking_suppression_rules",Ir="$error_tracking_capture_extension_exceptions",$r="$web_vitals_enabled_server_side",Tr="$dead_clicks_enabled_server_side",Fr="$web_vitals_allowed_metrics",gi="$session_recording_remote_config",Mt="$sesid",Or="$session_is_sampled",We="$enabled_feature_flags",ot="$early_access_features",_i="$feature_flag_details",lt="$stored_person_properties",De="$stored_group_properties",vi="$surveys",Nt="$surveys_activated",Lt="$flag_call_reported",ve="$user_state",mi="$client_session_props",yi="$capture_rate_limit",bi="$initial_campaign_params",wi="$initial_referrer_info",Bt="$initial_person_info",Ut="$epp",Rr="__POSTHOG_TOOLBAR__",ct="$posthog_cookieless",Zn=[Sr,nt,"__cmpns",at,"$session_recording_enabled_server_side",pi,Mt,We,fi,ve,ot,_i,De,lt,vi,Lt,mi,yi,bi,wi,Ut,Bt];function Ar(r){return r instanceof Element&&(r.id===Rr||!(r.closest==null||!r.closest(".toolbar-global-fade-container")))}function qt(r){return!!r&&r.nodeType===1}function Ce(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function Dr(r){return!!r&&r.nodeType===3}function Mr(r){return!!r&&r.nodeType===11}function Ei(r){return r?Tt(r).split(/\s+/):[]}function Nr(r){var e=h==null?void 0:h.location.href;return!!(e&&r&&r.some((t=>e.match(t))))}function jt(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return Ei(e)}function Lr(r){return R(r)?null:Tt(r).split(/(\s+)/).filter((e=>dt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ut(r){var e="";return Si(r)&&!Gr(r)&&r.childNodes&&r.childNodes.length&&O(r.childNodes,(function(t){var i;Dr(t)&&t.textContent&&(e+=(i=Lr(t.textContent))!==null&&i!==void 0?i:"")})),Tt(e)}function Br(r){return m(r.target)?r.srcElement||null:(e=r.target)!=null&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var ki=["a","button","form","input","select","textarea","label"];function Ur(r,e){if(m(e))return!0;var t,i=function(n){if(e.some((a=>n.matches(a))))return{v:!0}};for(var s of r)if(t=i(s))return t.v;return!1}function qr(r){var e=r.parentNode;return!(!e||!qt(e))&&e}var Qn=["next","previous","prev",">","<"],jr=10,Vr=[".ph-no-rageclick",".ph-no-capture"];function ea(r,e){if(!h||xi(r))return!1;var t,i,s;if(xe(e)?(t=!!e&&Vr,i=void 0):(t=(s=e==null?void 0:e.css_selector_ignorelist)!==null&&s!==void 0?s:Vr,i=e==null?void 0:e.content_ignorelist),t===!1)return!1;var{targetElementList:n}=Hr(r,!1);return!(function(a,o){if(a===!1||m(a))return!1;var l;if(a===!0)l=Qn;else{if(!F(a))return!1;if(a.length>jr)return b.error("[PostHog] content_ignorelist array cannot exceed "+jr+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((c=>c.toLowerCase()))}return o.some((c=>{var{safeText:u,ariaLabel:d}=c;return l.some((f=>u.includes(f)||d.includes(f)))}))})(i,n.map((a=>{var o;return{safeText:ut(a).toLowerCase(),ariaLabel:((o=a.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!Ur(n,t)}var xi=r=>!r||Ce(r,"html")||!qt(r),Hr=(r,e)=>{if(!h||xi(r))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,i=[r],s=r;s.parentNode&&!Ce(s,"body");)if(Mr(s.parentNode))i.push(s.parentNode.host),s=s.parentNode.host;else{var n=qr(s);if(!n)break;if(e||ki.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var a=h.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}i.push(n),s=n}return{parentIsUsefulElement:t,targetElementList:i}};function ta(r,e,t,i,s){var n,a,o,l;if(t===void 0&&(t=void 0),!h||xi(r)||(n=t)!=null&&n.url_allowlist&&!Nr(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&Nr(t.url_ignorelist))return!1;if((o=t)!=null&&o.dom_event_allowlist){var c=t.dom_event_allowlist;if(c&&!c.some((g=>e.type===g)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=Hr(r,i);if(!(function(g,_){var w=_==null?void 0:_.element_allowlist;if(m(w))return!0;var k,S=function(P){if(w.some((N=>P.tagName.toLowerCase()===N)))return{v:!0}};for(var $ of g)if(k=S($))return k.v;return!1})(d,t)||!Ur(d,(l=t)==null?void 0:l.css_selector_allowlist))return!1;var f=h.getComputedStyle(r);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=r.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return u?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(ki.indexOf(p)>-1||r.getAttribute("contenteditable")==="true")}}function Si(r){for(var e=r;e.parentNode&&!Ce(e,"body");e=e.parentNode){var t=jt(e);if(C(t,"ph-sensitive")||C(t,"ph-no-capture"))return!1}if(C(jt(r),"ph-include"))return!0;var i=r.type||"";if(B(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var s=r.name||r.id||"";return!(B(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Gr(r){return!!(Ce(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||Ce(r,"select")||Ce(r,"textarea")||r.getAttribute("contenteditable")==="true")}var Wr="(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})",ia=new RegExp("^(?:"+Wr+")$"),ra=new RegExp(Wr),zr="\\d{3}-?\\d{2}-?\\d{4}",sa=new RegExp("^("+zr+")$"),na=new RegExp("("+zr+")");function dt(r,e){return e===void 0&&(e=!0),!(R(r)||B(r)&&(r=Tt(r),(e?ia:ra).test((r||"").replace(/[- ]/g,""))||(e?sa:na).test(r)))}function Yr(r){var e=ut(r);return dt(e=(e+" "+Kr(r)).trim())?e:""}function Kr(r){var e="";return r&&r.childNodes&&r.childNodes.length&&O(r.childNodes,(function(t){var i;if(t&&((i=t.tagName)==null?void 0:i.toLowerCase())==="span")try{var s=ut(t);e=(e+" "+s).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Kr(t)).trim())}catch(n){b.error("[AutoCapture]",n)}})),e}function aa(r){return(function(e){var t=e.map((i=>{var s,n,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))a+="."+o.replace(/"/g,"");var l=E({},i.text?{text:i.text}:{},{"nth-child":(s=i.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(n=i.nth_of_type)!==null&&n!==void 0?n:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return Dt(l).sort(((u,d)=>{var[f]=u,[p]=d;return f.localeCompare(p)})).forEach((u=>{var[d,f]=u;return c[Xr(d.toString())]=Xr(f.toString())})),a+=":",a+=Dt(c).map((u=>{var[d,f]=u;return d+'="'+f+'"'})).join("")}));return t.join(";")})((function(e){return e.map((t=>{var i,s,n={text:(i=t.$el_text)==null?void 0:i.slice(0,400),tag_name:t.tag_name,href:(s=t.attr__href)==null?void 0:s.slice(0,2048),attr_class:oa(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dt(t).filter((a=>{var[o]=a;return o.indexOf("attr__")===0})).forEach((a=>{var[o,l]=a;return n.attributes[o]=l})),n}))})(r))}function Xr(r){return r.replace(/"|\\"/g,'\\"')}function oa(r){var e=r.attr__class;return e?F(e)?e:Ei(e):void 0}class Jr{constructor(e){this.disabled=e===!1;var t=q(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 s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&i-s.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 Ci="$copy_autocapture",me=(function(r){return r.GZipJS="gzip-js",r.Base64="base64",r})({}),Vt=r=>{var e=y==null?void 0:y.createElement("a");return m(e)?null:(e.href=r,e)},la=function(r,e){var t,i;e===void 0&&(e="&");var s=[];return O(r,(function(n,a){m(n)||m(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(n)?n.name:n.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+t)})),s.join(e)},Ht=function(r,e){for(var t,i=((r.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<i.length;s++){var n=i[s].split("=");if(n[0]===e){t=n;break}}if(!F(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{b.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},ht=function(r,e,t){if(!r||!e||!e.length)return r;for(var i=r.split("#"),s=i[0]||"",n=i[1],a=s.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],d=0;d<c.length;d++){var f=c[d].split("=");F(f)&&(e.includes(f[0])?u.push(f[0]+"="+t):u.push(c[d]))}var p=l;return o!=null&&(p+="?"+u.join("&")),n!=null&&(p+="#"+n),p},Gt=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Zr=U("[AutoCapture]");function Pi(r,e){return e.length>r?e.slice(0,r)+"...":e}function ca(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!qt(e));return e}function ua(r,e,t,i){var s=r.tagName.toLowerCase(),n={tag_name:s};ki.indexOf(s)>-1&&!t&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?n.$el_text=Pi(1024,Yr(r)):n.$el_text=Pi(1024,ut(r)));var a=jt(r);a.length>0&&(n.classes=a.filter((function(u){return u!==""}))),O(r.attributes,(function(u){var d;if((!Gr(r)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&dt(u.value)&&(d=u.name,!B(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=u.value;u.name==="class"&&(f=Ei(f).join(" ")),n["attr__"+u.name]=Pi(1024,f)}}));for(var o=1,l=1,c=r;c=ca(c);)o++,c.tagName===r.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}function da(r,e){for(var t,i,{e:s,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,c=[r],u=r;u.parentNode&&!Ce(u,"body");)Mr(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,f=[],p={},g=!1,_=!1;if(O(c,(P=>{var N=Si(P);P.tagName.toLowerCase()==="a"&&(g=P.getAttribute("href"),g=N&&g&&dt(g)&&g),C(jt(P),"ph-no-capture")&&(_=!0),f.push(ua(P,n,a,o));var ne=(function(J){if(!Si(J))return{};var I={};return O(J.attributes,(function(de){if(de.name&&de.name.indexOf("data-ph-capture-attribute")===0){var Z=de.name.replace("data-ph-capture-attribute-",""),ae=de.value;Z&&ae&&dt(ae)&&(I[Z]=ae)}})),I})(P);M(p,ne)})),_)return{props:{},explicitNoCapture:_};if(a||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?f[0].$el_text=Yr(r):f[0].$el_text=ut(r)),g){var w,k;f[0].attr__href=g;var S=(w=Vt(g))==null?void 0:w.host,$=h==null||(k=h.location)==null?void 0:k.host;S&&$&&S!==$&&(d=g)}return{props:M({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:aa(f)},(t=f[0])!=null&&t.$el_text?{$el_text:(i=f[0])==null?void 0:i.$el_text}:{},d&&s.type==="click"?{$external_click_url:d}:{},p)}}class ha{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new Jr(e.config.rageclick),this.R=null}get C(){var e,t,i=q(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map((s=>new RegExp(s))),i.url_ignorelist=(t=i.url_ignorelist)==null?void 0:t.map((s=>new RegExp(s))),i}O(){if(this.isBrowserSupported()){if(h&&y){var e=i=>{i=i||(h==null?void 0:h.event);try{this.F(i)}catch(s){Zr.error("Failed to capture event",s)}};if(L(y,"submit",e,{capture:!0}),L(y,"change",e,{capture:!0}),L(y,"click",e,{capture:!0}),this.C.capture_copied_text){var t=i=>{i=i||(h==null?void 0:h.event),this.F(i,Ci)};L(y,"copy",t,{capture:!0}),L(y,"cut",t,{capture:!0})}}}else Zr.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.O(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Cr]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.R=e}getElementSelectors(e){var t,i=[];return(t=this.R)==null||t.forEach((s=>{var n=y==null?void 0:y.querySelectorAll(s);n==null||n.forEach((a=>{e===a&&i.push(s)}))})),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)==null?void 0:e.props[Cr],s=this.T;if(_e(s)&&!xe(i)&&!this.instance.M())return!1;var n=(t=this.T)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!n}F(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var i,s=Br(e);Dr(s)&&(s=s.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&ea(s,this.instance.config.rageclick)&&this.F(e,"$rageclick");var n=t===Ci;if(s&&ta(s,e,this.C,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=da(s,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.C.element_attribute_ignorelist,elementsChainAsString:this.I});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===Ci){var c,u=Lr(h==null||(c=h.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return ke(y==null?void 0:y.querySelectorAll)}}Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return oe(r)&&isFinite(r)&&Math.floor(r)===r});var Qr="0123456789abcdef";class Wt{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>1073741823||s>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]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new Wt(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Qr.charAt(this.bytes[t]>>>4)+Qr.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Wt(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}class pa{constructor(){this.A=0,this.D=0,this.j=new fa}generate(){var e=this.generateOrAbort();if(m(e)){this.A=0;var t=this.generateOrAbort();if(m(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return Wt.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var es,ts=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};h&&!m(h.crypto)&&crypto.getRandomValues&&(ts=r=>crypto.getRandomValues(r));class fa{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(ts(this.N),this.U=0),this.N[this.U++]}}var Pe=()=>ga().toString(),ga=()=>(es||(es=new pa)).generate(),pt="",_a=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function va(r,e){if(e){var t=(function(s,n){if(n===void 0&&(n=y),pt)return pt;if(!n||["localhost","127.0.0.1"].includes(s))return"";for(var a=s.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Pe();!pt&&o--;){var c=a.slice(o).join("."),u=l+"=1;domain=."+c+";path=/";n.cookie=u+";max-age=3",n.cookie.includes(l)&&(n.cookie=u+";max-age=0",pt=c)}return pt})(r);if(!t){var i=(s=>{var n=s.match(_a);return n?n[0]:""})(r);i!==t&&b.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var ce={H:()=>!!y,B:function(r){b.error("cookieStore error: "+r)},q:function(r){if(y){try{for(var e=r+"=",t=y.cookie.split(";").filter((n=>n.length)),i=0;i<t.length;i++){for(var s=t[i];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},W:function(r){var e;try{e=JSON.parse(ce.q(r))||{}}catch{}return e},G:function(r,e,t,i,s){if(y)try{var n="",a="",o=va(y.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}s&&(a="; secure");var c=r+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return c.length>3686.4&&b.warn("cookieStore warning: large cookie, len="+c.length),y.cookie=c,c}catch{return}},V:function(r,e){if(y!=null&&y.cookie)try{ce.G(r,"",-1,e)}catch{return}}},Ii=null,D={H:function(){if(!_e(Ii))return Ii;var r=!0;if(m(h))r=!1;else try{var e="__mplssupport__";D.G(e,"xyz"),D.q(e)!=='"xyz"'&&(r=!1),D.V(e)}catch{r=!1}return r||b.error("localStorage unsupported; falling back to cookie store"),Ii=r,r},B:function(r){b.error("localStorage error: "+r)},q:function(r){try{return h==null?void 0:h.localStorage.getItem(r)}catch(e){D.B(e)}return null},W:function(r){try{return JSON.parse(D.q(r))||{}}catch{}return null},G:function(r,e){try{h==null||h.localStorage.setItem(r,JSON.stringify(e))}catch(t){D.B(t)}},V:function(r){try{h==null||h.localStorage.removeItem(r)}catch(e){D.B(e)}}},ma=["distinct_id",Mt,Or,Ut,Bt],zt=E({},D,{W:function(r){try{var e={};try{e=ce.W(r)||{}}catch{}var t=M(e,JSON.parse(D.q(r)||"{}"));return D.G(r,t),t}catch{}return null},G:function(r,e,t,i,s,n){try{D.G(r,e,void 0,void 0,n);var a={};ma.forEach((o=>{e[o]&&(a[o]=e[o])})),Object.keys(a).length&&ce.G(r,a,t,i,s,n)}catch(o){D.B(o)}},V:function(r,e){try{h==null||h.localStorage.removeItem(r),ce.V(r,e)}catch(t){D.B(t)}}}),Yt={},ya={H:function(){return!0},B:function(r){b.error("memoryStorage error: "+r)},q:function(r){return Yt[r]||null},W:function(r){return Yt[r]||null},G:function(r,e){Yt[r]=e},V:function(r){delete Yt[r]}},Me=null,j={H:function(){if(!_e(Me))return Me;if(Me=!0,m(h))Me=!1;else try{var r="__support__";j.G(r,"xyz"),j.q(r)!=='"xyz"'&&(Me=!1),j.V(r)}catch{Me=!1}return Me},B:function(r){b.error("sessionStorage error: ",r)},q:function(r){try{return h==null?void 0:h.sessionStorage.getItem(r)}catch(e){j.B(e)}return null},W:function(r){try{return JSON.parse(j.q(r))||null}catch{}return null},G:function(r,e){try{h==null||h.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){j.B(t)}},V:function(r){try{h==null||h.sessionStorage.removeItem(r)}catch(e){j.B(e)}}},ye=(function(r){return r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED",r})({});class ba{constructor(e){this._instance=e}get C(){return this._instance.config}get consent(){return this.J()?ye.DENIED:this.K}isOptedOut(){return this.C.cookieless_mode==="always"||this.consent===ye.DENIED||this.consent===ye.PENDING&&(this.C.opt_out_capturing_by_default||this.C.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ye.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.C.cookie_expiration,this.C.cross_subdomain_cookie,this.C.secure_cookie)}reset(){this.Y.V(this.X,this.C.cross_subdomain_cookie)}get X(){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 K(){var e=this.Y.q(this.X);return ci(e)?ye.GRANTED:C(xn,e)?ye.DENIED:ye.PENDING}get Y(){if(!this.Z){var e=this.C.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?D:ce;var t=e==="localStorage"?ce:D;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(ci(t.q(this.X))),t.V(this.X,this.C.cross_subdomain_cookie))}return this.Z}J(){return!!this.C.respect_dnt&&!!xr([X==null?void 0:X.doNotTrack,X==null?void 0:X.msDoNotTrack,x.doNotTrack],(e=>ci(e)))}}var Kt=U("[Dead Clicks]"),wa=()=>!0,Ea=r=>{var e,t=!((e=r.instance.persistence)==null||!e.get_property(Tr)),i=r.instance.config.capture_dead_clicks;return xe(i)?i:t};class is{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Tr]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Kt.error("failed to load script",s):e()}))}et(){var e;if(y){if(!this.tt&&(e=x.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=q(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=x.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(y),Kt.info("starting...")}}else Kt.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Kt.info("stopping..."))}}var ft=U("[ExceptionAutocapture]");class ka{constructor(e){var t,i,s;this.rt=()=>{var n;if(h&&this.isEnabled&&(n=x.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var a=x.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=x.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=x.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.C.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.C.capture_unhandled_rejections&&(this.nt=o(this.captureException.bind(this))),!this.ot&&this.C.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){ft.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((t=this._instance.persistence)==null||!t.props[Pr]),this.C=this.ht(),this.dt=new Sn({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,h:ft}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return q(e)?t=E({},t,e):(m(e)?this.ut:e)&&(t=E({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.C.capture_console_errors||this.C.capture_unhandled_errors||this.C.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(ft.info("enabled"),this.it(this.rt))}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",(s=>{if(s)return ft.error("failed to load script",s);e()}))}lt(){var e,t,i;(e=this.st)==null||e.call(this),this.st=void 0,(t=this.nt)==null||t.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ut=!!t||!1,this.C=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Pr]:this.ut}),this.startIfEnabled()}captureException(e){var t,i,s=(t=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&t!==void 0?t:"Exception";this.dt.consumeRateLimit(s)?ft.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(e)}}function rs(r,e,t){try{if(!(e in r))return()=>{};var i=r[e],s=t(i);return ke(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),r[e]=s,()=>{r[e]=i}}catch{return()=>{}}}class xa{constructor(e){var t;this._instance=e,this.vt=(h==null||(t=h.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(b.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,b.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(h&&h.history){var i=this;(e=h.history.pushState)!=null&&e.__posthog_wrapped__||rs(h.history,"pushState",(s=>function(n,a,o){s.call(this,n,a,o),i.ft("pushState")})),(t=h.history.replaceState)!=null&&t.__posthog_wrapped__||rs(h.history,"replaceState",(s=>function(n,a,o){s.call(this,n,a,o),i.ft("replaceState")})),this.gt()}}ft(e){try{var t,i=h==null||(t=h.location)==null?void 0:t.pathname;if(!i)return;i!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.vt=i}catch(s){b.error("Error capturing "+e+" pageview",s)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};L(h,"popstate",e),this.ct=()=>{h&&h.removeEventListener("popstate",e)}}}}var $i=U("[SegmentIntegration]");function Sa(r,e){var t=r.config.segment;if(!t)return e();(function(i,s){var n=i.config.segment;if(!n)return s();var a=l=>{var c=()=>l.anonymousId()||Pe();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(ve,"identified")),s()},o=n.user();"then"in o&&ke(o.then)?o.then((l=>a(l))):a(o)})(r,(()=>{t.register((i=>{Promise&&Promise.resolve||$i.warn("This browser does not have Promise support, and can not use the segment integration");var s=(n,a)=>{if(!a)return n;n.event.userId||n.event.anonymousId===i.get_distinct_id()||($i.info("No userId set, resetting PostHog"),i.reset()),n.event.userId&&n.event.userId!==i.get_distinct_id()&&($i.info("UserId set, identifying with PostHog"),i.identify(n.event.userId));var o=i.calculateEventProperties(a,n.event.properties);return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>s(n,n.event.event),page:n=>s(n,"$pageview"),identify:n=>s(n,"$identify"),screen:n=>s(n,"$screen")}})(r)).then((()=>{e()}))}))}var ss="posthog-js";function ns(r,e){var{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,c,u,d,f;if(!(n==="*"||n.includes(o.level))||!r.__loaded)return o;o.tags||(o.tags={});var p=r.requestRouter.endpointFor("ui","/project/"+r.config.token+"/person/"+r.get_distinct_id());o.tags["PostHog Person URL"]=p,r.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var g=((l=o.exception)==null?void 0:l.values)||[],_=g.map((k=>E({},k,{stacktrace:k.stacktrace?E({},k.stacktrace,{type:"raw",frames:(k.stacktrace.frames||[]).map((S=>E({},S,{platform:"web:javascript"})))}):void 0}))),w={$exception_message:((c=g[0])==null?void 0:c.value)||o.message,$exception_type:(u=g[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((d=g[0])==null?void 0:d.value)||o.message,$sentry_exception_type:(f=g[0])==null?void 0:f.type,$sentry_tags:o.tags};return t&&i&&(w.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),a&&r.exceptions.sendExceptionEvent(w),o}}class Ca{constructor(e,t,i,s,n,a){this.name=ss,this.setupOnce=function(o){o(ns(e,{organization:t,projectId:i,prefix:s,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}var Pa=h!=null&&h.location?Gt(h.location.hash,"__posthog")||Gt(location.hash,"state"):null,as="_postHogToolbarParams",os=U("[Toolbar]"),Ie=(function(r){return r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED",r})(Ie||{});class Ia{constructor(e){this.instance=e}_t(e){x.ph_toolbar_state=e}yt(){var e;return(e=x.ph_toolbar_state)!==null&&e!==void 0?e:Ie.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),!h||!y)return!1;e=e??h.location,i=i??h.history;try{if(!t){try{h.localStorage.setItem("test","test"),h.localStorage.removeItem("test")}catch{return!1}t=h==null?void 0:h.localStorage}var s,n=Pa||Gt(e.hash,"__posthog")||Gt(e.hash,"state"),a=n?kr((()=>JSON.parse(atob(decodeURIComponent(n)))))||kr((()=>JSON.parse(decodeURIComponent(n)))):null;return a&&a.action==="ph_authorize"?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(as)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}bt(e){var t=x.ph_load_toolbar||x.ph_load_editor;!R(t)&&ke(t)?t(e,this.instance):os.warn("No toolbar load function found")}loadToolbar(e){var t=!(y==null||!y.getElementById(Rr));if(!h||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=E({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(h.localStorage.setItem(as,JSON.stringify(E({},s,{source:void 0}))),this.yt()===Ie.LOADED)this.bt(s);else if(this.yt()===Ie.UNINITIALIZED){var n;this._t(Ie.LOADING),(n=x.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return os.error("[Toolbar] Failed to load",a),void this._t(Ie.UNINITIALIZED);this._t(Ie.LOADED),this.bt(s)})),L(h,"turbolinks:load",(()=>{this._t(Ie.UNINITIALIZED),this.loadToolbar(s)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var $a=U("[TracingHeaders]");class Ta{constructor(e){this.xt=void 0,this.$t=void 0,this.rt=()=>{var t,i;m(this.xt)&&((t=x.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),m(this.$t)&&((i=x.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",(s=>{if(s)return $a.error("failed to load script",s);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(t=this.$t)==null||t.call(this),this.xt=void 0,this.$t=void 0)}}var ee="Mobile",Xt="iOS",ue="Android",gt="Tablet",ls=ue+" "+gt,cs="iPad",us="Apple",ds=us+" Watch",_t="Safari",ze="BlackBerry",hs="Samsung",ps=hs+"Browser",fs=hs+" Internet",Ne="Chrome",Fa=Ne+" OS",gs=Ne+" "+Xt,Ti="Internet Explorer",_s=Ti+" "+ee,Fi="Opera",Oa=Fi+" Mini",Oi="Edge",vs="Microsoft "+Oi,Ye="Firefox",ms=Ye+" "+Xt,vt="Nintendo",mt="PlayStation",Ke="Xbox",ys=ue+" "+ee,bs=ee+" "+_t,yt="Windows",Ri=yt+" Phone",ws="Nokia",Ai="Ouya",Es="Generic",Ra=Es+" "+ee.toLowerCase(),ks=Es+" "+gt.toLowerCase(),Di="Konqueror",H="(\\d+(\\.\\d+)?)",Mi=new RegExp("Version/"+H),Aa=new RegExp(Ke,"i"),Da=new RegExp(mt+" \\w+","i"),Ma=new RegExp(vt+" \\w+","i"),Ni=new RegExp(ze+"|PlayBook|BB10","i"),Na={"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"},La=(r,e)=>e&&C(e,us)||(function(t){return C(t,_t)&&!C(t,Ne)&&!C(t,ue)})(r),xs=function(r,e){return e=e||"",C(r," OPR/")&&C(r,"Mini")?Oa:C(r," OPR/")?Fi:Ni.test(r)?ze:C(r,"IE"+ee)||C(r,"WPDesktop")?_s:C(r,ps)?fs:C(r,Oi)||C(r,"Edg/")?vs:C(r,"FBIOS")?"Facebook "+ee:C(r,"UCWEB")||C(r,"UCBrowser")?"UC Browser":C(r,"CriOS")?gs:C(r,"CrMo")||C(r,Ne)?Ne:C(r,ue)&&C(r,_t)?ys:C(r,"FxiOS")?ms:C(r.toLowerCase(),Di.toLowerCase())?Di:La(r,e)?C(r,ee)?bs:_t:C(r,Ye)?Ye:C(r,"MSIE")||C(r,"Trident/")?Ti:C(r,"Gecko")?Ye:""},Ba={[_s]:[new RegExp("rv:"+H)],[vs]:[new RegExp(Oi+"?\\/"+H)],[Ne]:[new RegExp("("+Ne+"|CrMo)\\/"+H)],[gs]:[new RegExp("CriOS\\/"+H)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+H)],[_t]:[Mi],[bs]:[Mi],[Fi]:[new RegExp("(Opera|OPR)\\/"+H)],[Ye]:[new RegExp(Ye+"\\/"+H)],[ms]:[new RegExp("FxiOS\\/"+H)],[Di]:[new RegExp("Konqueror[:/]?"+H,"i")],[ze]:[new RegExp(ze+" "+H),Mi],[ys]:[new RegExp("android\\s"+H,"i")],[fs]:[new RegExp(ps+"\\/"+H)],[Ti]:[new RegExp("(rv:|MSIE )"+H)],Mozilla:[new RegExp("rv:"+H)]},Ua=function(r,e){var t=xs(r,e),i=Ba[t];if(m(i))return null;for(var s=0;s<i.length;s++){var n=i[s],a=r.match(n);if(a)return parseFloat(a[a.length-2])}return null},Ss=[[new RegExp(Ke+"; "+Ke+" (.*?)[);]","i"),r=>[Ke,r&&r[1]||""]],[new RegExp(vt,"i"),[vt,""]],[new RegExp(mt,"i"),[mt,""]],[Ni,[ze,""]],[new RegExp(yt,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ri,""];if(new RegExp(ee).test(e)&&!/IEMobile\b/.test(e))return[yt+" "+ee,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],s=Na[i]||"";return/arm/i.test(e)&&(s="RT"),[yt,s]}return[yt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[Xt,e.join(".")]}return[Xt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=m(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+ue+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ue+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[ue,e.join(".")]}return[ue,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Fa,""]],[/Linux|debian/i,["Linux",""]]],Cs=function(r){return Ma.test(r)?vt:Da.test(r)?mt:Aa.test(r)?Ke:new RegExp(Ai,"i").test(r)?Ai:new RegExp("("+Ri+"|WPDesktop)","i").test(r)?Ri:/iPad/.test(r)?cs:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?ds:Ni.test(r)?ze:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(ws,"i").test(r)?ws:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(ee).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?ue:ls:ue:new RegExp("(pda|"+ee+")","i").test(r)?Ra:new RegExp(gt,"i").test(r)&&!new RegExp(gt+" pc","i").test(r)?ks:""},Jt="https?://(.*)",Xe=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],qa=Ge(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Xe),bt="<masked>",ja=["li_fat_id"];function Ps(r,e,t){if(!y)return{};var i,s=e?Ge([],Xe,t||[]):[],n=Is(ht(y.URL,s,bt),r),a=(i={},O(ja,(function(o){var l=ce.q(o);i[o]=l||null})),i);return M(a,n)}function Is(r,e){var t=qa.concat(e||[]),i={};return O(t,(function(s){var n=Ht(r,s);i[s]=n||null})),i}function $s(r){var e=(function(n){return n?n.search(Jt+"google.([^/?]*)")===0?"google":n.search(Jt+"bing.com")===0?"bing":n.search(Jt+"yahoo.com")===0?"yahoo":n.search(Jt+"duckduckgo.com")===0?"duckduckgo":null:null})(r),t=e!="yahoo"?"q":"p",i={};if(!_e(e)){i.$search_engine=e;var s=y?Ht(y.referrer,t):"";s.length&&(i.ph_keyword=s)}return i}function Ts(){return navigator.language||navigator.userLanguage}function Fs(){return(y==null?void 0:y.referrer)||"$direct"}function Os(r,e){var t=r?Ge([],Xe,e||[]):[],i=z==null?void 0:z.href.substring(0,1e3);return{r:Fs().substring(0,1e3),u:i?ht(i,t,bt):void 0}}function Rs(r){var e,{r:t,u:i}=r,s={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Vt(t))==null?void 0:e.host};if(i){s.$current_url=i;var n=Vt(i);s.$host=n==null?void 0:n.host,s.$pathname=n==null?void 0:n.pathname;var a=Is(i);M(s,a)}if(t){var o=$s(t);M(s,o)}return s}function As(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Va(){try{return new Date().getTimezoneOffset()}catch{return}}function Ha(r,e){if(!Y)return{};var t,i,s,n=r?Ge([],Xe,e||[]):[],[a,o]=(function(l){for(var c=0;c<Ss.length;c++){var[u,d]=Ss[c],f=u.exec(l),p=f&&(ke(d)?d(f,l):d);if(p)return p}return["",""]})(Y);return M(hi({$os:a,$os_version:o,$browser:xs(Y,navigator.vendor),$device:Cs(Y),$device_type:(i=Y,s=Cs(i),s===cs||s===ls||s==="Kobo"||s==="Kindle Fire"||s===ks?gt:s===vt||s===Ke||s===mt||s===Ai?"Console":s===ds?"Wearable":s?ee:"Desktop"),$timezone:As(),$timezone_offset:Va()}),{$current_url:ht(z==null?void 0:z.href,n,bt),$host:z==null?void 0:z.host,$pathname:z==null?void 0:z.pathname,$raw_user_agent:Y.length>1e3?Y.substring(0,997)+"...":Y,$browser_version:Ua(Y,navigator.vendor),$browser_language:Ts(),$browser_language_prefix:(t=Ts(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:h==null?void 0:h.screen.height,$screen_width:h==null?void 0:h.screen.width,$viewport_height:h==null?void 0:h.innerHeight,$viewport_width:h==null?void 0:h.innerWidth,$lib:"web",$lib_version:ge.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var $e=U("[Web Vitals]"),Ds=9e5;class Ga{constructor(e){var t;this.St=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Et=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((i,s)=>E({},i,{["$web_vitals_"+s.name+"_event"]:E({},s),["$web_vitals_"+s.name+"_value"]:s.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var s,n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(m(n))$e.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();m(a)||(R(i==null?void 0:i.name)||R(i==null?void 0:i.value)?$e.error("Invalid metric received",i):this.It&&i.value>=this.It?$e.error("Ignoring metric with value >= "+this.It,i):(this.N.url!==a&&(this.Et(),this.kt=setTimeout(this.Et,this.flushToCaptureTimeoutMs)),m(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=m(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(E({},i,{$current_url:a,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Et()))}},this.rt=()=>{var i,s,n,a,o=x.__PosthogExtensions__;m(o)||m(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:s,onFCP:n,onINP:a}=o.postHogWebVitalsCallbacks),i&&s&&n&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):$e.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.St=!((t=this._instance.persistence)==null||!t.props[$r]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=q(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return m(i)?((t=this._instance.persistence)==null?void 0:t.props[Fr])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(q(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get It(){var e=q(this._instance.config.capture_performance)&&oe(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Ds;return 0<e&&e<=6e4?Ds:e}get isEnabled(){var e=z==null?void 0:z.protocol;if(e!=="http:"&&e!=="https:")return $e.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=q(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:xe(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return xe(t)?t:this.St}startIfEnabled(){this.isEnabled&&!this.P&&($e.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=q(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=q(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$r]:t}),this._instance.persistence.register({[Fr]:i})),this.St=t,this.startIfEnabled()}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",(s=>{s?$e.error("failed to load script",s):e()}))}Tt(){var e=h?h.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,s=t?Ge([],Xe,i||[]):[];return ht(e,s,bt)}$e.error("Could not determine current URL")}}var Wa=U("[Heatmaps]");function Ms(r){return q(r)&&"clientX"in r&&"clientY"in r&&oe(r.clientX)&&oe(r.clientY)}class za{constructor(e){var t;this.St=!1,this.P=!1,this.Rt=null,this.instance=e,this.St=!((t=this.instance.persistence)==null||!t.props[pi]),this.rageclicks=new Jr(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return q(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 m(this.instance.config.capture_heatmaps)?m(this.instance.config.enable_heatmaps)?this.St:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;Wa.info("starting..."),this.Ct(),this.Ot()}else{var e;clearInterval((e=this.Rt)!==null&&e!==void 0?e:void 0),this.Ft(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[pi]:t}),this.St=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Mt(e){this.At(e.originalEvent,"deadclick")}Ot(){this.Rt&&clearInterval(this.Rt),this.Rt=(function(e){return(e==null?void 0:e.visibilityState)==="visible"})(y)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ct(){h&&y&&(this.jt=this.Dt.bind(this),L(h,"beforeunload",this.jt),this.Lt=e=>this.At(e||(h==null?void 0:h.event)),L(y,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||(h==null?void 0:h.event)),L(y,"mousemove",this.Nt,{capture:!0}),this.zt=new is(this.instance,wa,this.Mt.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ot.bind(this),L(y,"visibilitychange",this.Ht),this.P=!0)}Ft(){var e;h&&y&&(this.jt&&h.removeEventListener("beforeunload",this.jt),this.Lt&&y.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&y.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&y.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=(function(o,l,c){for(var u=o;u&&qt(u)&&!Ce(u,"body");){if(u===c)return!1;if(C(l,h==null?void 0:h.getComputedStyle(u).position))return!0;u=qr(u)}return!1})(Br(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}At(e,t){var i;if(t===void 0&&(t="click"),!Ar(e.target)&&Ms(e)){var s=this.qt(e,t);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(E({},s,{type:"rageclick"})),this.Wt(s)}}Ut(e){!Ar(e.target)&&Ms(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(h){var t=h.location.href,i=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=i?Ge([],Xe,s||[]):[],a=ht(t,n,bt);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!Ve(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ya{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.Gt(e,t);return this.Vt={pathname:(i=h==null?void 0:h.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Gt(e,(t=this.Vt)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,t){var i=this.Vt;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=n;if(!(m(a)||m(o)||m(l)||m(c)||m(u)||m(d))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var f=a<=1?1:le(o/a,0,1,b),p=a<=1?1:le(l/a,0,1,b),g=c<=1?1:le(u/c,0,1,b),_=c<=1?1:le(d/c,0,1,b);s=M(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var te=Uint8Array,K=Uint16Array,Je=Uint32Array,Li=new te([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]),Bi=new te([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]),Ns=new te([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ls=function(r,e){for(var t=new K(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var s=new Je(t[30]);for(i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return[t,s]},Bs=Ls(Li,2),Ka=Bs[0],Ui=Bs[1];Ka[28]=258,Ui[258]=28;for(var Us=Ls(Bi,0)[1],qs=new K(32768),A=0;A<32768;++A){var Le=(43690&A)>>>1|(21845&A)<<1;Le=(61680&(Le=(52428&Le)>>>2|(13107&Le)<<2))>>>4|(3855&Le)<<4,qs[A]=((65280&Le)>>>8|(255&Le)<<8)>>>1}var wt=function(r,e,t){for(var i=r.length,s=0,n=new K(e);s<i;++s)++n[r[s]-1];var a,o=new K(e);for(s=0;s<e;++s)o[s]=o[s-1]+n[s-1]<<1;for(a=new K(i),s=0;s<i;++s)a[s]=qs[o[r[s]-1]++]>>>15-r[s];return a},Be=new te(288);for(A=0;A<144;++A)Be[A]=8;for(A=144;A<256;++A)Be[A]=9;for(A=256;A<280;++A)Be[A]=7;for(A=280;A<288;++A)Be[A]=8;var Zt=new te(32);for(A=0;A<32;++A)Zt[A]=5;var Xa=wt(Be,9),Ja=wt(Zt,5),js=function(r){return(r/8>>0)+(7&r&&1)},Vs=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof K?K:r instanceof Je?Je:te)(t-e);return i.set(r.subarray(e,t)),i},be=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},Et=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},qi=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});var s=t.length,n=t.slice();if(!s)return[new te(0),0];if(s==1){var a=new te(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort((function(N,ne){return N.f-ne.f})),t.push({s:-1,f:25001});var o=t[0],l=t[1],c=0,u=1,d=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=s-1;)o=t[t[c].f<t[d].f?c++:d++],l=t[c!=u&&t[c].f<t[d].f?c++:d++],t[u++]={s:-1,f:o.f+l.f,l:o,r:l};var f=n[0].s;for(i=1;i<s;++i)n[i].s>f&&(f=n[i].s);var p=new K(f+1),g=ji(t[u-1],p,0);if(g>e){i=0;var _=0,w=g-e,k=1<<w;for(n.sort((function(N,ne){return p[ne.s]-p[N.s]||N.f-ne.f}));i<s;++i){var S=n[i].s;if(!(p[S]>e))break;_+=k-(1<<g-p[S]),p[S]=e}for(_>>>=w;_>0;){var $=n[i].s;p[$]<e?_-=1<<e-p[$]++-1:++i}for(;i>=0&&_;--i){var P=n[i].s;p[P]==e&&(--p[P],++_)}g=e}return[new te(p),g]},ji=function(r,e,t){return r.s==-1?Math.max(ji(r.l,e,t+1),ji(r.r,e,t+1)):e[r.s]=t},Hs=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new K(++e),i=0,s=r[0],n=1,a=function(l){t[i++]=l},o=1;o<=e;++o)if(r[o]==s&&o!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=r[o]}return[t.subarray(0,i),e]},kt=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},Vi=function(r,e,t){var i=t.length,s=js(e+2);r[s]=255&i,r[s+1]=i>>>8,r[s+2]=255^r[s],r[s+3]=255^r[s+1];for(var n=0;n<i;++n)r[s+n+4]=t[n];return 8*(s+4+i)},Gs=function(r,e,t,i,s,n,a,o,l,c,u){be(e,u++,t),++s[256];for(var d=qi(s,15),f=d[0],p=d[1],g=qi(n,15),_=g[0],w=g[1],k=Hs(f),S=k[0],$=k[1],P=Hs(_),N=P[0],ne=P[1],J=new K(19),I=0;I<S.length;++I)J[31&S[I]]++;for(I=0;I<N.length;++I)J[31&N[I]]++;for(var de=qi(J,7),Z=de[0],ae=de[1],ie=19;ie>4&&!Z[Ns[ie-1]];--ie);var we,he,pe,it,Fe=c+5<<3,je=kt(s,Be)+kt(n,Zt)+a,fe=kt(s,f)+kt(n,_)+a+14+3*ie+kt(J,Z)+(2*J[16]+3*J[17]+7*J[18]);if(Fe<=je&&Fe<=fe)return Vi(e,u,r.subarray(l,l+c));if(be(e,u,1+(fe<je)),u+=2,fe<je){we=wt(f,p),he=f,pe=wt(_,w),it=_;var Oe=wt(Z,ae);for(be(e,u,$-257),be(e,u+5,ne-1),be(e,u+10,ie-4),u+=14,I=0;I<ie;++I)be(e,u+3*I,Z[Ns[I]]);u+=3*ie;for(var rt=[S,N],G=0;G<2;++G){var re=rt[G];for(I=0;I<re.length;++I){var Q=31&re[I];be(e,u,Oe[Q]),u+=Z[Q],Q>15&&(be(e,u,re[I]>>>5&127),u+=re[I]>>>12)}}}else we=Xa,he=Be,pe=Ja,it=Zt;for(I=0;I<o;++I)if(i[I]>255){Q=i[I]>>>18&31,Et(e,u,we[Q+257]),u+=he[Q+257],Q>7&&(be(e,u,i[I]>>>23&31),u+=Li[Q]);var st=31&i[I];Et(e,u,pe[st]),u+=it[st],st>3&&(Et(e,u,i[I]>>>5&8191),u+=Bi[st])}else Et(e,u,we[i[I]]),u+=he[i[I]];return Et(e,u,we[256]),u+he[256]},Za=new Je([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qa=(function(){for(var r=new Je(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r})(),eo=function(r,e,t,i,s){return(function(n,a,o,l,c,u){var d=n.length,f=new te(l+d+5*(1+Math.floor(d/7e3))+c),p=f.subarray(l,f.length-c),g=0;if(!a||d<8)for(var _=0;_<=d;_+=65535){var w=_+65535;w<d?g=Vi(p,g,n.subarray(_,w)):(p[_]=u,g=Vi(p,g,n.subarray(_,d)))}else{for(var k=Za[a-1],S=k>>>13,$=8191&k,P=(1<<o)-1,N=new K(32768),ne=new K(P+1),J=Math.ceil(o/3),I=2*J,de=function(rr){return(n[rr]^n[rr+1]<<J^n[rr+2]<<I)&P},Z=new Je(25e3),ae=new K(288),ie=new K(32),we=0,he=0,pe=(_=0,0),it=0,Fe=0;_<d;++_){var je=de(_),fe=32767&_,Oe=ne[je];if(N[fe]=Oe,ne[je]=fe,it<=_){var rt=d-_;if((we>7e3||pe>24576)&&rt>423){g=Gs(n,p,0,Z,ae,ie,he,pe,Fe,_-Fe,g),pe=we=he=0,Fe=_;for(var G=0;G<286;++G)ae[G]=0;for(G=0;G<30;++G)ie[G]=0}var re=2,Q=0,st=$,Re=fe-Oe&32767;if(rt>2&&je==de(_-Re))for(var il=Math.min(S,rt)-1,rl=Math.min(32767,_),sl=Math.min(258,rt);Re<=rl&&--st&&fe!=Oe;){if(n[_+re]==n[_+re-Re]){for(var Ae=0;Ae<sl&&n[_+Ae]==n[_+Ae-Re];++Ae);if(Ae>re){if(re=Ae,Q=Re,Ae>il)break;var nl=Math.min(Re,Ae-2),fn=0;for(G=0;G<nl;++G){var ir=_-Re+G+32768&32767,gn=ir-N[ir]+32768&32767;gn>fn&&(fn=gn,Oe=ir)}}}Re+=(fe=Oe)-(Oe=N[fe])+32768&32767}if(Q){Z[pe++]=268435456|Ui[re]<<18|Us[Q];var _n=31&Ui[re],vn=31&Us[Q];he+=Li[_n]+Bi[vn],++ae[257+_n],++ie[vn],it=_+re,++we}else Z[pe++]=n[_],++ae[n[_]]}}g=Gs(n,p,u,Z,ae,ie,he,pe,Fe,_-Fe,g)}return Vs(f,0,l+js(g)+c)})(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!0)},Hi=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8};function to(r,e){e===void 0&&(e={});var t=(function(){var o=4294967295;return{p:function(l){for(var c=o,u=0;u<l.length;++u)c=Qa[255&c^l[u]]^c>>>8;o=c},d:function(){return 4294967295^o}}})(),i=r.length;t.p(r);var s,n=eo(r,e,10+((s=e).filename&&s.filename.length+1||0),8),a=n.length;return(function(o,l){var c=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&Hi(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){o[3]=8;for(var u=0;u<=c.length;++u)o[u+10]=c.charCodeAt(u)}})(n,e),Hi(n,a-8,t.d()),Hi(n,a-4,i),n}var io=function(r){var e,t,i,s,n="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,`
|
|
3
3
|
`).replace(/\r/g,`
|
|
4
|
-
`)).length,s=0;s<i;s++){var a=r.charCodeAt(s),o=null;a<128?t++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),_e(o)||(t>e&&(n+=r.substring(e,t)),n+=o,e=t=s+1)}return t>e&&(n+=r.substring(e,r.length)),n},ro=!!si||!!ri,Ws="text/plain",Zt=function(r,e,t){var i;t===void 0&&(t=!0);var[s,n]=r.split("?"),a=E({},e),o=(i=n==null?void 0:n.split("&").map((c=>{var u,[d,f]=c.split("="),p=t&&(u=a[d])!==null&&u!==void 0?u:f;return delete a[d],d+"="+p})))!==null&&i!==void 0?i:[],l=la(a);return l&&o.push(l),s+"?"+o.join("&")},xt=(r,e)=>JSON.stringify(r,((t,i)=>typeof i=="bigint"?i.toString():i),e),Hi=r=>{var{data:e,compression:t}=r;if(e){if(t===me.GZipJS){var i=to((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new te(l.length+(l.length>>>1)),f=0,p=function(k){d[f++]=k},g=0;g<u;++g){if(f+5>d.length){var _=new te(f+8+(u-g<<1));_.set(d),d=_}var w=l.charCodeAt(g);w<128||c?p(w):w<2048?(p(192|w>>>6),p(128|63&w)):w>55295&&w<57344?(p(240|(w=65536+(1047552&w)|1023&l.charCodeAt(++g))>>>18),p(128|w>>>12&63),p(128|w>>>6&63),p(128|63&w)):(p(224|w>>>12),p(128|w>>>6&63),p(128|63&w))}return Vs(d,0,f)})(xt(e)),{mtime:0}),s=new Blob([i],{type:Ws});return{contentType:Ws,body:s,estimatedSize:s.size}}if(t===me.Base64){var n=(function(l){var c,u,d,f,p,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,w=0,k="",S=[];if(!l)return l;l=io(l);do c=(p=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=p>>12&63,d=p>>6&63,f=63&p,S[w++]=g.charAt(c)+g.charAt(u)+g.charAt(d)+g.charAt(f);while(_<l.length);switch(k=S.join(""),l.length%3){case 1:k=k.slice(0,-2)+"==";break;case 2:k=k.slice(0,-1)+"="}return k})(xt(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:xt(l)))(n);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=xt(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Qt=[];ri&&Qt.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:s,estimatedSize:n}=(e=Hi(r))!==null&&e!==void 0?e:{},a=new Headers;O(r.headers,(function(u,d){a.append(d,u)})),i&&a.append("Content-Type",i);var o=r.url,l=null;if(lr){var c=new lr;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),r.timeout)}}ri(o,E({method:(r==null?void 0:r.method)||"GET",headers:a,keepalive:r.method==="POST"&&(n||0)<52428.8,body:s,signal:(t=l)==null?void 0:t.signal},r.fetchOptions)).then((u=>u.text().then((d=>{var f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(p){b.error(p)}r.callback==null||r.callback(f)})))).catch((u=>{b.error(u),r.callback==null||r.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),si&&Qt.push({transport:"XHR",method:r=>{var e,t=new si;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:s}=(e=Hi(r))!==null&&e!==void 0?e:{};O(r.headers,(function(n,a){t.setRequestHeader(a,n)})),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.timeout),r.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}r.callback==null||r.callback(n)}},t.send(s)}}),K!=null&&K.sendBeacon&&Qt.push({transport:"sendBeacon",method:r=>{var e=Zt(r.url,{beacon:"1"});try{var t,{contentType:i,body:s}=(t=Hi(r))!==null&&t!==void 0?t:{},n=typeof s=="string"?new Blob([s],{type:i}):s;K.sendBeacon(e,n)}catch{}}});var Ze=function(r,e){if(!(function(t){try{new RegExp(t)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(r)}catch{return!1}};function zs(r,e,t){return xt({distinct_id:r,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Ys={exact:(r,e)=>e.some((t=>r.some((i=>t===i)))),is_not:(r,e)=>e.every((t=>r.every((i=>t!==i)))),regex:(r,e)=>e.some((t=>r.some((i=>Ze(t,i))))),not_regex:(r,e)=>e.every((t=>r.every((i=>!Ze(t,i))))),icontains:(r,e)=>e.map(ei).some((t=>r.map(ei).some((i=>t.includes(i))))),not_icontains:(r,e)=>e.map(ei).every((t=>r.map(ei).every((i=>!t.includes(i)))))},ei=r=>r.toLowerCase(),Gi=U("[Error tracking]");class so{constructor(e){var t,i;this.Jt=[],this.Kt=new An([new Nn,new Wn,new Bn,new Ln,new Hn,new Vn,new qn,new Gn],[Fn,Dn]),this._instance=e,this.Jt=(t=(i=this._instance.persistence)==null?void 0:i.get_property(pi))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,i,s,n=(t=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],a=(s=e.errorTracking)==null?void 0:s.captureExtensionExceptions;this.Jt=n,this._instance.persistence&&this._instance.persistence.register({[pi]:this.Jt,[$r]:a})}get Yt(){var e,t=!!this._instance.get_property($r),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Kt.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Xt(t)){if(this.Qt(t))return void Gi.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(t))return void Gi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(t))return void Gi.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var t=e.reduce(((i,s)=>{var{type:n,value:a}=s;return B(n)&&n.length>0&&i.$exception_types.push(n),B(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var s=i.values.map((n=>{var a,o=Ys[n.operator],l=F(n.value)?n.value:[n.value],c=(a=t[n.key])!==null&&a!==void 0?a:[];return l.length>0&&o(l,c)}));return i.type==="OR"?s.some(Boolean):s.every(Boolean)}))}Zt(e){return e.flatMap((t=>{var i,s;return(i=(s=t.stacktrace)==null?void 0:s.frames)!==null&&i!==void 0?i:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var t,i,s,n,a=(t=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&t!==void 0?t:[],o=a[a.length-1];return(s=o==null||(n=o.filename)==null?void 0:n.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Xt(e){return!R(e)&&F(e)}}var se=U("[FeatureFlags]"),Wi="$active_feature_flags",Qe="$override_feature_flags",Xs="$feature_flag_payloads",St="$override_feature_flag_payloads",Ks="$feature_flag_request_id",Js=r=>{var e={};for(var[t,i]of Dt(r||{}))i&&(e[t]=i);return e},no=r=>{var e=r.flags;return e?(r.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,(i=e[t].variant)!==null&&i!==void 0?i:e[t].enabled]}))),r.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return(i=e[t].metadata)==null?void 0:i.payload})).map((t=>{var i;return[t,(i=e[t].metadata)==null?void 0:i.payload]})))):se.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),r},ao=(function(r){return r.FeatureFlags="feature_flags",r.Recordings="recordings",r})({});class oo{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((t=>{var i=t&&typeof t=="string"&&t.trim().length>0;return i||se.error("Invalid evaluation environment found:",t,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(gi),t=this._instance.get_property(Qe),i=this._instance.get_property(St);if(!i&&!t)return e||{};var s=A({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var a of n){var o,l,c=s[a],u=t==null?void 0:t[a],d=m(u)?(o=c==null?void 0:c.enabled)!==null&&o!==void 0&&o:!!u,f=m(u)?c.variant:typeof u=="string"?u:void 0,p=i==null?void 0:i[a],g=E({},c,{enabled:d,variant:d?f??(c==null?void 0:c.variant):void 0});d!==(c==null?void 0:c.enabled)&&(g.original_enabled=c==null?void 0:c.enabled),f!==(c==null?void 0:c.variant)&&(g.original_variant=c==null?void 0:c.variant),p&&(g.metadata=E({},c==null?void 0:c.metadata,{payload:p,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),s[a]=g}return this.ii||(se.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ii=!0),s}getFlagVariants(){var e=this._instance.get_property(We),t=this._instance.get_property(Qe);if(!t)return e||{};for(var i=A({},e),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(se.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(Xs),t=this._instance.get_property(St);if(!t)return e||{};for(var i=A({},e||{}),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(se.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.di()}),5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}di(e){var t;if(this.vi(),!this._instance.M())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:E({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(lt)||{}),group_properties:this._instance.get_property(Me)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var s=this._instance.config.__preview_remote_config,n=s?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags",n+a);s&&(i.timezone=Ds()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:me.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(ao.FeatureFlags))se.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.");else{var f;i.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},d),this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,n=this._instance.get_property(Ks)||void 0,a=this._instance.get_property(Nt)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(s))){var o,l,c,u,d,f,p,g,_;F(a[e])?a[e].push(s):a[e]=[s],(o=this._instance.persistence)==null||o.register({[Nt]:a});var w=this.getFeatureFlagDetails(e),k={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};m(w==null||(u=w.metadata)==null?void 0:u.version)||(k.$feature_flag_version=w.metadata.version);var S,I=(d=w==null||(f=w.reason)==null?void 0:f.description)!==null&&d!==void 0?d:w==null||(p=w.reason)==null?void 0:p.code;I&&(k.$feature_flag_reason=I),w!=null&&(g=w.metadata)!=null&&g.id&&(k.$feature_flag_id=w.metadata.id),m(w==null?void 0:w.original_variant)&&m(w==null?void 0:w.original_enabled)||(k.$feature_flag_original_response=m(w.original_variant)?w.original_enabled:w.original_variant),w!=null&&(_=w.metadata)!=null&&_.original_payload&&(k.$feature_flag_original_payload=w==null||(S=w.metadata)==null?void 0:S.original_payload),this._instance.capture("$feature_flag_called",k)}return i}se.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(s.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:s,compression:this._instance.config.disable_compression?void 0:me.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:n=>{var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;t((o==null?void 0:o[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return m(i)?void 0:!!i}se.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.ei=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=no(a),f=d.flags,p=d.featureFlags,g=d.featureFlagPayloads;if(p){var _=a.requestId;if(F(p)){se.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var w={};if(p)for(var k=0;k<p.length;k++)w[p[k]]=!0;o&&o.register({[Wi]:p,[We]:w})}else{var S=p,I=g,P=f;a.errorsWhileComputingFlags&&(S=E({},l,S),I=E({},c,I),P=E({},u,P)),o&&o.register(E({[Wi]:Object.keys(Js(S)),[We]:S||{},[Xs]:I||{},[gi]:P||{}},_?{[Ks]:_}:{}))}}})(e,this._instance.persistence,i,s,n),this.pi(t)}}override(e,t){t===void 0&&(t=!1),se.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return se.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Qe),this._instance.persistence.unregister(St),void this.pi();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,i=e;if(this.ii=!!((t=i.suppressWarning)!==null&&t!==void 0&&t),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Qe);else if(i.flags)if(F(i.flags)){for(var s={},n=0;n<i.flags.length;n++)s[i.flags[n]]=!0;this._instance.persistence.register({[Qe]:s})}else this._instance.persistence.register({[Qe]:i.flags})}return"payloads"in i&&(i.payloads===!1?this._instance.persistence.unregister(St):i.payloads&&this._instance.persistence.register({[St]:i.payloads})),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:t,flagVariants:i}=this.gi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,n=(this._instance.get_property(ot)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=E({},this.getFlagVariants(),{[e]:t});(s=this._instance.persistence)==null||s.register({[Wi]:Object.keys(Js(l)),[We]:l}),this.pi()}getEarlyAccessFeatures(e,t,i){t===void 0&&(t=!1);var s=this._instance.get_property(ot),n=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(s&&!t)return e(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:a=>{var o,l;if(a.json){var c=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(ot),(l=this._instance.persistence)==null||l.register({[ot]:c}),e(c)}}})}gi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((i=>t[i])),flagVariants:Object.keys(t).filter((i=>t[i])).reduce(((i,s)=>(i[s]=t[s],i)),{})}}pi(e){var{flags:t,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((s=>s(t,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(lt)||{};this._instance.register({[lt]:E({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(lt)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(Me)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((s=>{i[s]=E({},i[s],e[s]),delete e[s]})),this._instance.register({[Me]:E({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Me)||{};this._instance.register({[Me]:E({},t,{[e]:{}})})}else this._instance.unregister(Me)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var lo=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class zi{constructor(e,t){this.C=e,this.props={},this.mi=!1,this.yi=(i=>{var s="";return i.token&&(s=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+s+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&b.info("Persistence loaded",e.persistence,E({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wi}bi(e){lo.indexOf(e.persistence.toLowerCase())===-1&&(b.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&M.H()?M:t==="localstorage+cookie"&&Wt.H()?Wt:t==="sessionstorage"&&j.H()?j:t==="memory"?ya:t==="cookie"?ce:Wt.H()?Wt:ce}properties(){var e={};return O(this.props,(function(t,i){if(i===We&&q(t))for(var s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else o=i,l=!1,(_e(a=Zn)?l:or&&a.indexOf===or?a.indexOf(o)!=-1:(O(a,(function(c){if(l||(l=c===o))return Rt})),l))||(e[i]=t);var a,o,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=A({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.$i,this.Si,this.C.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(q(e)){m(t)&&(t="None"),this.xi=m(i)?this.Ei:i;var s=!1;if(O(e,((n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=n,s=!0)})),s)return this.save(),!0}return!1}register(e,t){if(q(e)){this.xi=m(t)?this.Ei:t;var i=!1;if(O(e,((s,n)=>{e.hasOwnProperty(n)&&this.props[n]!==s&&(this.props[n]=s,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.mi){var e=Ps(this.C.custom_campaign_params,this.C.mask_personal_data_properties,this.C.custom_personal_data_properties);Ve(di(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=y==null?void 0:y.referrer)?Is(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Fs(),$referring_domain:y!=null&&y.referrer&&((e=jt(y.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[yi]||this.props[bi]||this.register_once({[Lt]:Os(this.C.mask_personal_data_properties,this.C.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};O([bi,yi],(a=>{var o=this.props[a];o&&O(o,(function(l,c){e["$initial_"+ni(c)]=l}))}));var t,i,s=this.props[Lt];if(s){var n=(t=Rs(s),i={},O(t,(function(a,o){i["$initial_"+ni(o)]=a})),i);A(e,n)}return e}safe_merge(e){return O(this.props,(function(t,i){i in e||(e[i]=t)})),e}update_config(e,t,i){if(this.Ei=this.xi=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){var s=this.bi(e),n=this.props;this.clear(),this.Y=s,this.props=n,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.$i&&(this.$i=e,this.remove(),this.save())}set_secure(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[at]||{};i[e]=t,this.props[at]=i,this.save()}remove_event_timer(e){var t=(this.props[at]||{})[e];return m(t)||(delete this.props[at][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}(function(r){return r.Button="button",r.Tab="tab",r.Selector="selector",r})({}),(function(r){return r.TopLeft="top_left",r.TopRight="top_right",r.TopCenter="top_center",r.MiddleLeft="middle_left",r.MiddleRight="middle_right",r.MiddleCenter="middle_center",r.Left="left",r.Center="center",r.Right="right",r.NextToTrigger="next_to_trigger",r})({});var Yi=(function(r){return r.Popover="popover",r.API="api",r.Widget="widget",r.ExternalSurvey="external_survey",r})({});(function(r){return r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link",r})({}),(function(r){return r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question",r})({}),(function(r){return r.Once="once",r.Recurring="recurring",r.Always="always",r})({});var ti=(function(r){return r.SHOWN="survey shown",r.DISMISSED="survey dismissed",r.SENT="survey sent",r})({}),Zs=(function(r){return r.SURVEY_ID="$survey_id",r.SURVEY_NAME="$survey_name",r.SURVEY_RESPONSE="$survey_response",r.SURVEY_ITERATION="$survey_iteration",r.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",r.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",r.SURVEY_SUBMISSION_ID="$survey_submission_id",r.SURVEY_QUESTIONS="$survey_questions",r.SURVEY_COMPLETED="$survey_completed",r})({}),Qs=(function(r){return r.Popover="popover",r.Inline="inline",r})({});class Xi{constructor(){this.ki={},this.ki={}}on(e,t){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(t),()=>{this.ki[e]=this.ki[e].filter((i=>i!==t))}}emit(e,t){for(var i of this.ki[e]||[])i(t);for(var s of this.ki["*"]||[])s(e,t)}}class Ue{constructor(e){this.Pi=new Xi,this.Ti=(t,i)=>this.Ii(t,i)&&this.Ri(t,i)&&this.Ci(t,i),this.Ii=(t,i)=>i==null||!i.event||(t==null?void 0:t.event)===(i==null?void 0:i.event),this._instance=e,this.Oi=new Set,this.Fi=new Set}init(){var e;if(!m((e=this._instance)==null?void 0:e.Mi)){var t;(t=this._instance)==null||t.Mi(((i,s)=>{this.on(i,s)}))}}register(e){var t,i;if(!m((t=this._instance)==null?void 0:t.Mi)&&(e.forEach((a=>{var o,l;(o=this.Fi)==null||o.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Oi)==null||u.add((c==null?void 0:c.event)||"")}))})),(i=this._instance)!=null&&i.autocapture)){var s,n=new Set;e.forEach((a=>{var o;(o=a.steps)==null||o.forEach((l=>{l!=null&&l.selector&&n.add(l==null?void 0:l.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(n)}}on(e,t){var i;t!=null&&e.length!=0&&(this.Oi.has(e)||this.Oi.has(t==null?void 0:t.event))&&this.Fi&&((i=this.Fi)==null?void 0:i.size)>0&&this.Fi.forEach((s=>{this.Ai(t,s)&&this.Pi.emit("actionCaptured",s.name)}))}Di(e){this.onAction("actionCaptured",(t=>e(t)))}Ai(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var i of t.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,t){return this.Pi.on(e,t)}Ri(e,t){if(t!=null&&t.url){var i,s=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!s||typeof s!="string"||!Ue.ji(s,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static ji(e,t,i){switch(i){case"regex":return!!h&&Ze(e,t);case"exact":return t===e;case"contains":var s=Ue.Li(t).replace(/_/g,".").replace(/%/g,".*");return Ze(e,s);default:return!1}}static Li(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ci(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Ni(e).some((n=>!(t!=null&&t.href&&!Ue.ji(n.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||n.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!Ue.ji(n.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!Ue.ji(n.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")))))return!1;if(t!=null&&t.selector){var i,s=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(!s||!s.includes(t==null?void 0:t.selector))return!1}return!0}Ni(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var T=U("[Surveys]"),Ki="seenSurvey_",co=(r,e)=>{var t="$survey_"+e+"/"+r.id;return r.current_iteration&&r.current_iteration>0&&(t="$survey_"+e+"/"+r.id+"/"+r.current_iteration),t},en=r=>{var e=""+Ki+r.id;return r.current_iteration&&r.current_iteration>0&&(e=""+Ki+r.id+"_"+r.current_iteration),e},uo=[Yi.Popover,Yi.Widget,Yi.API],ho={ignoreConditions:!1,ignoreDelay:!1,displayType:Qs.Popover};class po{constructor(e){this._instance=e,this.Ui=new Map,this.zi=new Map}register(e){var t;m((t=this._instance)==null?void 0:t.Mi)||(this.Hi(e),this.Bi(e))}Bi(e){var t=e.filter((i=>{var s,n;return((s=i.conditions)==null?void 0:s.actions)&&((n=i.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0}));t.length!==0&&(this.qi==null&&(this.qi=new Ue(this._instance),this.qi.init(),this.qi.Di((i=>{this.onAction(i)}))),t.forEach((i=>{var s,n,a,o,l;i.conditions&&(s=i.conditions)!=null&&s.actions&&(n=i.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.qi)==null||o.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.zi.get(c.name);u&&u.push(i.id),this.zi.set(c.name,u||[i.id])}})))})))}Hi(e){var t;e.filter((i=>{var s,n;return((s=i.conditions)==null?void 0:s.events)&&((n=i.conditions)==null||(n=n.events)==null||(n=n.values)==null?void 0:n.length)>0})).length!==0&&((t=this._instance)==null||t.Mi(((i,s)=>{this.onEvent(i,s)})),e.forEach((i=>{var s;(s=i.conditions)==null||(s=s.events)==null||(s=s.values)==null||s.forEach((n=>{if(n&&n.name){var a=this.Ui.get(n.name);a&&a.push(i.id),this.Ui.set(n.name,a||[i.id])}}))})))}onEvent(e,t){var i,s,n=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[At])||[];if(ti.SHOWN===e&&t&&n.length>0){var a;T.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:n});var o=t==null||(a=t.properties)==null?void 0:a.$survey_id;if(o){var l=n.indexOf(o);l>=0&&(n.splice(l,1),this.Wi(n))}}else if(this.Ui.has(e)){T.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Ui.get(e)});var c=[];(s=this._instance)==null||s.getSurveys((d=>{c=d.filter((f=>{var p;return(p=this.Ui.get(e))==null?void 0:p.includes(f.id)}))}));var u=c.filter((d=>{var f,p=(f=d.conditions)==null||(f=f.events)==null||(f=f.values)==null?void 0:f.find((g=>g.name===e));return!!p&&(!p.propertyFilters||Object.entries(p.propertyFilters).every((g=>{var _,[w,k]=g,S=t==null||(_=t.properties)==null?void 0:_[w];if(m(S)||_e(S))return!1;var I=[String(S)],P=Ys[k.operator];return P?P(k.values,I):(T.warn("Unknown property comparison operator: "+k.operator),!1)})))}));this.Wi(n.concat(u.map((d=>d.id))||[]))}}onAction(e){var t,i=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[At])||[];this.zi.has(e)&&this.Wi(i.concat(this.zi.get(e)||[]))}Wi(e){var t;T.info("updating activated surveys",{activatedSurveys:e}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[At]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[At];return t||[]}getEventToSurveys(){return this.Ui}Gi(){return this.qi}}class fo{constructor(e){this.Vi=void 0,this._surveyManager=null,this.Ji=!1,this.Ki=!1,this.Yi=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(R(t))return T.warn("Flags not loaded yet. Not loading surveys.");var i=F(t);this.Vi=i?t.length>0:t,T.info("flags response received, isSurveysEnabled: "+this.Vi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(i!=null&&i.startsWith(Ki)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((s=>localStorage.removeItem(s)))}loadIfEnabled(){if(!this._surveyManager)if(this.Ki)T.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)T.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())T.info("Not loading surveys in cookieless mode without consent.");else{var e=x==null?void 0:x.__PosthogExtensions__;if(e){if(!m(this.Vi)||this._instance.config.advanced_enable_surveys){var t=this.Vi||this._instance.config.advanced_enable_surveys;this.Ki=!0;try{var i=e.generateSurveys;if(i)return void this.Xi(i,t);var s=e.loadExternalDependency;if(!s)return void this.Qi("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",(n=>{n||!e.generateSurveys?this.Qi("Could not load surveys script",n):this.Xi(e.generateSurveys,t)}))}catch(n){throw this.Qi("Error initializing surveys",n),n}finally{this.Ki=!1}}}else T.error("PostHog Extensions not found.")}}Xi(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new po(this._instance),T.info("Surveys loaded successfully"),this.Zi({isLoaded:!0})}Qi(e,t){T.error(e,t),this.Zi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yi.push(e),this._surveyManager&&this.Zi({isLoaded:!0}),()=>{this.Yi=this.Yi.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return T.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(_i);if(i&&!t)return e(i,{isLoaded:!0});if(this.Ji)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ji=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var n;this.Ji=!1;var a=s.statusCode;if(a!==200||!s.json){var o="Surveys API could not be loaded, status: "+a;return T.error(o),e([],{isLoaded:!1,error:o})}var l,c=s.json.surveys||[],u=c.filter((d=>(function(f){return!(!f.start_date||f.end_date)})(d)&&((function(f){var p;return!((p=f.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)})(d)||(function(f){var p;return!((p=f.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)})(d))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(n=this._instance.persistence)==null||n.register({[_i]:c}),e(c,{isLoaded:!0})}})}catch(s){throw this.Ji=!1,s}}Zi(e){for(var t of this.Yi)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){T.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!R(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);T.warn("init was not called")}te(e){var t=null;return this.getSurveys((i=>{var s;t=(s=i.find((n=>n.id===e)))!==null&&s!==void 0?s:null})),t}ie(e){if(R(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.te(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(R(this._surveyManager))return T.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ie(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return R(this._surveyManager)?(T.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((s=>{var n,a=(n=s.find((l=>l.id===e)))!==null&&n!==void 0?n:null;if(a){var o=this.ie(a);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){var i;if(R(this._surveyManager))T.warn("init was not called");else{var s=typeof e=="string"?this.te(e):e;if(s!=null&&s.id)if(uo.includes(s.type)){var n=y==null?void 0:y.querySelector(t);if(n)return(i=s.appearance)!=null&&i.surveyPopupDelaySeconds?(T.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,o;T.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(s,n),T.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n);T.warn("Survey element not found")}else T.warn("Surveys of type "+s.type+" cannot be rendered in the app");else T.warn("Survey not found")}}displaySurvey(e,t){var i;if(R(this._surveyManager))T.warn("init was not called");else{var s=this.te(e);if(s){var n=s;if((i=s.appearance)!=null&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=E({},s,{appearance:E({},s.appearance,{surveyPopupDelaySeconds:0})})),t.ignoreConditions===!1){var a=this.canRenderSurvey(s);if(!a.visible)return void T.warn("Survey is not eligible to be displayed: ",a.disabledReason)}t.displayType!==Qs.Inline?this._surveyManager.handlePopoverSurvey(n):this.renderSurvey(n,t.selector)}else T.warn("Survey not found")}}}var tn=U("[RateLimiter]");class go{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=s=>{var n=s.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((a=>{tn.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void tn.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:n})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,s;e===void 0&&(e=!1);var n=new Date().getTime(),a=(t=(i=this.instance.persistence)==null?void 0:i.get_property(mi))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:n};a.tokens+=(n-a.last)/1e3*this.captureEventsPerSecond,a.last=n,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(s=this.instance.persistence)==null||s.set_property(mi,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var qe=U("[RemoteConfig]");class _o{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}ee(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.loadExternalDependency?(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(qe.error("PostHog Extensions not found. Cannot load remote config."),e())}re(e){this._instance.ci({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 qe.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.M())return void qe.warn("Remote config is disabled. Falling back to local config.");this.ee((e=>{if(!e)return qe.info("No config found after loading remote JS config. Falling back to JSON."),void this.re((t=>{this.fi(t)}));this.fi(e)}))}catch(e){qe.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):qe.info("__preview_remote_config is disabled. Logging config instead",e):qe.error("Failed to fetch remote config from PostHog.")}}var Ji=3e3;class vo{constructor(e,t){this.se=!0,this.ne=[],this.oe=le((t==null?void 0:t.flush_interval_ms)||Ji,250,5e3,b.createLogger("flush interval"),Ji),this.ae=e}enqueue(e){this.ne.push(e),this.le||this.ue()}unload(){this.he();var e=this.ne.length>0?this.de():{},t=Object.values(e);[...t.filter((i=>i.url.indexOf("/e")===0)),...t.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ae(E({},i,{transport:"sendBeacon"}))}))}enable(){this.se=!1,this.ue()}ue(){var e=this;this.se||(this.le=setTimeout((()=>{if(this.he(),this.ne.length>0){var t=this.de(),i=function(){var n=t[s],a=new Date().getTime();n.data&&F(n.data)&&O(n.data,(o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp})),e.ae(n)};for(var s in t)i()}}),this.oe))}he(){clearTimeout(this.le),this.le=void 0}de(){var e={};return O(this.ne,(t=>{var i,s=t,n=(s?s.batchKey:null)||s.url;m(e[n])&&(e[n]=E({},s,{data:[]})),(i=e[n].data)==null||i.push(s.data)})),this.ne=[],e}}var mo=["retriesPerformedSoFar"];class yo{constructor(e){this.ve=!1,this.ce=3e3,this.ne=[],this._instance=e,this.ne=[],this.fe=!0,!m(h)&&"onLine"in h.navigator&&(this.fe=h.navigator.onLine,this.pe=()=>{this.fe=!0,this.Dt()},this.ge=()=>{this.fe=!1},L(h,"online",this.pe),L(h,"offline",this.ge))}get length(){return this.ne.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=dr(e,mo);oe(t)&&t>0&&(i.url=Zt(i.url,{retry_count:t})),this._instance.ci(E({},i,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(t??0)<10?this._e(E({retriesPerformedSoFar:t},i)):i.callback==null||i.callback(s)}}))}_e(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=(function(a){var o=3e3*Math.pow(2,a),l=o/2,c=Math.min(18e5,o),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(t),s=Date.now()+i;this.ne.push({retryAt:s,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),b.warn(n),this.ve||(this.ve=!0,this.me())}me(){if(this.ye&&clearTimeout(this.ye),this.ne.length===0)return this.ve=!1,void(this.ye=void 0);this.ye=setTimeout((()=>{this.fe&&this.ne.length>0&&this.Dt(),this.me()}),this.ce)}Dt(){var e=Date.now(),t=[],i=this.ne.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.ne=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ve=!1,m(h)||(this.pe&&(h.removeEventListener("online",this.pe),this.pe=void 0),this.ge&&(h.removeEventListener("offline",this.ge),this.ge=void 0)),this.ne))try{this._instance.ci(E({},e,{transport:"sendBeacon"}))}catch(t){b.error(t)}this.ne=[]}}class bo{constructor(e){this.be=()=>{var t,i,s,n;this.we||(this.we={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=o+((a==null?void 0:a.clientHeight)||0),u=(a==null?void 0:a.scrollHeight)||0;this.we.lastScrollY=Math.ceil(o),this.we.maxScrollY=Math.max(o,(t=this.we.maxScrollY)!==null&&t!==void 0?t:0),this.we.maxScrollHeight=Math.max(l,(i=this.we.maxScrollHeight)!==null&&i!==void 0?i:0),this.we.lastContentY=c,this.we.maxContentY=Math.max(c,(s=this.we.maxContentY)!==null&&s!==void 0?s:0),this.we.maxContentHeight=Math.max(u,(n=this.we.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}getContext(){return this.we}resetContext(){var e=this.we;return setTimeout(this.be,0),e}startMeasuringScrollPosition(){L(h,"scroll",this.be,{capture:!0}),L(h,"scrollend",this.be,{capture:!0}),L(h,"resize",this.be)}scrollElement(){if(!this._instance.config.scroll_root_selector)return h==null?void 0:h.document.documentElement;var e=F(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=h==null?void 0:h.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return h&&(h.scrollY||h.pageYOffset||h.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return h&&(h.scrollX||h.pageXOffset||h.document.documentElement.scrollLeft)||0}}var wo=r=>Os(r==null?void 0:r.config.mask_personal_data_properties,r==null?void 0:r.config.custom_personal_data_properties);class rn{constructor(e,t,i,s){this.xe=n=>{var a=this.$e();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Se(this._instance)};this.Ee.register({[vi]:o})}},this._instance=e,this.ke=t,this.Ee=i,this.Se=s||wo,this.ke.onSessionId(this.xe)}$e(){return this.Ee.props[vi]}getSetOnceProps(){var e,t=(e=this.$e())==null?void 0:e.props;return t?"r"in t?Rs(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 O(di(this.getSetOnceProps()),((t,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+ni(i)]=t})),e}}var Zi=U("[SessionId]");class sn{on(e,t){return this.Pe.on(e,t)}constructor(e,t,i){var s;if(this.Te=[],this.Ie=void 0,this.Pe=new Xi,this.Re=(u,d)=>Math.abs(u-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.C=e.config,this.Ee=e.persistence,this.Ce=void 0,this.Oe=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fe=t||Pe,this.Me=i||Pe;var n=this.C.persistence_name||this.C.token,a=this.C.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*le(a,60,36e3,Zi.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ae(),this.De="ph_"+n+"_window_id",this.je="ph_"+n+"_primary_window_exists",this.Le()){var o=j.W(this.De),l=j.W(this.je);o&&!l?this.Ce=o:j.V(this.De),j.G(this.je,!0)}if((s=this.C.bootstrap)!=null&&s.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.C.bootstrap.sessionID);this.Ne(this.C.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Zi.error("Invalid sessionID in bootstrap",u)}this.Ue()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return m(this.Te)&&(this.Te=[]),this.Te.push(e),this.Oe&&e(this.Oe,this.Ce),()=>{this.Te=this.Te.filter((t=>t!==e))}}Le(){return this.C.persistence!=="memory"&&!this.Ee.wi&&j.H()}ze(e){e!==this.Ce&&(this.Ce=e,this.Le()&&j.G(this.De,e))}He(){return this.Ce?this.Ce:this.Le()?j.W(this.De):null}Ne(e,t,i){e===this.Oe&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Oe=e,this.Ee.register({[Mt]:[t,e,i]}))}Be(){if(this.Oe&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Oe,this._sessionStartTimestamp];var e=this.Ee.props[Mt];return F(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ne(null,null,null)}destroy(){clearTimeout(this.qe),this.qe=void 0,this.Ie&&h&&(h.removeEventListener("beforeunload",this.Ie,{capture:!1}),this.Ie=void 0),this.Te=[]}Ue(){this.Ie=()=>{this.Le()&&j.V(this.je)},L(h,"beforeunload",this.Ie,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.C.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||new Date().getTime(),[s,n,a]=this.Be(),o=this.He(),l=oe(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!n,d=!u&&!e&&this.Re(i,s);u||d||l?(n=this.Fe(),o=this.Me(),Zi.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=i,c=!0):o||(o=this.Me(),c=!0);var f=s===0||!e||l?i:s,p=a===0?new Date().getTime():a;return this.ze(o),this.Ne(n,f,p),e||this.Ae(),c&&this.Te.forEach((g=>g(n,o,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Ae(){clearTimeout(this.qe),this.qe=setTimeout((()=>{var[e]=this.Be();if(this.Re(new Date().getTime(),e)){var t=this.Oe;this.resetSessionId(),this.Pe.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var Eo=["$set_once","$set"],Te=U("[SiteApps]");class ko{constructor(e){this._instance=e,this.We=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ge(e,t){if(t){var i=this.globalsForEvent(t);this.We.push(i),this.We.length>1e3&&(this.We=this.We.slice(10))}}get siteAppLoaders(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Mi(this.Ge.bind(this));this.Ve=()=>{e(),this.We=[],this.Ve=void 0}}}globalsForEvent(e){var t,i,s,n,a,o,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,p]of Object.entries(d))c[f]={id:u[f],type:f,properties:p};var{$set_once:g,$set:_}=e;return{event:E({},dr(e,Eo),{properties:E({},e.properties,_?{$set:E({},(t=(i=e.properties)==null?void 0:i.$set)!==null&&t!==void 0?t:{},_)}:{},g?{$set_once:E({},(s=(n=e.properties)==null?void 0:n.$set_once)!==null&&s!==void 0?s:{},g)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var o;!t.errored&&this.We.length&&(Te.info("Processing "+this.We.length+" events for site app with id "+e.id),this.We.forEach((l=>t.processEvent==null?void 0:t.processEvent(l))),t.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((o=this.Ve)==null||o.call(this))},s=!1,n=o=>{t.errored=!o,t.loaded=!0,Te.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),s&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{n(o)}});a&&(t.processEvent=a),s=!0}catch(o){Te.error("Error while initializing PostHog app with config id "+e.id,o),n(!1)}if(s&&t.loaded)try{i()}catch(o){Te.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Je(){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)}Ke(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(t)}catch(s){Te.error("Error while processing event "+e.event+" for site app "+i.id,s)}}}onRemoteConfig(e){var t,i,s,n=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Je(),void this._instance.on("eventCaptured",(c=>this.Ke(c)))):void Te.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ve)==null||i.call(this),(s=e.siteApps)!=null&&s.length)if(this.isEnabled){var a=function(c){var u;x["__$$ph_site_app_"+c]=n._instance,(u=x.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(n._instance,l,(d=>{if(d)return Te.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:o,url:l}of e.siteApps)a(o)}else Te.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var nn=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&hr(t,e))return!0;try{var i=r==null?void 0:r.userAgentData;if(i!=null&&i.brands&&i.brands.some((s=>hr(s==null?void 0:s.brand,e))))return!0}catch{}return!!r.webdriver},Ct=(function(r){return r.US="us",r.EU="eu",r.CUSTOM="custom",r})({}),an="i.posthog.com";class xo{constructor(e){this.Ye={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"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=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+an,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Ye[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=Ct.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=Ct.EU:this.Ye[this.apiHost]=Ct.CUSTOM),this.Ye[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(this.region===Ct.CUSTOM)return this.apiHost+t;var i=an+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var So={icontains:(r,e)=>!!h&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!h&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!h&&Ze(e.href,r),not_regex:(r,e)=>!!h&&!Ze(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r};class V{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),t.getWebExperiments((s=>{V.Xe("retrieved web experiments from the server"),t.Qe=new Map,s.forEach((n=>{if(n.feature_flag_key){var a;t.Qe&&(V.Xe("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Qe)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);B(o)&&n.variants[o]&&t.Ze(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var c=n.variants[l];V.tr(c)&&t.Ze(n.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())V.Xe("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(R(this.Qe))return this.Qe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();V.Xe("applying feature flags",e),e.forEach((t=>{var i;if(this.Qe&&(i=this.Qe)!=null&&i.has(t)){var s,n=this._instance.getFeatureFlag(t),a=(s=this.Qe)==null?void 0:s.get(t);n&&a!=null&&a.variants[n]&&this.Ze(a.name,n,a.variants[n].transforms)}}))}}previewWebExperiment(){var e=V.getWindowLocation();if(e!=null&&e.search){var t=Vt(e==null?void 0:e.search,"__experiment_id"),i=Vt(e==null?void 0:e.search,"__experiment_variant");t&&i&&(V.Xe("previewing web experiments "+t+" && "+i),this.getWebExperiments((s=>{this.ir(parseInt(t),i,s)}),!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 s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>{if(n.statusCode!==200||!n.json)return e([]);var a=n.json.experiments||[];return e(a)}})}ir(e,t,i){var s=i.filter((n=>n.id===e));s&&s.length>0&&(V.Xe("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Ze(s[0].name,t,s[0].variants[t].transforms))}static tr(e){return!R(e.conditions)&&V.er(e)&&V.rr(e)}static er(e){var t;if(R(e.conditions)||R((t=e.conditions)==null?void 0:t.url))return!0;var i,s,n,a=V.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||So[(s=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,a))}static getWindowLocation(){return h==null?void 0:h.location}static rr(e){var t;if(R(e.conditions)||R((t=e.conditions)==null?void 0:t.utm))return!0;var i=Ps();if(i.utm_source){var s,n,a,o,l,c,u,d,f=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==i.utm_campaign,p=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,g=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==i.utm_term;return f&&g&&_&&p}return!1}static Xe(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];b.info("[WebExperiments] "+e,i)}Ze(e,t,i){this._is_bot()?V.Xe("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach((s=>{if(s.selector){var n;V.Xe("applying transform of variant "+t+" for experiment "+e+" ",s);var a=(n=document)==null?void 0:n.querySelectorAll(s.selector);a==null||a.forEach((o=>{var l=o;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)}))}})):V.Xe("Control variants leave the page unmodified.")}_is_bot(){return K&&this._instance?nn(K,this._instance.config.custom_blocked_useragents):void 0}}var Co=U("[PostHog ExternalIntegrations]"),Po={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class $o{constructor(e){this._instance=e}it(e,t){var i;(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(s=>{if(s)return Co.error("failed to load script",s);t()}))}startIfEnabledOrStop(){var e=this,t=function(a){var o,l,c;!s||(o=x.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.it(Po[a],(()=>{var u;(u=x.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!s&&(l=x.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=x.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,s]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;t(i)}}}var Qi="[SessionRecording]",Pt=U(Qi);class on{get started(){var e;return!((e=this.sr)==null||!e.isStarted)}get status(){return this.sr?this.sr.status:this.nr&&!this.ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.nr=!1,this.lr=void 0,this._instance=e,!this._instance.sessionManager)throw Pt.error("started without valid sessionManager"),new Error(Qi+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Qi+' cannot be used with cookieless_mode="always"')}get ar(){var e,t=!((e=this._instance.get_property(fi))==null||!e.enabled),i=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return h&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.ar||(t=this.sr)==null||!t.isStarted){var i=!m(Object.assign)&&!m(Array.from);this.ar&&i?(this.ur(e),Pt.info("starting")):this.stopRecording()}}ur(e){var t,i,s;this.ar&&(x!=null&&(t=x.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(i=x.__PosthogExtensions__)!=null&&i.initSessionRecording?this.hr(e):(s=x.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.dr,(n=>{if(n)return Pt.error("could not load recorder",n);this.hr(e)})))}stopRecording(){var e,t;(e=this.lr)==null||e.call(this),this.lr=void 0,(t=this.sr)==null||t.stop()}vr(){var e;(e=this._instance.persistence)==null||e.unregister(Or)}cr(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,n=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,o=a==null?void 0:a.sampleRate,l=R(o)?null:parseFloat(o);R(l)&&this.vr();var c=a==null?void 0:a.minimumDurationMilliseconds;s.register({[fi]:E({enabled:!!a},a,{networkPayloadCapture:E({capturePerformance:e.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:l,minimumDurationMilliseconds:m(c)?null:c,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers})})};n(),(t=this.lr)==null||t.call(this),this.lr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(n)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.cr(e),this.nr=!0,this.startIfEnabledOrStop()):this.nr=!0:Pt.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;t===void 0&&(t="log"),(i=this.sr)!=null&&i.log?this.sr.log(e,t):Pt.warn("log called before recorder was ready")}get dr(){var e,t,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(fi);return(i==null||(t=i.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}hr(e){var t,i;if((t=x.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.sr||(this.sr=(i=x.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.sr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.sr.start(e)}onRRwebEmit(e){var t;(t=this.sr)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.sr||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.sr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.sr||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.sr)==null||e.overrideSampling()}overrideTrigger(e){var t,i;this.sr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.sr)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.sr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!((i=this.sr)==null||!i.tryAddCustomEvent(e,t))}}var $t={},er=()=>{},et="posthog",ln=!ro&&(Y==null?void 0:Y.indexOf("MSIE"))===-1&&(Y==null?void 0:Y.indexOf("Mozilla"))===-1,cn=r=>{var e;return E({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Jn(y==null?void 0:y.location),persistence:"localStorage+cookie",persistence_name:"",loaded:er,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:r??"unset",__preview_deferred_init_extensions:!1,debug:z&&B(z==null?void 0:z.search)&&z.search.indexOf("__posthog_debug=true")!==-1||!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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(h==null||(e=h.location)==null?void 0:e.protocol)==="https:",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:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;b.error(i)},get_device_id:t=>t,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:Ji},error_tracking:{},_onCapture:er,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(r))},un=r=>{var e={};m(r.process_person)||(e.person_profiles=r.process_person),m(r.xhr_headers)||(e.request_headers=r.xhr_headers),m(r.cookie_name)||(e.persistence_name=r.cookie_name),m(r.disable_cookie)||(e.disable_persistence=r.disable_cookie),m(r.store_google)||(e.save_campaign_params=r.store_google),m(r.verbose)||(e.debug=r.verbose);var t=A({},e,r);return F(r.property_blacklist)&&(m(r.property_denylist)?t.property_denylist=r.property_blacklist:F(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:b.error("Invalid value for property_denylist config: "+r.property_denylist)),t};class Io{constructor(){this.__forceAllowLocalhost=!1}get pr(){return this.__forceAllowLocalhost}set pr(e){b.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ii{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Io,this.gr=!1,this.version=ge.LIB_VERSION,this._r=new Xi,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=cn(),this.SentryIntegration=Ca,this.sentryIntegration=e=>(function(t,i){var s=ns(t,i);return{name:ss,processEvent:n=>s(n)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.mr=!1,this.yr=null,this.br=null,this.wr=null,this.featureFlags=new oo(this),this.toolbar=new $a(this),this.scrollManager=new bo(this),this.pageViewManager=new Ya(this),this.surveys=new fo(this),this.experiments=new V(this),this.exceptions=new so(this),this.rateLimiter=new go(this),this.requestRouter=new xo(this),this.consent=new ba(this),this.externalIntegrations=new $o(this),this.people={set:(e,t,i)=>{var s=B(e)?{[e]:t}:e;this.setPersonProperties(s),i==null||i({})},set_once:(e,t,i)=>{var s=B(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),i==null||i({})}},this.on("eventCaptured",(e=>b.info('send "'+(e==null?void 0:e.event)+'"',e)))}init(e,t,i){if(i&&i!==et){var s,n=(s=$t[i])!==null&&s!==void 0?s:new ii;return n._init(e,t,i),$t[i]=n,$t[et][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var s;if(t===void 0&&(t={}),m(e)||ai(e))return b.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={},t.debug=this.$r(t.debug),this.Sr=t,this.Er=[],t.person_profiles&&(this.br=t.person_profiles),this.set_config(A({},cn(t.defaults),un(t),{name:i,token:e})),this.config.on_xhr_error&&b.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:me.GZipJS;var n=this.kr();this.persistence=new zi(this.config,n),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new zi(E({},this.config,{persistence:"sessionStorage"}),n);var a=E({},this.persistence.props),o=E({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Pr=new vo((S=>this.Tr(S)),this.config.request_queue_config),this.Ir=new yo(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new sn(this),this.sessionPropsManager=new rn(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(b.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Rr(l)}),0)):(b.info("Initializing extensions synchronously"),this.Rr(l)),ge.DEBUG=ge.DEBUG||this.config.debug,ge.DEBUG&&b.info("Starting in debug mode",{this:this,config:t,thisC:E({},this.config),p:a,s:o}),((s=t.bootstrap)==null?void 0:s.distinctID)!==void 0){var c,u,d=this.config.get_device_id(Pe()),f=(c=t.bootstrap)!=null&&c.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(ve,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:f})}if(this.Cr()){var p,g,_=Object.keys(((p=t.bootstrap)==null?void 0:p.featureFlags)||{}).filter((S=>{var I;return!((I=t.bootstrap)==null||(I=I.featureFlags)==null||!I[S])})).reduce(((S,I)=>{var P;return S[I]=((P=t.bootstrap)==null||(P=P.featureFlags)==null?void 0:P[I])||!1,S}),{}),w=Object.keys(((g=t.bootstrap)==null?void 0:g.featureFlagPayloads)||{}).filter((S=>_[S])).reduce(((S,I)=>{var P,N;return(P=t.bootstrap)!=null&&(P=P.featureFlagPayloads)!=null&&P[I]&&(S[I]=(N=t.bootstrap)==null||(N=N.featureFlagPayloads)==null?void 0:N[I]),S}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:w})}if(l)this.register_once({distinct_id:ct,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(Pe());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(ve,"anonymous")}return L(h,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Sa(this,(()=>this.Or())):this.Or(),ke(this.config._onCapture)&&this.config._onCapture!==er&&(b.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(S=>this.config._onCapture(S.event,S)))),this.config.ip&&b.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}Rr(e){var t=performance.now();this.historyAutocapture=new xa(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new Ta(this).startIfEnabledOrStop()})),i.push((()=>{var s;this.siteApps=new ko(this),(s=this.siteApps)==null||s.init()})),e||i.push((()=>{this.sessionRecording=new on(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new ha(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new za(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new Ga(this)})),i.push((()=>{this.exceptionObserver=new ka(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new is(this,Ea),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Fr){var s=this.Fr;this.Fr=void 0,this.fi(s)}})),this.Mr(i,t)}Mr(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Mr(e,t)}),0);var i=e.shift();if(i)try{i()}catch(n){b.error("Error initializing extension:",n)}}var s=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:s}),this.config.__preview_deferred_init_extensions&&b.info("PostHog extensions initialized ("+s+"ms)")}fi(e){var t,i,s,n,a,o,l,c;if(!y||!y.body)return b.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Fr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=C(e.supportedCompression,me.GZipJS)?me.GZipJS:C(e.supportedCompression,me.Base64)?me.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.br?this.br:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(s=this.sessionRecording)==null||s.onRemoteConfig(e),(n=this.autocapture)==null||n.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Or(){try{this.config.loaded(this)}catch(e){b.critical("`loaded` function failed",e)}this.Ar(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Dr()}),1),new _o(this).load(),this.featureFlags.flags()}Ar(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Pr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Se(this.__request_queue,(e=>this.Tr(e))),this.__request_queue=[],this.Ar()}_handle_unload(){var e,t;this.config.request_batching?(this.jr()&&this.capture("$pageleave"),(e=this.Pr)==null||e.unload(),(t=this.Ir)==null||t.unload()):this.jr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(ln?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Zt(e.url,{ip:this.config.ip?1:0}),e.headers=E({},this.config.request_headers),e.compression=e.compression==="best-available"?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,(t=>{var i,s,n,a=E({},t);a.timeout=a.timeout||6e4,a.url=Zt(a.url,{_:new Date().getTime().toString(),ver:ge.LIB_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Qt.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(s=(n=xr(l,(u=>u.transport===o)))==null?void 0:n.method)!==null&&s!==void 0?s:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(E({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((i=(s=this.config).on_request_error)==null||i.call(s,t)),e.callback==null||e.callback(t)}}))))}Tr(e){this.Ir?this.Ir.retriableRequest(e):this.ci(e)}_execute_array(e){var t,i=[],s=[],n=[];Se(e,(o=>{o&&(t=o[0],F(t)?n.push(o):ke(o)?o.call(this):F(o)&&t==="alias"?i.push(o):F(o)&&t.indexOf("capture")!==-1&&ke(this[t])?n.push(o):s.push(o))}));var a=function(o,l){Se(o,(function(c){if(F(c[0])){var u=l;O(c,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(s,this),a(n,this)}Cr(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Pr){if(this.is_capturing())if(!m(e)&&B(e)){var n=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(n&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){t!=null&&t.$current_url&&!B(t==null?void 0:t.$current_url)&&(b.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),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,l=(i==null?void 0:i.timestamp)||o,c=Pe(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,t||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&n&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i!=null&&i.$set&&(u.$set=i==null?void 0:i.$set);var d,f=this.Lr(i==null?void 0:i.$set_once);if(f&&(u.$set_once=f),(u=Xn(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,m(i==null?void 0:i.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),e===ti.DISMISSED||e===ti.SENT){var p=t==null?void 0:t[Zs.SURVEY_ID],g=t==null?void 0:t[Zs.SURVEY_ITERATION];d={id:p,current_iteration:g},localStorage.getItem(en(d))||localStorage.setItem(en(d),"true"),u.$set=E({},u.$set,{[co({id:p,current_iteration:g},e===ti.SENT?"responded":"dismissed")]:!0})}var _=E({},u.properties.$set,u.$set);if(Ve(_)||this.setPersonPropertiesForFlags(_),!R(this.config.before_send)){var w=this.Nr(u);if(!w)return;u=w}this._r.emit("eventCaptured",u);var k={method:"POST",url:(s=i==null?void 0:i._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i==null?void 0:i._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Tr(k):this.Pr.enqueue(k),u}b.critical("This capture call is ignored due to client rate limiting.")}}else b.error("No event name provided to posthog.capture")}else b.uninitializedWarning("posthog.capture")}Mi(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=E({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=E({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!B(o.distinct_id)&&!oe(o.distinct_id)||ai(o.distinct_id))&&b.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=Ha(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());o.$session_id=d,o.$window_id=f}this.sessionPropsManager&&A(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&A(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.Ir)==null?void 0:p.length}catch(k){o.$sdk_debug_error_capturing_properties=String(k)}if(this.requestRouter.region===Ct.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=A(o,c),e==="$pageview"&&y&&(o.title=y.title),!m(a)){var g=i.getTime()-a;o.$duration=parseFloat((g/1e3).toFixed(3))}Y&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=A({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),F(this.config.property_denylist)?O(this.config.property_denylist,(function(k){delete o[k]})):b.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(b.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var w=this.Ur();return o.$process_person_profile=w,w&&!n&&this.zr("_calculate_event_properties"),o}Lr(e){var t;if(!this.persistence||!this.Ur()||this.gr)return e;var i=this.persistence.get_initial_props(),s=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),n=A({},i,s||{},e||{}),a=this.config.sanitize_properties;return a&&(b.error("sanitize_properties is deprecated. Use before_send instead"),n=a(n,"$set_once")),this.gr=!0,Ve(n)?void 0:n}register(e,t){var i;(i=this.persistence)==null||i.register(e,t)}register_once(e,t,i){var s;(s=this.persistence)==null||s.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Hr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._r.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){t===void 0&&(t=ho),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return b.uninitializedWarning("posthog.identify");if(oe(e)&&(e=e.toString(),b.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()))b.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!==ct){if(this.zr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==s&&e!==this.get_property(nt)&&(this.unregister(nt),this.register({distinct_id:e}));var a=(this.persistence.get_property(ve)||"anonymous")==="anonymous";e!==s&&a?(this.persistence.set_property(ve,"identified"),this.setPersonPropertiesForFlags(E({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.wr=zs(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(Nt))}}else b.critical('The string "'+ct+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else b.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.zr("posthog.setPersonProperties")){var i=zs(this.get_distinct_id(),e,t);this.wr!==i?(this.setPersonPropertiesForFlags(E({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.wr=i):b.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.zr("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:E({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else b.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.zr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,n;if(b.info("reset"),!this.__loaded)return b.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(s=this.persistence)==null||s.set_property(ve,"anonymous"),(n=this.sessionManager)==null||n.resetSessionId(),this.wr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:ct,$device_id:null},"");else{var o=this.config.get_device_id(Pe());this.register_once({distinct_id:o,$device_id:e?o:a},"")}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(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&i){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!i)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return s}alias(e,t){return e===this.get_property(Sr)?(b.critical("Attempting to create alias for existing People user - aborting."),-2):this.zr("posthog.alias")?(m(t)&&(t=this.get_distinct_id()),e!==t?(this.Hr(nt,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(b.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=E({},this.config);if(q(e)){var i,s,n,a,o;A(this.config,un(e));var l=this.kr();(i=this.persistence)==null||i.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new zi(E({},this.config,{persistence:"sessionStorage"}),l);var c=this.$r(this.config.debug);xe(c)&&(this.config.debug=c),xe(this.config.debug)&&(this.config.debug?(ge.DEBUG=!0,M.H()&&M.G("ph_debug","true"),b.info("set_config",{config:e,oldConfig:t,newConfig:E({},this.config)})):(ge.DEBUG=!1,M.H()&&M.V("ph_debug"))),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(n=this.autocapture)==null||n.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Br(),(o=this.externalIntegrations)==null||o.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var s,n,a,o,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),i.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(E({},s,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:et;return t!==et&&(t=et+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(ve))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(ve))==="identified"}Ur(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ve(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[nt])&&((t=this.persistence)==null||(t=t.props)==null||!t[Bt]))}jr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ur()||this.zr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}zr(e){return this.config.person_profiles==="never"?(b.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Hr(Bt,!0),!0)}kr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!t}Br(){var e,t,i,s,n=this.kr();return((e=this.persistence)==null?void 0:e.wi)!==n&&((i=this.persistence)==null||i.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t.wi)!==n&&((s=this.sessionPersistence)==null||s.set_disabled(n)),n}opt_in_capturing(e){if(this.config.cookieless_mode!=="always"){var t,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(t=this.sessionManager)==null||t.destroy(),this.sessionManager=new sn(this),this.persistence&&(this.sessionPropsManager=new rn(this,this.sessionManager,this.persistence)),this.sessionRecording=new on(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Br(),this.Ar(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(m(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e==null?void 0:e.captureEventName)!==null&&i!==void 0?i:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Dr()}else b.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Br(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:ct,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,this.Dr())):b.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===ye.GRANTED?"granted":e===ye.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Br()}_is_bot(){return K?nn(K,this.config.custom_blocked_useragents):void 0}Dr(){y&&(y.visibilityState==="visible"?this.mr||(this.mr=!0,this.capture("$pageview",{title:y.title},{send_instantly:!0}),this.yr&&(y.removeEventListener("visibilitychange",this.yr),this.yr=null)):this.yr||(this.yr=this.Dr.bind(this),L(y,"visibilitychange",this.yr)))}debug(e){e===!1?(h==null||h.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(h==null||h.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}))}M(){var e,t,i,s,n,a,o,l=this.Sr||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(b.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",s=!1,n=b,a=(t="advanced_disable_flags")in(e=l)&&!m(e[t]),o=i in e&&!m(e[i]),a?e[t]:o?(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]):s)}Nr(e){if(R(this.config.before_send))return e;var t=F(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(i=s(i),R(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return En(e.event)?b.warn(n+". This can cause unexpected behavior."):b.info(n),null}i.properties&&!Ve(i.properties)||b.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?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)})}$r(e){var t=xe(e)&&!e,i=M.H()&&M.q("ph_debug")==="true";return!t&&(!!i||e)}}(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=Yn(r.prototype[e[t]])})(ii,["identify"]);var dn;dn=$t[et]=new ii,(function(){function r(){r.done||(r.done=!0,ln=!1,O($t,(function(e){e._dom_loaded()})))}y!=null&&y.addEventListener?y.readyState==="complete"?r():L(y,"DOMContentLoaded",r,{capture:!1}):h&&b.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})();var hn;(function(r){r.USER_ADDED_TO_CART="user_added_to_cart",r.USER_SUBMITTED_CHECKOUT="user_submitted_checkout"})(hn||(hn={}));const To={class:"dialog-block-header-container"},Fo={class:"dialog-block-title"},Oo={class:"dialog-block-description"},Ro=v.defineComponent({__name:"DialogBlockHeader",props:{title:{},description:{}},setup(r){const e=r;return(t,i)=>(v.openBlock(),v.createElementBlock("div",To,[v.createElementVNode("div",Fo,v.toDisplayString(e.title??"Your expert"),1),v.createElementVNode("div",Oo,v.toDisplayString(e.description??"A question about this product?"),1)]))}}),tt=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},Do=tt(Ro,[["__scopeId","data-v-28e6dda7"]]),Mo={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ao={"clip-path":"url(#clip0_466_934)"},No=["stroke"],Lo=["stroke"],Bo=v.defineComponent({__name:"AiStarsIcon",props:{color:{}},setup(r){const e=r;return(t,i)=>(v.openBlock(),v.createElementBlock("svg",Mo,[v.createElementVNode("g",Ao,[v.createElementVNode("path",{d:`M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
|
|
4
|
+
`)).length,s=0;s<i;s++){var a=r.charCodeAt(s),o=null;a<128?t++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),_e(o)||(t>e&&(n+=r.substring(e,t)),n+=o,e=t=s+1)}return t>e&&(n+=r.substring(e,r.length)),n},ro=!!ni||!!si,Ws="text/plain",Qt=function(r,e,t){var i;t===void 0&&(t=!0);var[s,n]=r.split("?"),a=E({},e),o=(i=n==null?void 0:n.split("&").map((c=>{var u,[d,f]=c.split("="),p=t&&(u=a[d])!==null&&u!==void 0?u:f;return delete a[d],d+"="+p})))!==null&&i!==void 0?i:[],l=la(a);return l&&o.push(l),s+"?"+o.join("&")},xt=(r,e)=>JSON.stringify(r,((t,i)=>typeof i=="bigint"?i.toString():i),e),Gi=r=>{var{data:e,compression:t}=r;if(e){if(t===me.GZipJS){var i=to((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new te(l.length+(l.length>>>1)),f=0,p=function(k){d[f++]=k},g=0;g<u;++g){if(f+5>d.length){var _=new te(f+8+(u-g<<1));_.set(d),d=_}var w=l.charCodeAt(g);w<128||c?p(w):w<2048?(p(192|w>>>6),p(128|63&w)):w>55295&&w<57344?(p(240|(w=65536+(1047552&w)|1023&l.charCodeAt(++g))>>>18),p(128|w>>>12&63),p(128|w>>>6&63),p(128|63&w)):(p(224|w>>>12),p(128|w>>>6&63),p(128|63&w))}return Vs(d,0,f)})(xt(e)),{mtime:0}),s=new Blob([i],{type:Ws});return{contentType:Ws,body:s,estimatedSize:s.size}}if(t===me.Base64){var n=(function(l){var c,u,d,f,p,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,w=0,k="",S=[];if(!l)return l;l=io(l);do c=(p=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=p>>12&63,d=p>>6&63,f=63&p,S[w++]=g.charAt(c)+g.charAt(u)+g.charAt(d)+g.charAt(f);while(_<l.length);switch(k=S.join(""),l.length%3){case 1:k=k.slice(0,-2)+"==";break;case 2:k=k.slice(0,-1)+"="}return k})(xt(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:xt(l)))(n);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=xt(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},ei=[];si&&ei.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:s,estimatedSize:n}=(e=Gi(r))!==null&&e!==void 0?e:{},a=new Headers;O(r.headers,(function(u,d){a.append(d,u)})),i&&a.append("Content-Type",i);var o=r.url,l=null;if(lr){var c=new lr;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),r.timeout)}}si(o,E({method:(r==null?void 0:r.method)||"GET",headers:a,keepalive:r.method==="POST"&&(n||0)<52428.8,body:s,signal:(t=l)==null?void 0:t.signal},r.fetchOptions)).then((u=>u.text().then((d=>{var f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(p){b.error(p)}r.callback==null||r.callback(f)})))).catch((u=>{b.error(u),r.callback==null||r.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),ni&&ei.push({transport:"XHR",method:r=>{var e,t=new ni;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:s}=(e=Gi(r))!==null&&e!==void 0?e:{};O(r.headers,(function(n,a){t.setRequestHeader(a,n)})),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.timeout),r.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}r.callback==null||r.callback(n)}},t.send(s)}}),X!=null&&X.sendBeacon&&ei.push({transport:"sendBeacon",method:r=>{var e=Qt(r.url,{beacon:"1"});try{var t,{contentType:i,body:s}=(t=Gi(r))!==null&&t!==void 0?t:{},n=typeof s=="string"?new Blob([s],{type:i}):s;X.sendBeacon(e,n)}catch{}}});var Ze=function(r,e){if(!(function(t){try{new RegExp(t)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(r)}catch{return!1}};function zs(r,e,t){return xt({distinct_id:r,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Ys={exact:(r,e)=>e.some((t=>r.some((i=>t===i)))),is_not:(r,e)=>e.every((t=>r.every((i=>t!==i)))),regex:(r,e)=>e.some((t=>r.some((i=>Ze(t,i))))),not_regex:(r,e)=>e.every((t=>r.every((i=>!Ze(t,i))))),icontains:(r,e)=>e.map(ti).some((t=>r.map(ti).some((i=>t.includes(i))))),not_icontains:(r,e)=>e.map(ti).every((t=>r.map(ti).every((i=>!t.includes(i)))))},ti=r=>r.toLowerCase(),Wi=U("[Error tracking]");class so{constructor(e){var t,i;this.Jt=[],this.Kt=new Mn([new Nn,new Wn,new Bn,new Ln,new Hn,new Vn,new qn,new Gn],[Fn,An]),this._instance=e,this.Jt=(t=(i=this._instance.persistence)==null?void 0:i.get_property(fi))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,i,s,n=(t=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],a=(s=e.errorTracking)==null?void 0:s.captureExtensionExceptions;this.Jt=n,this._instance.persistence&&this._instance.persistence.register({[fi]:this.Jt,[Ir]:a})}get Yt(){var e,t=!!this._instance.get_property(Ir),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Kt.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Xt(t)){if(this.Qt(t))return void Wi.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(t))return void Wi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(t))return void Wi.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var t=e.reduce(((i,s)=>{var{type:n,value:a}=s;return B(n)&&n.length>0&&i.$exception_types.push(n),B(a)&&a.length>0&&i.$exception_values.push(a),i}),{$exception_types:[],$exception_values:[]});return this.Jt.some((i=>{var s=i.values.map((n=>{var a,o=Ys[n.operator],l=F(n.value)?n.value:[n.value],c=(a=t[n.key])!==null&&a!==void 0?a:[];return l.length>0&&o(l,c)}));return i.type==="OR"?s.some(Boolean):s.every(Boolean)}))}Zt(e){return e.flatMap((t=>{var i,s;return(i=(s=t.stacktrace)==null?void 0:s.frames)!==null&&i!==void 0?i:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var t,i,s,n,a=(t=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&t!==void 0?t:[],o=a[a.length-1];return(s=o==null||(n=o.filename)==null?void 0:n.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Xt(e){return!R(e)&&F(e)}}var se=U("[FeatureFlags]"),zi="$active_feature_flags",Qe="$override_feature_flags",Ks="$feature_flag_payloads",St="$override_feature_flag_payloads",Xs="$feature_flag_request_id",Js=r=>{var e={};for(var[t,i]of Dt(r||{}))i&&(e[t]=i);return e},no=r=>{var e=r.flags;return e?(r.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,(i=e[t].variant)!==null&&i!==void 0?i:e[t].enabled]}))),r.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return(i=e[t].metadata)==null?void 0:i.payload})).map((t=>{var i;return[t,(i=e[t].metadata)==null?void 0:i.payload]})))):se.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),r},ao=(function(r){return r.FeatureFlags="feature_flags",r.Recordings="recordings",r})({});class oo{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((t=>{var i=t&&typeof t=="string"&&t.trim().length>0;return i||se.error("Invalid evaluation environment found:",t,"Expected non-empty string"),i})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(_i),t=this._instance.get_property(Qe),i=this._instance.get_property(St);if(!i&&!t)return e||{};var s=M({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var a of n){var o,l,c=s[a],u=t==null?void 0:t[a],d=m(u)?(o=c==null?void 0:c.enabled)!==null&&o!==void 0&&o:!!u,f=m(u)?c.variant:typeof u=="string"?u:void 0,p=i==null?void 0:i[a],g=E({},c,{enabled:d,variant:d?f??(c==null?void 0:c.variant):void 0});d!==(c==null?void 0:c.enabled)&&(g.original_enabled=c==null?void 0:c.enabled),f!==(c==null?void 0:c.variant)&&(g.original_variant=c==null?void 0:c.variant),p&&(g.metadata=E({},c==null?void 0:c.metadata,{payload:p,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),s[a]=g}return this.ii||(se.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ii=!0),s}getFlagVariants(){var e=this._instance.get_property(We),t=this._instance.get_property(Qe);if(!t)return e||{};for(var i=M({},e),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(se.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(Ks),t=this._instance.get_property(St);if(!t)return e||{};for(var i=M({},e||{}),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(se.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.di()}),5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}di(e){var t;if(this.vi(),!this._instance.M())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:E({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(lt)||{}),group_properties:this._instance.get_property(De)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var s=this._instance.config.__preview_remote_config,n=s?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags",n+a);s&&(i.timezone=As()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:me.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),d=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ni)if(this.ai=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(ao.FeatureFlags))se.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.");else{var f;i.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},d),this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,n=this._instance.get_property(Xs)||void 0,a=this._instance.get_property(Lt)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(s))){var o,l,c,u,d,f,p,g,_;F(a[e])?a[e].push(s):a[e]=[s],(o=this._instance.persistence)==null||o.register({[Lt]:a});var w=this.getFeatureFlagDetails(e),k={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ai};m(w==null||(u=w.metadata)==null?void 0:u.version)||(k.$feature_flag_version=w.metadata.version);var S,$=(d=w==null||(f=w.reason)==null?void 0:f.description)!==null&&d!==void 0?d:w==null||(p=w.reason)==null?void 0:p.code;$&&(k.$feature_flag_reason=$),w!=null&&(g=w.metadata)!=null&&g.id&&(k.$feature_flag_id=w.metadata.id),m(w==null?void 0:w.original_variant)&&m(w==null?void 0:w.original_enabled)||(k.$feature_flag_original_response=m(w.original_variant)?w.original_enabled:w.original_variant),w!=null&&(_=w.metadata)!=null&&_.original_payload&&(k.$feature_flag_original_payload=w==null||(S=w.metadata)==null?void 0:S.original_payload),this._instance.capture("$feature_flag_called",k)}return i}se.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(s.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:s,compression:this._instance.config.disable_compression?void 0:me.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:n=>{var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;t((o==null?void 0:o[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return m(i)?void 0:!!i}se.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.ei=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=no(a),f=d.flags,p=d.featureFlags,g=d.featureFlagPayloads;if(p){var _=a.requestId;if(F(p)){se.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var w={};if(p)for(var k=0;k<p.length;k++)w[p[k]]=!0;o&&o.register({[zi]:p,[We]:w})}else{var S=p,$=g,P=f;a.errorsWhileComputingFlags&&(S=E({},l,S),$=E({},c,$),P=E({},u,P)),o&&o.register(E({[zi]:Object.keys(Js(S)),[We]:S||{},[Ks]:$||{},[_i]:P||{}},_?{[Xs]:_}:{}))}}})(e,this._instance.persistence,i,s,n),this.pi(t)}}override(e,t){t===void 0&&(t=!1),se.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return se.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Qe),this._instance.persistence.unregister(St),void this.pi();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,i=e;if(this.ii=!!((t=i.suppressWarning)!==null&&t!==void 0&&t),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Qe);else if(i.flags)if(F(i.flags)){for(var s={},n=0;n<i.flags.length;n++)s[i.flags[n]]=!0;this._instance.persistence.register({[Qe]:s})}else this._instance.persistence.register({[Qe]:i.flags})}return"payloads"in i&&(i.payloads===!1?this._instance.persistence.unregister(St):i.payloads&&this._instance.persistence.register({[St]:i.payloads})),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:t,flagVariants:i}=this.gi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,n=(this._instance.get_property(ot)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=E({},this.getFlagVariants(),{[e]:t});(s=this._instance.persistence)==null||s.register({[zi]:Object.keys(Js(l)),[We]:l}),this.pi()}getEarlyAccessFeatures(e,t,i){t===void 0&&(t=!1);var s=this._instance.get_property(ot),n=i?"&"+i.map((a=>"stage="+a)).join("&"):"";if(s&&!t)return e(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:a=>{var o,l;if(a.json){var c=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(ot),(l=this._instance.persistence)==null||l.register({[ot]:c}),e(c)}}})}gi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((i=>t[i])),flagVariants:Object.keys(t).filter((i=>t[i])).reduce(((i,s)=>(i[s]=t[s],i)),{})}}pi(e){var{flags:t,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach((s=>s(t,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(lt)||{};this._instance.register({[lt]:E({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(lt)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(De)||{};Object.keys(i).length!==0&&Object.keys(i).forEach((s=>{i[s]=E({},i[s],e[s]),delete e[s]})),this._instance.register({[De]:E({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(De)||{};this._instance.register({[De]:E({},t,{[e]:{}})})}else this._instance.unregister(De)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var lo=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Yi{constructor(e,t){this.C=e,this.props={},this.mi=!1,this.yi=(i=>{var s="";return i.token&&(s=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+s+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&b.info("Persistence loaded",e.persistence,E({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wi}bi(e){lo.indexOf(e.persistence.toLowerCase())===-1&&(b.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&D.H()?D:t==="localstorage+cookie"&&zt.H()?zt:t==="sessionstorage"&&j.H()?j:t==="memory"?ya:t==="cookie"?ce:zt.H()?zt:ce}properties(){var e={};return O(this.props,(function(t,i){if(i===We&&q(t))for(var s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else o=i,l=!1,(_e(a=Zn)?l:or&&a.indexOf===or?a.indexOf(o)!=-1:(O(a,(function(c){if(l||(l=c===o))return At})),l))||(e[i]=t);var a,o,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=M({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.$i,this.Si,this.C.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(q(e)){m(t)&&(t="None"),this.xi=m(i)?this.Ei:i;var s=!1;if(O(e,((n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=n,s=!0)})),s)return this.save(),!0}return!1}register(e,t){if(q(e)){this.xi=m(t)?this.Ei:t;var i=!1;if(O(e,((s,n)=>{e.hasOwnProperty(n)&&this.props[n]!==s&&(this.props[n]=s,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.mi){var e=Ps(this.C.custom_campaign_params,this.C.mask_personal_data_properties,this.C.custom_personal_data_properties);Ve(hi(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=y==null?void 0:y.referrer)?$s(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Fs(),$referring_domain:y!=null&&y.referrer&&((e=Vt(y.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[bi]||this.props[wi]||this.register_once({[Bt]:Os(this.C.mask_personal_data_properties,this.C.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};O([wi,bi],(a=>{var o=this.props[a];o&&O(o,(function(l,c){e["$initial_"+ai(c)]=l}))}));var t,i,s=this.props[Bt];if(s){var n=(t=Rs(s),i={},O(t,(function(a,o){i["$initial_"+ai(o)]=a})),i);M(e,n)}return e}safe_merge(e){return O(this.props,(function(t,i){i in e||(e[i]=t)})),e}update_config(e,t,i){if(this.Ei=this.xi=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){var s=this.bi(e),n=this.props;this.clear(),this.Y=s,this.props=n,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.$i&&(this.$i=e,this.remove(),this.save())}set_secure(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[at]||{};i[e]=t,this.props[at]=i,this.save()}remove_event_timer(e){var t=(this.props[at]||{})[e];return m(t)||(delete this.props[at][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}(function(r){return r.Button="button",r.Tab="tab",r.Selector="selector",r})({}),(function(r){return r.TopLeft="top_left",r.TopRight="top_right",r.TopCenter="top_center",r.MiddleLeft="middle_left",r.MiddleRight="middle_right",r.MiddleCenter="middle_center",r.Left="left",r.Center="center",r.Right="right",r.NextToTrigger="next_to_trigger",r})({});var Ki=(function(r){return r.Popover="popover",r.API="api",r.Widget="widget",r.ExternalSurvey="external_survey",r})({});(function(r){return r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link",r})({}),(function(r){return r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question",r})({}),(function(r){return r.Once="once",r.Recurring="recurring",r.Always="always",r})({});var ii=(function(r){return r.SHOWN="survey shown",r.DISMISSED="survey dismissed",r.SENT="survey sent",r})({}),Zs=(function(r){return r.SURVEY_ID="$survey_id",r.SURVEY_NAME="$survey_name",r.SURVEY_RESPONSE="$survey_response",r.SURVEY_ITERATION="$survey_iteration",r.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",r.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",r.SURVEY_SUBMISSION_ID="$survey_submission_id",r.SURVEY_QUESTIONS="$survey_questions",r.SURVEY_COMPLETED="$survey_completed",r})({}),Qs=(function(r){return r.Popover="popover",r.Inline="inline",r})({});class Xi{constructor(){this.ki={},this.ki={}}on(e,t){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(t),()=>{this.ki[e]=this.ki[e].filter((i=>i!==t))}}emit(e,t){for(var i of this.ki[e]||[])i(t);for(var s of this.ki["*"]||[])s(e,t)}}class Ue{constructor(e){this.Pi=new Xi,this.Ti=(t,i)=>this.Ii(t,i)&&this.Ri(t,i)&&this.Ci(t,i),this.Ii=(t,i)=>i==null||!i.event||(t==null?void 0:t.event)===(i==null?void 0:i.event),this._instance=e,this.Oi=new Set,this.Fi=new Set}init(){var e;if(!m((e=this._instance)==null?void 0:e.Mi)){var t;(t=this._instance)==null||t.Mi(((i,s)=>{this.on(i,s)}))}}register(e){var t,i;if(!m((t=this._instance)==null?void 0:t.Mi)&&(e.forEach((a=>{var o,l;(o=this.Fi)==null||o.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Oi)==null||u.add((c==null?void 0:c.event)||"")}))})),(i=this._instance)!=null&&i.autocapture)){var s,n=new Set;e.forEach((a=>{var o;(o=a.steps)==null||o.forEach((l=>{l!=null&&l.selector&&n.add(l==null?void 0:l.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(n)}}on(e,t){var i;t!=null&&e.length!=0&&(this.Oi.has(e)||this.Oi.has(t==null?void 0:t.event))&&this.Fi&&((i=this.Fi)==null?void 0:i.size)>0&&this.Fi.forEach((s=>{this.Ai(t,s)&&this.Pi.emit("actionCaptured",s.name)}))}Di(e){this.onAction("actionCaptured",(t=>e(t)))}Ai(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var i of t.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,t){return this.Pi.on(e,t)}Ri(e,t){if(t!=null&&t.url){var i,s=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!s||typeof s!="string"||!Ue.ji(s,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static ji(e,t,i){switch(i){case"regex":return!!h&&Ze(e,t);case"exact":return t===e;case"contains":var s=Ue.Li(t).replace(/_/g,".").replace(/%/g,".*");return Ze(e,s);default:return!1}}static Li(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ci(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Ni(e).some((n=>!(t!=null&&t.href&&!Ue.ji(n.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||n.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!Ue.ji(n.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!Ue.ji(n.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")))))return!1;if(t!=null&&t.selector){var i,s=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(!s||!s.includes(t==null?void 0:t.selector))return!1}return!0}Ni(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var T=U("[Surveys]"),Ji="seenSurvey_",co=(r,e)=>{var t="$survey_"+e+"/"+r.id;return r.current_iteration&&r.current_iteration>0&&(t="$survey_"+e+"/"+r.id+"/"+r.current_iteration),t},en=r=>{var e=""+Ji+r.id;return r.current_iteration&&r.current_iteration>0&&(e=""+Ji+r.id+"_"+r.current_iteration),e},uo=[Ki.Popover,Ki.Widget,Ki.API],ho={ignoreConditions:!1,ignoreDelay:!1,displayType:Qs.Popover};class po{constructor(e){this._instance=e,this.Ui=new Map,this.zi=new Map}register(e){var t;m((t=this._instance)==null?void 0:t.Mi)||(this.Hi(e),this.Bi(e))}Bi(e){var t=e.filter((i=>{var s,n;return((s=i.conditions)==null?void 0:s.actions)&&((n=i.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0}));t.length!==0&&(this.qi==null&&(this.qi=new Ue(this._instance),this.qi.init(),this.qi.Di((i=>{this.onAction(i)}))),t.forEach((i=>{var s,n,a,o,l;i.conditions&&(s=i.conditions)!=null&&s.actions&&(n=i.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.qi)==null||o.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.zi.get(c.name);u&&u.push(i.id),this.zi.set(c.name,u||[i.id])}})))})))}Hi(e){var t;e.filter((i=>{var s,n;return((s=i.conditions)==null?void 0:s.events)&&((n=i.conditions)==null||(n=n.events)==null||(n=n.values)==null?void 0:n.length)>0})).length!==0&&((t=this._instance)==null||t.Mi(((i,s)=>{this.onEvent(i,s)})),e.forEach((i=>{var s;(s=i.conditions)==null||(s=s.events)==null||(s=s.values)==null||s.forEach((n=>{if(n&&n.name){var a=this.Ui.get(n.name);a&&a.push(i.id),this.Ui.set(n.name,a||[i.id])}}))})))}onEvent(e,t){var i,s,n=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[Nt])||[];if(ii.SHOWN===e&&t&&n.length>0){var a;T.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:n});var o=t==null||(a=t.properties)==null?void 0:a.$survey_id;if(o){var l=n.indexOf(o);l>=0&&(n.splice(l,1),this.Wi(n))}}else if(this.Ui.has(e)){T.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Ui.get(e)});var c=[];(s=this._instance)==null||s.getSurveys((d=>{c=d.filter((f=>{var p;return(p=this.Ui.get(e))==null?void 0:p.includes(f.id)}))}));var u=c.filter((d=>{var f,p=(f=d.conditions)==null||(f=f.events)==null||(f=f.values)==null?void 0:f.find((g=>g.name===e));return!!p&&(!p.propertyFilters||Object.entries(p.propertyFilters).every((g=>{var _,[w,k]=g,S=t==null||(_=t.properties)==null?void 0:_[w];if(m(S)||_e(S))return!1;var $=[String(S)],P=Ys[k.operator];return P?P(k.values,$):(T.warn("Unknown property comparison operator: "+k.operator),!1)})))}));this.Wi(n.concat(u.map((d=>d.id))||[]))}}onAction(e){var t,i=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[Nt])||[];this.zi.has(e)&&this.Wi(i.concat(this.zi.get(e)||[]))}Wi(e){var t;T.info("updating activated surveys",{activatedSurveys:e}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[Nt]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Nt];return t||[]}getEventToSurveys(){return this.Ui}Gi(){return this.qi}}class fo{constructor(e){this.Vi=void 0,this._surveyManager=null,this.Ji=!1,this.Ki=!1,this.Yi=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(R(t))return T.warn("Flags not loaded yet. Not loading surveys.");var i=F(t);this.Vi=i?t.length>0:t,T.info("flags response received, isSurveysEnabled: "+this.Vi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(i!=null&&i.startsWith(Ji)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((s=>localStorage.removeItem(s)))}loadIfEnabled(){if(!this._surveyManager)if(this.Ki)T.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)T.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())T.info("Not loading surveys in cookieless mode without consent.");else{var e=x==null?void 0:x.__PosthogExtensions__;if(e){if(!m(this.Vi)||this._instance.config.advanced_enable_surveys){var t=this.Vi||this._instance.config.advanced_enable_surveys;this.Ki=!0;try{var i=e.generateSurveys;if(i)return void this.Xi(i,t);var s=e.loadExternalDependency;if(!s)return void this.Qi("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",(n=>{n||!e.generateSurveys?this.Qi("Could not load surveys script",n):this.Xi(e.generateSurveys,t)}))}catch(n){throw this.Qi("Error initializing surveys",n),n}finally{this.Ki=!1}}}else T.error("PostHog Extensions not found.")}}Xi(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new po(this._instance),T.info("Surveys loaded successfully"),this.Zi({isLoaded:!0})}Qi(e,t){T.error(e,t),this.Zi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yi.push(e),this._surveyManager&&this.Zi({isLoaded:!0}),()=>{this.Yi=this.Yi.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return T.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(vi);if(i&&!t)return e(i,{isLoaded:!0});if(this.Ji)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ji=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var n;this.Ji=!1;var a=s.statusCode;if(a!==200||!s.json){var o="Surveys API could not be loaded, status: "+a;return T.error(o),e([],{isLoaded:!1,error:o})}var l,c=s.json.surveys||[],u=c.filter((d=>(function(f){return!(!f.start_date||f.end_date)})(d)&&((function(f){var p;return!((p=f.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)})(d)||(function(f){var p;return!((p=f.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)})(d))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(n=this._instance.persistence)==null||n.register({[vi]:c}),e(c,{isLoaded:!0})}})}catch(s){throw this.Ji=!1,s}}Zi(e){for(var t of this.Yi)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){T.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!R(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);T.warn("init was not called")}te(e){var t=null;return this.getSurveys((i=>{var s;t=(s=i.find((n=>n.id===e)))!==null&&s!==void 0?s:null})),t}ie(e){if(R(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.te(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(R(this._surveyManager))return T.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ie(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return R(this._surveyManager)?(T.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((s=>{var n,a=(n=s.find((l=>l.id===e)))!==null&&n!==void 0?n:null;if(a){var o=this.ie(a);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){var i;if(R(this._surveyManager))T.warn("init was not called");else{var s=typeof e=="string"?this.te(e):e;if(s!=null&&s.id)if(uo.includes(s.type)){var n=y==null?void 0:y.querySelector(t);if(n)return(i=s.appearance)!=null&&i.surveyPopupDelaySeconds?(T.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,o;T.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(s,n),T.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n);T.warn("Survey element not found")}else T.warn("Surveys of type "+s.type+" cannot be rendered in the app");else T.warn("Survey not found")}}displaySurvey(e,t){var i;if(R(this._surveyManager))T.warn("init was not called");else{var s=this.te(e);if(s){var n=s;if((i=s.appearance)!=null&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=E({},s,{appearance:E({},s.appearance,{surveyPopupDelaySeconds:0})})),t.ignoreConditions===!1){var a=this.canRenderSurvey(s);if(!a.visible)return void T.warn("Survey is not eligible to be displayed: ",a.disabledReason)}t.displayType!==Qs.Inline?this._surveyManager.handlePopoverSurvey(n):this.renderSurvey(n,t.selector)}else T.warn("Survey not found")}}}var tn=U("[RateLimiter]");class go{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=s=>{var n=s.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((a=>{tn.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void tn.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:n})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,s;e===void 0&&(e=!1);var n=new Date().getTime(),a=(t=(i=this.instance.persistence)==null?void 0:i.get_property(yi))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:n};a.tokens+=(n-a.last)/1e3*this.captureEventsPerSecond,a.last=n,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(s=this.instance.persistence)==null||s.set_property(yi,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var qe=U("[RemoteConfig]");class _o{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}ee(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.loadExternalDependency?(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(qe.error("PostHog Extensions not found. Cannot load remote config."),e())}re(e){this._instance.ci({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 qe.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.M())return void qe.warn("Remote config is disabled. Falling back to local config.");this.ee((e=>{if(!e)return qe.info("No config found after loading remote JS config. Falling back to JSON."),void this.re((t=>{this.fi(t)}));this.fi(e)}))}catch(e){qe.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):qe.info("__preview_remote_config is disabled. Logging config instead",e):qe.error("Failed to fetch remote config from PostHog.")}}var Zi=3e3;class vo{constructor(e,t){this.se=!0,this.ne=[],this.oe=le((t==null?void 0:t.flush_interval_ms)||Zi,250,5e3,b.createLogger("flush interval"),Zi),this.ae=e}enqueue(e){this.ne.push(e),this.le||this.ue()}unload(){this.he();var e=this.ne.length>0?this.de():{},t=Object.values(e);[...t.filter((i=>i.url.indexOf("/e")===0)),...t.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.ae(E({},i,{transport:"sendBeacon"}))}))}enable(){this.se=!1,this.ue()}ue(){var e=this;this.se||(this.le=setTimeout((()=>{if(this.he(),this.ne.length>0){var t=this.de(),i=function(){var n=t[s],a=new Date().getTime();n.data&&F(n.data)&&O(n.data,(o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp})),e.ae(n)};for(var s in t)i()}}),this.oe))}he(){clearTimeout(this.le),this.le=void 0}de(){var e={};return O(this.ne,(t=>{var i,s=t,n=(s?s.batchKey:null)||s.url;m(e[n])&&(e[n]=E({},s,{data:[]})),(i=e[n].data)==null||i.push(s.data)})),this.ne=[],e}}var mo=["retriesPerformedSoFar"];class yo{constructor(e){this.ve=!1,this.ce=3e3,this.ne=[],this._instance=e,this.ne=[],this.fe=!0,!m(h)&&"onLine"in h.navigator&&(this.fe=h.navigator.onLine,this.pe=()=>{this.fe=!0,this.Dt()},this.ge=()=>{this.fe=!1},L(h,"online",this.pe),L(h,"offline",this.ge))}get length(){return this.ne.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=dr(e,mo);oe(t)&&t>0&&(i.url=Qt(i.url,{retry_count:t})),this._instance.ci(E({},i,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(t??0)<10?this._e(E({retriesPerformedSoFar:t},i)):i.callback==null||i.callback(s)}}))}_e(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=(function(a){var o=3e3*Math.pow(2,a),l=o/2,c=Math.min(18e5,o),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(t),s=Date.now()+i;this.ne.push({retryAt:s,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),b.warn(n),this.ve||(this.ve=!0,this.me())}me(){if(this.ye&&clearTimeout(this.ye),this.ne.length===0)return this.ve=!1,void(this.ye=void 0);this.ye=setTimeout((()=>{this.fe&&this.ne.length>0&&this.Dt(),this.me()}),this.ce)}Dt(){var e=Date.now(),t=[],i=this.ne.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.ne=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ve=!1,m(h)||(this.pe&&(h.removeEventListener("online",this.pe),this.pe=void 0),this.ge&&(h.removeEventListener("offline",this.ge),this.ge=void 0)),this.ne))try{this._instance.ci(E({},e,{transport:"sendBeacon"}))}catch(t){b.error(t)}this.ne=[]}}class bo{constructor(e){this.be=()=>{var t,i,s,n;this.we||(this.we={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=o+((a==null?void 0:a.clientHeight)||0),u=(a==null?void 0:a.scrollHeight)||0;this.we.lastScrollY=Math.ceil(o),this.we.maxScrollY=Math.max(o,(t=this.we.maxScrollY)!==null&&t!==void 0?t:0),this.we.maxScrollHeight=Math.max(l,(i=this.we.maxScrollHeight)!==null&&i!==void 0?i:0),this.we.lastContentY=c,this.we.maxContentY=Math.max(c,(s=this.we.maxContentY)!==null&&s!==void 0?s:0),this.we.maxContentHeight=Math.max(u,(n=this.we.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}getContext(){return this.we}resetContext(){var e=this.we;return setTimeout(this.be,0),e}startMeasuringScrollPosition(){L(h,"scroll",this.be,{capture:!0}),L(h,"scrollend",this.be,{capture:!0}),L(h,"resize",this.be)}scrollElement(){if(!this._instance.config.scroll_root_selector)return h==null?void 0:h.document.documentElement;var e=F(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=h==null?void 0:h.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return h&&(h.scrollY||h.pageYOffset||h.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return h&&(h.scrollX||h.pageXOffset||h.document.documentElement.scrollLeft)||0}}var wo=r=>Os(r==null?void 0:r.config.mask_personal_data_properties,r==null?void 0:r.config.custom_personal_data_properties);class rn{constructor(e,t,i,s){this.xe=n=>{var a=this.$e();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Se(this._instance)};this.Ee.register({[mi]:o})}},this._instance=e,this.ke=t,this.Ee=i,this.Se=s||wo,this.ke.onSessionId(this.xe)}$e(){return this.Ee.props[mi]}getSetOnceProps(){var e,t=(e=this.$e())==null?void 0:e.props;return t?"r"in t?Rs(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 O(hi(this.getSetOnceProps()),((t,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+ai(i)]=t})),e}}var Qi=U("[SessionId]");class sn{on(e,t){return this.Pe.on(e,t)}constructor(e,t,i){var s;if(this.Te=[],this.Ie=void 0,this.Pe=new Xi,this.Re=(u,d)=>Math.abs(u-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.C=e.config,this.Ee=e.persistence,this.Ce=void 0,this.Oe=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fe=t||Pe,this.Me=i||Pe;var n=this.C.persistence_name||this.C.token,a=this.C.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*le(a,60,36e3,Qi.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ae(),this.De="ph_"+n+"_window_id",this.je="ph_"+n+"_primary_window_exists",this.Le()){var o=j.W(this.De),l=j.W(this.je);o&&!l?this.Ce=o:j.V(this.De),j.G(this.je,!0)}if((s=this.C.bootstrap)!=null&&s.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.C.bootstrap.sessionID);this.Ne(this.C.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Qi.error("Invalid sessionID in bootstrap",u)}this.Ue()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return m(this.Te)&&(this.Te=[]),this.Te.push(e),this.Oe&&e(this.Oe,this.Ce),()=>{this.Te=this.Te.filter((t=>t!==e))}}Le(){return this.C.persistence!=="memory"&&!this.Ee.wi&&j.H()}ze(e){e!==this.Ce&&(this.Ce=e,this.Le()&&j.G(this.De,e))}He(){return this.Ce?this.Ce:this.Le()?j.W(this.De):null}Ne(e,t,i){e===this.Oe&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Oe=e,this.Ee.register({[Mt]:[t,e,i]}))}Be(){if(this.Oe&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Oe,this._sessionStartTimestamp];var e=this.Ee.props[Mt];return F(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ne(null,null,null)}destroy(){clearTimeout(this.qe),this.qe=void 0,this.Ie&&h&&(h.removeEventListener("beforeunload",this.Ie,{capture:!1}),this.Ie=void 0),this.Te=[]}Ue(){this.Ie=()=>{this.Le()&&j.V(this.je)},L(h,"beforeunload",this.Ie,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.C.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||new Date().getTime(),[s,n,a]=this.Be(),o=this.He(),l=oe(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!n,d=!u&&!e&&this.Re(i,s);u||d||l?(n=this.Fe(),o=this.Me(),Qi.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=i,c=!0):o||(o=this.Me(),c=!0);var f=s===0||!e||l?i:s,p=a===0?new Date().getTime():a;return this.ze(o),this.Ne(n,f,p),e||this.Ae(),c&&this.Te.forEach((g=>g(n,o,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Ae(){clearTimeout(this.qe),this.qe=setTimeout((()=>{var[e]=this.Be();if(this.Re(new Date().getTime(),e)){var t=this.Oe;this.resetSessionId(),this.Pe.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var Eo=["$set_once","$set"],Te=U("[SiteApps]");class ko{constructor(e){this._instance=e,this.We=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ge(e,t){if(t){var i=this.globalsForEvent(t);this.We.push(i),this.We.length>1e3&&(this.We=this.We.slice(10))}}get siteAppLoaders(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Mi(this.Ge.bind(this));this.Ve=()=>{e(),this.We=[],this.Ve=void 0}}}globalsForEvent(e){var t,i,s,n,a,o,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,p]of Object.entries(d))c[f]={id:u[f],type:f,properties:p};var{$set_once:g,$set:_}=e;return{event:E({},dr(e,Eo),{properties:E({},e.properties,_?{$set:E({},(t=(i=e.properties)==null?void 0:i.$set)!==null&&t!==void 0?t:{},_)}:{},g?{$set_once:E({},(s=(n=e.properties)==null?void 0:n.$set_once)!==null&&s!==void 0?s:{},g)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var o;!t.errored&&this.We.length&&(Te.info("Processing "+this.We.length+" events for site app with id "+e.id),this.We.forEach((l=>t.processEvent==null?void 0:t.processEvent(l))),t.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((o=this.Ve)==null||o.call(this))},s=!1,n=o=>{t.errored=!o,t.loaded=!0,Te.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),s&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{n(o)}});a&&(t.processEvent=a),s=!0}catch(o){Te.error("Error while initializing PostHog app with config id "+e.id,o),n(!1)}if(s&&t.loaded)try{i()}catch(o){Te.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Je(){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)}Ke(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(t)}catch(s){Te.error("Error while processing event "+e.event+" for site app "+i.id,s)}}}onRemoteConfig(e){var t,i,s,n=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Je(),void this._instance.on("eventCaptured",(c=>this.Ke(c)))):void Te.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ve)==null||i.call(this),(s=e.siteApps)!=null&&s.length)if(this.isEnabled){var a=function(c){var u;x["__$$ph_site_app_"+c]=n._instance,(u=x.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(n._instance,l,(d=>{if(d)return Te.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:o,url:l}of e.siteApps)a(o)}else Te.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var nn=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&hr(t,e))return!0;try{var i=r==null?void 0:r.userAgentData;if(i!=null&&i.brands&&i.brands.some((s=>hr(s==null?void 0:s.brand,e))))return!0}catch{}return!!r.webdriver},Ct=(function(r){return r.US="us",r.EU="eu",r.CUSTOM="custom",r})({}),an="i.posthog.com";class xo{constructor(e){this.Ye={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"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=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+an,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Ye[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=Ct.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=Ct.EU:this.Ye[this.apiHost]=Ct.CUSTOM),this.Ye[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(this.region===Ct.CUSTOM)return this.apiHost+t;var i=an+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var So={icontains:(r,e)=>!!h&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!h&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!h&&Ze(e.href,r),not_regex:(r,e)=>!!h&&!Ze(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r};class V{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),t.getWebExperiments((s=>{V.Xe("retrieved web experiments from the server"),t.Qe=new Map,s.forEach((n=>{if(n.feature_flag_key){var a;t.Qe&&(V.Xe("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Qe)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);B(o)&&n.variants[o]&&t.Ze(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var c=n.variants[l];V.tr(c)&&t.Ze(n.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}onFeatureFlags(e){if(this._is_bot())V.Xe("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(R(this.Qe))return this.Qe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();V.Xe("applying feature flags",e),e.forEach((t=>{var i;if(this.Qe&&(i=this.Qe)!=null&&i.has(t)){var s,n=this._instance.getFeatureFlag(t),a=(s=this.Qe)==null?void 0:s.get(t);n&&a!=null&&a.variants[n]&&this.Ze(a.name,n,a.variants[n].transforms)}}))}}previewWebExperiment(){var e=V.getWindowLocation();if(e!=null&&e.search){var t=Ht(e==null?void 0:e.search,"__experiment_id"),i=Ht(e==null?void 0:e.search,"__experiment_variant");t&&i&&(V.Xe("previewing web experiments "+t+" && "+i),this.getWebExperiments((s=>{this.ir(parseInt(t),i,s)}),!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 s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>{if(n.statusCode!==200||!n.json)return e([]);var a=n.json.experiments||[];return e(a)}})}ir(e,t,i){var s=i.filter((n=>n.id===e));s&&s.length>0&&(V.Xe("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Ze(s[0].name,t,s[0].variants[t].transforms))}static tr(e){return!R(e.conditions)&&V.er(e)&&V.rr(e)}static er(e){var t;if(R(e.conditions)||R((t=e.conditions)==null?void 0:t.url))return!0;var i,s,n,a=V.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||So[(s=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,a))}static getWindowLocation(){return h==null?void 0:h.location}static rr(e){var t;if(R(e.conditions)||R((t=e.conditions)==null?void 0:t.utm))return!0;var i=Ps();if(i.utm_source){var s,n,a,o,l,c,u,d,f=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==i.utm_campaign,p=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,g=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==i.utm_term;return f&&g&&_&&p}return!1}static Xe(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];b.info("[WebExperiments] "+e,i)}Ze(e,t,i){this._is_bot()?V.Xe("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach((s=>{if(s.selector){var n;V.Xe("applying transform of variant "+t+" for experiment "+e+" ",s);var a=(n=document)==null?void 0:n.querySelectorAll(s.selector);a==null||a.forEach((o=>{var l=o;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)}))}})):V.Xe("Control variants leave the page unmodified.")}_is_bot(){return X&&this._instance?nn(X,this._instance.config.custom_blocked_useragents):void 0}}var Co=U("[PostHog ExternalIntegrations]"),Po={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Io{constructor(e){this._instance=e}it(e,t){var i;(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(s=>{if(s)return Co.error("failed to load script",s);t()}))}startIfEnabledOrStop(){var e=this,t=function(a){var o,l,c;!s||(o=x.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.it(Po[a],(()=>{var u;(u=x.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!s&&(l=x.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=x.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,s]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;t(i)}}}var er="[SessionRecording]",Pt=U(er);class on{get started(){var e;return!((e=this.sr)==null||!e.isStarted)}get status(){return this.sr?this.sr.status:this.nr&&!this.ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.nr=!1,this.lr=void 0,this._instance=e,!this._instance.sessionManager)throw Pt.error("started without valid sessionManager"),new Error(er+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(er+' cannot be used with cookieless_mode="always"')}get ar(){var e,t=!((e=this._instance.get_property(gi))==null||!e.enabled),i=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return h&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.ar||(t=this.sr)==null||!t.isStarted){var i=!m(Object.assign)&&!m(Array.from);this.ar&&i?(this.ur(e),Pt.info("starting")):this.stopRecording()}}ur(e){var t,i,s;this.ar&&(x!=null&&(t=x.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(i=x.__PosthogExtensions__)!=null&&i.initSessionRecording?this.hr(e):(s=x.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.dr,(n=>{if(n)return Pt.error("could not load recorder",n);this.hr(e)})))}stopRecording(){var e,t;(e=this.lr)==null||e.call(this),this.lr=void 0,(t=this.sr)==null||t.stop()}vr(){var e;(e=this._instance.persistence)==null||e.unregister(Or)}cr(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,n=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,o=a==null?void 0:a.sampleRate,l=R(o)?null:parseFloat(o);R(l)&&this.vr();var c=a==null?void 0:a.minimumDurationMilliseconds;s.register({[gi]:E({enabled:!!a},a,{networkPayloadCapture:E({capturePerformance:e.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:l,minimumDurationMilliseconds:m(c)?null:c,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers})})};n(),(t=this.lr)==null||t.call(this),this.lr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(n)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.cr(e),this.nr=!0,this.startIfEnabledOrStop()):this.nr=!0:Pt.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;t===void 0&&(t="log"),(i=this.sr)!=null&&i.log?this.sr.log(e,t):Pt.warn("log called before recorder was ready")}get dr(){var e,t,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(gi);return(i==null||(t=i.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}hr(e){var t,i;if((t=x.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.sr||(this.sr=(i=x.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.sr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.sr.start(e)}onRRwebEmit(e){var t;(t=this.sr)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.sr||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.sr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.sr||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.sr)==null||e.overrideSampling()}overrideTrigger(e){var t,i;this.sr||(i=this._instance.persistence)==null||i.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.sr)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.sr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!((i=this.sr)==null||!i.tryAddCustomEvent(e,t))}}var It={},tr=()=>{},et="posthog",ln=!ro&&(Y==null?void 0:Y.indexOf("MSIE"))===-1&&(Y==null?void 0:Y.indexOf("Mozilla"))===-1,cn=r=>{var e;return E({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Jn(y==null?void 0:y.location),persistence:"localStorage+cookie",persistence_name:"",loaded:tr,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:r??"unset",__preview_deferred_init_extensions:!1,debug:z&&B(z==null?void 0:z.search)&&z.search.indexOf("__posthog_debug=true")!==-1||!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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(h==null||(e=h.location)==null?void 0:e.protocol)==="https:",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:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;b.error(i)},get_device_id:t=>t,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:Zi},error_tracking:{},_onCapture:tr,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(r))},un=r=>{var e={};m(r.process_person)||(e.person_profiles=r.process_person),m(r.xhr_headers)||(e.request_headers=r.xhr_headers),m(r.cookie_name)||(e.persistence_name=r.cookie_name),m(r.disable_cookie)||(e.disable_persistence=r.disable_cookie),m(r.store_google)||(e.save_campaign_params=r.store_google),m(r.verbose)||(e.debug=r.verbose);var t=M({},e,r);return F(r.property_blacklist)&&(m(r.property_denylist)?t.property_denylist=r.property_blacklist:F(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:b.error("Invalid value for property_denylist config: "+r.property_denylist)),t};class $o{constructor(){this.__forceAllowLocalhost=!1}get pr(){return this.__forceAllowLocalhost}set pr(e){b.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ri{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new $o,this.gr=!1,this.version=ge.LIB_VERSION,this._r=new Xi,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=cn(),this.SentryIntegration=Ca,this.sentryIntegration=e=>(function(t,i){var s=ns(t,i);return{name:ss,processEvent:n=>s(n)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.mr=!1,this.yr=null,this.br=null,this.wr=null,this.featureFlags=new oo(this),this.toolbar=new Ia(this),this.scrollManager=new bo(this),this.pageViewManager=new Ya(this),this.surveys=new fo(this),this.experiments=new V(this),this.exceptions=new so(this),this.rateLimiter=new go(this),this.requestRouter=new xo(this),this.consent=new ba(this),this.externalIntegrations=new Io(this),this.people={set:(e,t,i)=>{var s=B(e)?{[e]:t}:e;this.setPersonProperties(s),i==null||i({})},set_once:(e,t,i)=>{var s=B(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),i==null||i({})}},this.on("eventCaptured",(e=>b.info('send "'+(e==null?void 0:e.event)+'"',e)))}init(e,t,i){if(i&&i!==et){var s,n=(s=It[i])!==null&&s!==void 0?s:new ri;return n._init(e,t,i),It[i]=n,It[et][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var s;if(t===void 0&&(t={}),m(e)||oi(e))return b.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={},t.debug=this.$r(t.debug),this.Sr=t,this.Er=[],t.person_profiles&&(this.br=t.person_profiles),this.set_config(M({},cn(t.defaults),un(t),{name:i,token:e})),this.config.on_xhr_error&&b.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:me.GZipJS;var n=this.kr();this.persistence=new Yi(this.config,n),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Yi(E({},this.config,{persistence:"sessionStorage"}),n);var a=E({},this.persistence.props),o=E({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Pr=new vo((S=>this.Tr(S)),this.config.request_queue_config),this.Ir=new yo(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new sn(this),this.sessionPropsManager=new rn(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(b.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Rr(l)}),0)):(b.info("Initializing extensions synchronously"),this.Rr(l)),ge.DEBUG=ge.DEBUG||this.config.debug,ge.DEBUG&&b.info("Starting in debug mode",{this:this,config:t,thisC:E({},this.config),p:a,s:o}),((s=t.bootstrap)==null?void 0:s.distinctID)!==void 0){var c,u,d=this.config.get_device_id(Pe()),f=(c=t.bootstrap)!=null&&c.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(ve,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:f})}if(this.Cr()){var p,g,_=Object.keys(((p=t.bootstrap)==null?void 0:p.featureFlags)||{}).filter((S=>{var $;return!(($=t.bootstrap)==null||($=$.featureFlags)==null||!$[S])})).reduce(((S,$)=>{var P;return S[$]=((P=t.bootstrap)==null||(P=P.featureFlags)==null?void 0:P[$])||!1,S}),{}),w=Object.keys(((g=t.bootstrap)==null?void 0:g.featureFlagPayloads)||{}).filter((S=>_[S])).reduce(((S,$)=>{var P,N;return(P=t.bootstrap)!=null&&(P=P.featureFlagPayloads)!=null&&P[$]&&(S[$]=(N=t.bootstrap)==null||(N=N.featureFlagPayloads)==null?void 0:N[$]),S}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:w})}if(l)this.register_once({distinct_id:ct,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(Pe());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(ve,"anonymous")}return L(h,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Sa(this,(()=>this.Or())):this.Or(),ke(this.config._onCapture)&&this.config._onCapture!==tr&&(b.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(S=>this.config._onCapture(S.event,S)))),this.config.ip&&b.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}Rr(e){var t=performance.now();this.historyAutocapture=new xa(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new Ta(this).startIfEnabledOrStop()})),i.push((()=>{var s;this.siteApps=new ko(this),(s=this.siteApps)==null||s.init()})),e||i.push((()=>{this.sessionRecording=new on(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new ha(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.heatmaps=new za(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new Ga(this)})),i.push((()=>{this.exceptionObserver=new ka(this),this.exceptionObserver.startIfEnabled()})),i.push((()=>{this.deadClicksAutocapture=new is(this,Ea),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Fr){var s=this.Fr;this.Fr=void 0,this.fi(s)}})),this.Mr(i,t)}Mr(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Mr(e,t)}),0);var i=e.shift();if(i)try{i()}catch(n){b.error("Error initializing extension:",n)}}var s=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:s}),this.config.__preview_deferred_init_extensions&&b.info("PostHog extensions initialized ("+s+"ms)")}fi(e){var t,i,s,n,a,o,l,c;if(!y||!y.body)return b.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Fr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=C(e.supportedCompression,me.GZipJS)?me.GZipJS:C(e.supportedCompression,me.Base64)?me.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.br?this.br:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(s=this.sessionRecording)==null||s.onRemoteConfig(e),(n=this.autocapture)==null||n.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Or(){try{this.config.loaded(this)}catch(e){b.critical("`loaded` function failed",e)}this.Ar(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Dr()}),1),new _o(this).load(),this.featureFlags.flags()}Ar(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Pr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Se(this.__request_queue,(e=>this.Tr(e))),this.__request_queue=[],this.Ar()}_handle_unload(){var e,t;this.config.request_batching?(this.jr()&&this.capture("$pageleave"),(e=this.Pr)==null||e.unload(),(t=this.Ir)==null||t.unload()):this.jr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(ln?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Qt(e.url,{ip:this.config.ip?1:0}),e.headers=E({},this.config.request_headers),e.compression=e.compression==="best-available"?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,(t=>{var i,s,n,a=E({},t);a.timeout=a.timeout||6e4,a.url=Qt(a.url,{_:new Date().getTime().toString(),ver:ge.LIB_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=ei.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(s=(n=xr(l,(u=>u.transport===o)))==null?void 0:n.method)!==null&&s!==void 0?s:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(E({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((i=(s=this.config).on_request_error)==null||i.call(s,t)),e.callback==null||e.callback(t)}}))))}Tr(e){this.Ir?this.Ir.retriableRequest(e):this.ci(e)}_execute_array(e){var t,i=[],s=[],n=[];Se(e,(o=>{o&&(t=o[0],F(t)?n.push(o):ke(o)?o.call(this):F(o)&&t==="alias"?i.push(o):F(o)&&t.indexOf("capture")!==-1&&ke(this[t])?n.push(o):s.push(o))}));var a=function(o,l){Se(o,(function(c){if(F(c[0])){var u=l;O(c,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};a(i,this),a(s,this),a(n,this)}Cr(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Pr){if(this.is_capturing())if(!m(e)&&B(e)){var n=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(n&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){t!=null&&t.$current_url&&!B(t==null?void 0:t.$current_url)&&(b.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),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,l=(i==null?void 0:i.timestamp)||o,c=Pe(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,t||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&n&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i!=null&&i.$set&&(u.$set=i==null?void 0:i.$set);var d,f=this.Lr(i==null?void 0:i.$set_once);if(f&&(u.$set_once=f),(u=Kn(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,m(i==null?void 0:i.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),e===ii.DISMISSED||e===ii.SENT){var p=t==null?void 0:t[Zs.SURVEY_ID],g=t==null?void 0:t[Zs.SURVEY_ITERATION];d={id:p,current_iteration:g},localStorage.getItem(en(d))||localStorage.setItem(en(d),"true"),u.$set=E({},u.$set,{[co({id:p,current_iteration:g},e===ii.SENT?"responded":"dismissed")]:!0})}var _=E({},u.properties.$set,u.$set);if(Ve(_)||this.setPersonPropertiesForFlags(_),!R(this.config.before_send)){var w=this.Nr(u);if(!w)return;u=w}this._r.emit("eventCaptured",u);var k={method:"POST",url:(s=i==null?void 0:i._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i==null?void 0:i._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Tr(k):this.Pr.enqueue(k),u}b.critical("This capture call is ignored due to client rate limiting.")}}else b.error("No event name provided to posthog.capture")}else b.uninitializedWarning("posthog.capture")}Mi(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=E({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=E({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!B(o.distinct_id)&&!oe(o.distinct_id)||oi(o.distinct_id))&&b.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=Ha(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());o.$session_id=d,o.$window_id=f}this.sessionPropsManager&&M(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&M(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.Ir)==null?void 0:p.length}catch(k){o.$sdk_debug_error_capturing_properties=String(k)}if(this.requestRouter.region===Ct.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=M(o,c),e==="$pageview"&&y&&(o.title=y.title),!m(a)){var g=i.getTime()-a;o.$duration=parseFloat((g/1e3).toFixed(3))}Y&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=M({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),F(this.config.property_denylist)?O(this.config.property_denylist,(function(k){delete o[k]})):b.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(b.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var w=this.Ur();return o.$process_person_profile=w,w&&!n&&this.zr("_calculate_event_properties"),o}Lr(e){var t;if(!this.persistence||!this.Ur()||this.gr)return e;var i=this.persistence.get_initial_props(),s=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),n=M({},i,s||{},e||{}),a=this.config.sanitize_properties;return a&&(b.error("sanitize_properties is deprecated. Use before_send instead"),n=a(n,"$set_once")),this.gr=!0,Ve(n)?void 0:n}register(e,t){var i;(i=this.persistence)==null||i.register(e,t)}register_once(e,t,i){var s;(s=this.persistence)==null||s.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Hr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._r.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){t===void 0&&(t=ho),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return b.uninitializedWarning("posthog.identify");if(oe(e)&&(e=e.toString(),b.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()))b.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!==ct){if(this.zr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==s&&e!==this.get_property(nt)&&(this.unregister(nt),this.register({distinct_id:e}));var a=(this.persistence.get_property(ve)||"anonymous")==="anonymous";e!==s&&a?(this.persistence.set_property(ve,"identified"),this.setPersonPropertiesForFlags(E({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.wr=zs(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(Lt))}}else b.critical('The string "'+ct+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else b.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.zr("posthog.setPersonProperties")){var i=zs(this.get_distinct_id(),e,t);this.wr!==i?(this.setPersonPropertiesForFlags(E({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.wr=i):b.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.zr("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:E({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else b.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.zr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,n;if(b.info("reset"),!this.__loaded)return b.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(s=this.persistence)==null||s.set_property(ve,"anonymous"),(n=this.sessionManager)==null||n.resetSessionId(),this.wr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:ct,$device_id:null},"");else{var o=this.config.get_device_id(Pe());this.register_once({distinct_id:o,$device_id:e?o:a},"")}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(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&i){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!i)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return s}alias(e,t){return e===this.get_property(Sr)?(b.critical("Attempting to create alias for existing People user - aborting."),-2):this.zr("posthog.alias")?(m(t)&&(t=this.get_distinct_id()),e!==t?(this.Hr(nt,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(b.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=E({},this.config);if(q(e)){var i,s,n,a,o;M(this.config,un(e));var l=this.kr();(i=this.persistence)==null||i.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Yi(E({},this.config,{persistence:"sessionStorage"}),l);var c=this.$r(this.config.debug);xe(c)&&(this.config.debug=c),xe(this.config.debug)&&(this.config.debug?(ge.DEBUG=!0,D.H()&&D.G("ph_debug","true"),b.info("set_config",{config:e,oldConfig:t,newConfig:E({},this.config)})):(ge.DEBUG=!1,D.H()&&D.V("ph_debug"))),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(n=this.autocapture)==null||n.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Br(),(o=this.externalIntegrations)==null||o.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var s,n,a,o,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),i.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(E({},s,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:et;return t!==et&&(t=et+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(ve))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(ve))==="identified"}Ur(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ve(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[nt])&&((t=this.persistence)==null||(t=t.props)==null||!t[Ut]))}jr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ur()||this.zr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}zr(e){return this.config.person_profiles==="never"?(b.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Hr(Ut,!0),!0)}kr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!t}Br(){var e,t,i,s,n=this.kr();return((e=this.persistence)==null?void 0:e.wi)!==n&&((i=this.persistence)==null||i.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t.wi)!==n&&((s=this.sessionPersistence)==null||s.set_disabled(n)),n}opt_in_capturing(e){if(this.config.cookieless_mode!=="always"){var t,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(t=this.sessionManager)==null||t.destroy(),this.sessionManager=new sn(this),this.persistence&&(this.sessionPropsManager=new rn(this,this.sessionManager,this.persistence)),this.sessionRecording=new on(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Br(),this.Ar(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(m(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e==null?void 0:e.captureEventName)!==null&&i!==void 0?i:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Dr()}else b.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Br(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:ct,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,this.Dr())):b.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===ye.GRANTED?"granted":e===ye.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Br()}_is_bot(){return X?nn(X,this.config.custom_blocked_useragents):void 0}Dr(){y&&(y.visibilityState==="visible"?this.mr||(this.mr=!0,this.capture("$pageview",{title:y.title},{send_instantly:!0}),this.yr&&(y.removeEventListener("visibilitychange",this.yr),this.yr=null)):this.yr||(this.yr=this.Dr.bind(this),L(y,"visibilitychange",this.yr)))}debug(e){e===!1?(h==null||h.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(h==null||h.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}))}M(){var e,t,i,s,n,a,o,l=this.Sr||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(b.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",s=!1,n=b,a=(t="advanced_disable_flags")in(e=l)&&!m(e[t]),o=i in e&&!m(e[i]),a?e[t]:o?(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]):s)}Nr(e){if(R(this.config.before_send))return e;var t=F(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(i=s(i),R(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return En(e.event)?b.warn(n+". This can cause unexpected behavior."):b.info(n),null}i.properties&&!Ve(i.properties)||b.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?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)})}$r(e){var t=xe(e)&&!e,i=D.H()&&D.q("ph_debug")==="true";return!t&&(!!i||e)}}(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=Yn(r.prototype[e[t]])})(ri,["identify"]);var dn;dn=It[et]=new ri,(function(){function r(){r.done||(r.done=!0,ln=!1,O(It,(function(e){e._dom_loaded()})))}y!=null&&y.addEventListener?y.readyState==="complete"?r():L(y,"DOMContentLoaded",r,{capture:!1}):h&&b.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})();var hn;(function(r){r.USER_ADDED_TO_CART="user_added_to_cart",r.USER_SUBMITTED_CHECKOUT="user_submitted_checkout"})(hn||(hn={}));const To={class:"dialog-block-header-container"},Fo={class:"dialog-block-title"},Oo={class:"dialog-block-description"},Ro=v.defineComponent({__name:"DialogBlockHeader",props:{title:{},description:{}},setup(r){const e=r;return(t,i)=>(v.openBlock(),v.createElementBlock("div",To,[v.createElementVNode("div",Fo,v.toDisplayString(e.title??"Your expert"),1),v.createElementVNode("div",Oo,v.toDisplayString(e.description??"A question about this product?"),1)]))}}),tt=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},Ao=tt(Ro,[["__scopeId","data-v-28e6dda7"]]),Do={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Mo={"clip-path":"url(#clip0_466_934)"},No=["stroke"],Lo=["stroke"],Bo=v.defineComponent({__name:"AiStarsIcon",props:{color:{}},setup(r){const e=r;return(t,i)=>(v.openBlock(),v.createElementBlock("svg",Do,[v.createElementVNode("g",Mo,[v.createElementVNode("path",{d:`M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
|
|
5
5
|
12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684
|
|
6
6
|
13.7084 7.85932 13.9296L9.16675 14.5833L7.85932 15.237C7.41684 15.4583 7.19559
|
|
7
7
|
15.5689 7.00388 15.7167C6.83375 15.8478 6.68124 16.0003 6.55011 16.1704C6.40232
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
9.01742C10.137 8.83469 9.83145 8.71718 9.22043 8.48217L6.66675 7.49999L9.22043
|
|
20
20
|
6.5178C9.83145 6.28279 10.137 6.16529 10.3939 5.98256C10.6217 5.82061 10.8207
|
|
21
21
|
5.62162 10.9827 5.39386C11.1654 5.13688 11.2829 4.83136 11.5179 4.22034L12.5001
|
|
22
|
-
1.66666Z`,stroke:e.color||"#181825","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Lo)]),i[0]||(i[0]=v.createElementVNode("defs",null,[v.createElementVNode("clipPath",{id:"clip0_466_934"},[v.createElementVNode("rect",{width:"20",height:"20",fill:"white"})])],-1))]))}}),Uo=["onClick"],qo={class:"dialog-block-suggestions-item-label"},jo=tt(v.defineComponent({__name:"DialogBlockSuggestions",props:{client:{},questions:{},productId:{},productTitle:{},selectedVariantId:{}},setup(r){const e=r,t=i=>{e.client.sendProductMessage({productId:e.productId,productTitle:e.productTitle,selectedVariantId:e.selectedVariantId,question:i,fromQuestionSuggestion:!0})};return(i,s)=>(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(e.questions,n=>(v.openBlock(),v.createElementBlock("button",{key:n.question,class:"dialog-block-suggestions-item",onClick:a=>t(n.question)},[v.createVNode(Bo,{class:"dialog-block-suggestions-item-icon",color:e.client.theme.primaryColor},null,8,["color"]),v.createElementVNode("span",qo,v.toDisplayString(n.question),1)],8,Uo))),128))}}),[["__scopeId","data-v-fb1910ce"]]),Vo={};function Ho(r,e){return v.openBlock(),v.createElementBlock(v.Fragment,null,[e[0]||(e[0]=v.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),e[1]||(e[1]=v.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),e[2]||(e[2]=v.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1))],64)}const Go=tt(Vo,[["render",Ho],["__scopeId","data-v-26a64b58"]]),Wo={class:"dialog-block-suggestions-container"},zo=tt(v.defineComponent({__name:"DialogBlockSuggestionsContainer",props:{client:{},questions:{},isLoading:{type:Boolean},productId:{},productTitle:{},selectedVariantId:{}},setup(r){const e=r;return(t,i)=>(v.openBlock(),v.createElementBlock("div",Wo,[e.isLoading||!e.questions?(v.openBlock(),v.createBlock(Go,{key:0})):(v.openBlock(),v.createBlock(jo,{key:1,client:e.client,questions:e.questions,"product-id":e.productId,"product-title":e.productTitle,"selected-variant-id":e.selectedVariantId},null,8,["client","questions","product-id","product-title","selected-variant-id"]))]))}}),[["__scopeId","data-v-18c9e78b"]]),Yo={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},
|
|
22
|
+
1.66666Z`,stroke:e.color||"#181825","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Lo)]),i[0]||(i[0]=v.createElementVNode("defs",null,[v.createElementVNode("clipPath",{id:"clip0_466_934"},[v.createElementVNode("rect",{width:"20",height:"20",fill:"white"})])],-1))]))}}),Uo=["onClick"],qo={class:"dialog-block-suggestions-item-label"},jo=tt(v.defineComponent({__name:"DialogBlockSuggestions",props:{client:{},questions:{},productId:{},productTitle:{},selectedVariantId:{}},setup(r){const e=r,t=i=>{e.client.sendProductMessage({productId:e.productId,productTitle:e.productTitle,selectedVariantId:e.selectedVariantId,question:i,fromQuestionSuggestion:!0})};return(i,s)=>(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(e.questions,n=>(v.openBlock(),v.createElementBlock("button",{key:n.question,class:"dialog-block-suggestions-item",onClick:a=>t(n.question)},[v.createVNode(Bo,{class:"dialog-block-suggestions-item-icon",color:e.client.theme.primaryColor},null,8,["color"]),v.createElementVNode("span",qo,v.toDisplayString(n.question),1)],8,Uo))),128))}}),[["__scopeId","data-v-fb1910ce"]]),Vo={};function Ho(r,e){return v.openBlock(),v.createElementBlock(v.Fragment,null,[e[0]||(e[0]=v.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),e[1]||(e[1]=v.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1)),e[2]||(e[2]=v.createElementVNode("div",{class:"dialog-block-suggestions-skeleton-item"},null,-1))],64)}const Go=tt(Vo,[["render",Ho],["__scopeId","data-v-26a64b58"]]),Wo={class:"dialog-block-suggestions-container"},zo=tt(v.defineComponent({__name:"DialogBlockSuggestionsContainer",props:{client:{},questions:{},isLoading:{type:Boolean},productId:{},productTitle:{},selectedVariantId:{}},setup(r){const e=r;return(t,i)=>(v.openBlock(),v.createElementBlock("div",Wo,[e.isLoading||!e.questions?(v.openBlock(),v.createBlock(Go,{key:0})):(v.openBlock(),v.createBlock(jo,{key:1,client:e.client,questions:e.questions,"product-id":e.productId,"product-title":e.productTitle,"selected-variant-id":e.selectedVariantId},null,8,["client","questions","product-id","product-title","selected-variant-id"]))]))}}),[["__scopeId","data-v-18c9e78b"]]),Yo={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ko=["stroke"],Xo=v.defineComponent({__name:"ArrowIcon",props:{color:{}},setup(r){const e=r;return(t,i)=>(v.openBlock(),v.createElementBlock("svg",Yo,[v.createElementVNode("path",{d:"M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",stroke:e.color||"#ffffff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ko)]))}}),Jo=["placeholder"],Zo=["disabled"],pn=tt(v.defineComponent({__name:"DialogInput",props:{client:{},placeholder:{},productId:{},productTitle:{},selectedVariantId:{}},setup(r){const e=r,t=v.ref(),i=v.ref(""),s=()=>{var a;(a=t.value)==null||a.focus()},n=()=>{const a=i.value;a.trim()&&(e.client.sendProductMessage({productId:e.productId,productTitle:e.productTitle,selectedVariantId:e.selectedVariantId,question:a,fromQuestionSuggestion:!0}),i.value="")};return(a,o)=>(v.openBlock(),v.createElementBlock("div",{class:"dialog-input-wrapper",onClick:s},[v.withDirectives(v.createElementVNode("input",{id:"dialog-ask-anything-input-ai-input",ref_key:"inputRef",ref:t,"onUpdate:modelValue":o[0]||(o[0]=l=>i.value=l),class:"dialog-ask-anything-input-ai-input",placeholder:e.placeholder??"Ask anything...",onKeydown:v.withKeys(n,["enter"])},null,40,Jo),[[v.vModelText,i.value]]),v.createElementVNode("button",{id:"send-message-button-ai-input",class:"dialog-input-submit",disabled:!i.value.trim(),onClick:n},[v.createVNode(Xo,{color:e.client.theme.ctaTextColor},null,8,["color"])],8,Zo)]))}}),[["__scopeId","data-v-7649af7c"]]),Qo=v.defineComponent({__name:"ThemeProvider",props:{theme:{}},setup(r){const e=r,t=document.body,i=n=>n.replace(/([A-Z])/g,"-$1").toLowerCase(),s=n=>{n&&Object.keys(n).forEach(a=>{const o=a,l=i(a);if(n[o]!==void 0){if(typeof n[o]=="object"){Object.keys(n[o]).forEach(c=>{var d;const u=c;if(u!==void 0){const f=i(c),p=n[o];t.style.setProperty(`--dialog-theme-${l}-${f}`,(d=p[u])==null?void 0:d.toString())}});return}if(o==="ctaBorderType"){const c=n[o]==="rounded"?"24px":"0";t.style.setProperty(`--dialog-theme-${l}`,c);return}t.style.setProperty(`--dialog-theme-${l}`,n[o].toString())}})};return v.onMounted(()=>{e.theme&&s(e.theme)}),v.watch(()=>e.theme,n=>{n&&s(n)},{deep:!0}),(n,a)=>v.renderSlot(n.$slots,"default")}}),el={id:"dialog-instant",class:"dialog-block-container"},tl=tt(v.defineComponent({__name:"DialogProductBlock",props:{client:{},productId:{},productTitle:{},selectedVariantId:{default:void 0},enableInput:{type:Boolean,default:!0}},setup(r){const e=r,t=v.ref(!0),i=v.ref(void 0),s=v.ref(0),n=v.computed(()=>{var c;return t.value?"":(c=i.value)==null?void 0:c.assistantName}),a=v.computed(()=>{var c;return t.value?"":(c=i.value)==null?void 0:c.description}),o=v.computed(()=>{var c;return t.value?"":(c=i.value)==null?void 0:c.inputPlaceholder}),l=async()=>{const c=++s.value;t.value=!0,i.value=void 0;try{const u=await e.client.getSuggestions(e.productId);c===s.value&&(i.value=u)}catch(u){console.error("error",u)}finally{c===s.value&&(t.value=!1)}};return v.watch(()=>[e.client,e.productId],()=>{l()},{immediate:!0}),(c,u)=>(v.openBlock(),v.createBlock(Qo,{theme:e.client.theme},{default:v.withCtx(()=>{var d;return[v.createElementVNode("div",el,[v.createVNode(Ao,{title:n.value,description:a.value},null,8,["title","description"]),v.createVNode(zo,{client:e.client,questions:(d=i.value)==null?void 0:d.questions,"is-loading":t.value,"product-id":e.productId,"product-title":e.productTitle,"selected-variant-id":e==null?void 0:e.selectedVariantId},null,8,["client","questions","is-loading","product-id","product-title","selected-variant-id"]),e.enableInput?(v.openBlock(),v.createBlock(pn,{key:0,client:e.client,placeholder:o.value,"product-id":e.productId,"product-title":e.productTitle,"selected-variant-id":e==null?void 0:e.selectedVariantId},null,8,["client","placeholder","product-id","product-title","selected-variant-id"])):v.createCommentVNode("",!0)])]}),_:1},8,["theme"]))}}),[["__scopeId","data-v-651875ac"]]);Ee.DialogInput=pn,Ee.DialogProductBlock=tl,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"})}));
|