@molin.ai/shop-ai 0.7.5 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in i?kd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var T=(i,e,t)=>Sd(i,typeof e!="symbol"?e+"":e,t),Is=(i,e,t)=>e.has(i)||ml("Cannot "+t);var f=(i,e,t)=>(Is(i,e,"read from private field"),t?t.call(i):e.get(i)),b=(i,e,t)=>e.has(i)?ml("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),R=(i,e,t,r)=>(Is(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$=(i,e,t)=>(Is(i,e,"access private method"),t);var _l=(i,e,t,r)=>({set _(n){R(i,e,n,t)},get _(){return f(i,e,r)}});var Kr=globalThis,Zr=Kr.ShadowRoot&&(Kr.ShadyCSS===void 0||Kr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ts=Symbol(),yl=new WeakMap,Yi=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Ts)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Zr&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=yl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&yl.set(t,e))}return e}toString(){return this.cssText}},bl=i=>new Yi(typeof i=="string"?i:i+"",void 0,Ts),pt=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,s)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[s+1],i[0]);return new Yi(t,i,Ts)},Ps=(i,e)=>{if(Zr)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=Kr.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Qr=Zr?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return bl(t)})(i):i;var{is:Ed,defineProperty:Cd,getOwnPropertyDescriptor:$d,getOwnPropertyNames:Ad,getOwnPropertySymbols:Id,getPrototypeOf:Td}=Object,en=globalThis,wl=en.trustedTypes,Pd=wl?wl.emptyScript:"",Rd=en.reactiveElementPolyfillSupport,Ki=(i,e)=>i,Rs={toAttribute(i,e){switch(e){case Boolean:i=i?Pd:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},kl=(i,e)=>!Ed(i,e),xl={attribute:!0,type:String,converter:Rs,reflect:!1,hasChanged:kl};Symbol.metadata??=Symbol("metadata"),en.litPropertyMetadata??=new WeakMap;var dt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=xl){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Cd(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:s}=$d(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n?.call(this)},set(o){let l=n?.call(this);s.call(this,o),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??xl}static _$Ei(){if(this.hasOwnProperty(Ki("elementProperties")))return;let e=Td(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ki("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ki("properties"))){let t=this.properties,r=[...Ad(t),...Id(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(Qr(n))}else e!==void 0&&t.push(Qr(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ps(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(r.converter?.toAttribute!==void 0?r.converter:Rs).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=r.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Rs;this._$Em=n,this[n]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??kl)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[n,s]of r)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};dt.elementStyles=[],dt.shadowRootOptions={mode:"open"},dt[Ki("elementProperties")]=new Map,dt[Ki("finalized")]=new Map,Rd?.({ReactiveElement:dt}),(en.reactiveElementVersions??=[]).push("2.0.4");var Fs=globalThis,tn=Fs.trustedTypes,Sl=tn?tn.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ms="$lit$",ht=`lit$${Math.random().toFixed(9).slice(2)}$`,Ds="?"+ht,Od=`<${Ds}>`,Wt=document,Qi=()=>Wt.createComment(""),er=i=>i===null||typeof i!="object"&&typeof i!="function",Ls=Array.isArray,Tl=i=>Ls(i)||typeof i?.[Symbol.iterator]=="function",Os=`[
2
- \f\r]`,Zi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,El=/-->/g,Cl=/>/g,Ht=RegExp(`>|${Os}(?:([^\\s"'>=/]+)(${Os}*=${Os}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),$l=/'/g,Al=/"/g,Pl=/^(?:script|style|textarea|title)$/i,Ns=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),L=Ns(1),sg=Ns(2),og=Ns(3),Qe=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),Il=new WeakMap,zt=Wt.createTreeWalker(Wt,129);function Rl(i,e){if(!Ls(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Sl!==void 0?Sl.createHTML(e):e}var Ol=(i,e)=>{let t=i.length-1,r=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=Zi;for(let l=0;l<t;l++){let a=i[l],c,p,u=-1,d=0;for(;d<a.length&&(o.lastIndex=d,p=o.exec(a),p!==null);)d=o.lastIndex,o===Zi?p[1]==="!--"?o=El:p[1]!==void 0?o=Cl:p[2]!==void 0?(Pl.test(p[2])&&(n=RegExp("</"+p[2],"g")),o=Ht):p[3]!==void 0&&(o=Ht):o===Ht?p[0]===">"?(o=n??Zi,u=-1):p[1]===void 0?u=-2:(u=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?Ht:p[3]==='"'?Al:$l):o===Al||o===$l?o=Ht:o===El||o===Cl?o=Zi:(o=Ht,n=void 0);let h=o===Ht&&i[l+1].startsWith("/>")?" ":"";s+=o===Zi?a+Od:u>=0?(r.push(c),a.slice(0,u)+Ms+a.slice(u)+ht+h):a+ht+(u===-2?l:h)}return[Rl(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},tr=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0,l=e.length-1,a=this.parts,[c,p]=Ol(e,t);if(this.el=i.createElement(c,r),zt.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=zt.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(Ms)){let d=p[o++],h=n.getAttribute(u).split(ht),g=/([.?@])?(.*)/.exec(d);a.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?nn:g[1]==="?"?sn:g[1]==="@"?on:Gt}),n.removeAttribute(u)}else u.startsWith(ht)&&(a.push({type:6,index:s}),n.removeAttribute(u));if(Pl.test(n.tagName)){let u=n.textContent.split(ht),d=u.length-1;if(d>0){n.textContent=tn?tn.emptyScript:"";for(let h=0;h<d;h++)n.append(u[h],Qi()),zt.nextNode(),a.push({type:2,index:++s});n.append(u[d],Qi())}}}else if(n.nodeType===8)if(n.data===Ds)a.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(ht,u+1))!==-1;)a.push({type:7,index:s}),u+=ht.length-1}s++}}static createElement(e,t){let r=Wt.createElement("template");return r.innerHTML=e,r}};function Vt(i,e,t=i,r){if(e===Qe)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,s=er(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=Vt(i,n._$AS(i,e.values),n,r)),e}var rn=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??Wt).importNode(t,!0);zt.currentNode=n;let s=zt.nextNode(),o=0,l=0,a=r[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new fi(s,s.nextSibling,this,e):a.type===1?c=new a.ctor(s,a.name,a.strings,this,e):a.type===6&&(c=new an(s,this,e)),this._$AV.push(c),a=r[++l]}o!==a?.index&&(s=zt.nextNode(),o++)}return zt.currentNode=Wt,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},fi=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Vt(this,e,t),er(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==Qe&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Tl(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&er(this._$AH)?this._$AA.nextSibling.data=e:this.T(Wt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=tr.createElement(Rl(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let s=new rn(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Il.get(e.strings);return t===void 0&&Il.set(e.strings,t=new tr(e)),t}k(e){Ls(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let s of e)n===t.length?t.push(r=new i(this.O(Qi()),this.O(Qi()),this,this.options)):r=t[n],r._$AI(s),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Gt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=U}_$AI(e,t=this,r,n){let s=this.strings,o=!1;if(s===void 0)e=Vt(this,e,t,0),o=!er(e)||e!==this._$AH&&e!==Qe,o&&(this._$AH=e);else{let l=e,a,c;for(e=s[0],a=0;a<s.length-1;a++)c=Vt(this,l[r+a],t,a),c===Qe&&(c=this._$AH[a]),o||=!er(c)||c!==this._$AH[a],c===U?e=U:e!==U&&(e+=(c??"")+s[a+1]),this._$AH[a]=c}o&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},nn=class extends Gt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},sn=class extends Gt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},on=class extends Gt{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=Vt(this,e,t,0)??U)===Qe)return;let r=this._$AH,n=e===U&&r!==U||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==U&&(r===U||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},an=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Vt(this,e)}},Fl={M:Ms,P:ht,A:Ds,C:1,L:Ol,R:rn,D:Tl,V:Vt,I:fi,H:Gt,N:sn,U:on,B:nn,F:an},Fd=Fs.litHtmlPolyfillSupport;Fd?.(tr,fi),(Fs.litHtmlVersions??=[]).push("3.2.1");var Ml=(i,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let s=t?.renderBefore??null;r._$litPart$=n=new fi(e.insertBefore(Qi(),s),s,void 0,t??{})}return n._$AI(i),n};var B=class extends dt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ml(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Qe}};B._$litElement$=!0,B.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:B});var Md=globalThis.litElementPolyfillSupport;Md?.({LitElement:B});(globalThis.litElementVersions??=[]).push("4.1.1");function Xs(i){return[...i.v,(i.i?"!":"")+i.n].join(":")}function Dd(i,e=","){return i.map(Xs).join(e)}var Bl=typeof CSS<"u"&&CSS.escape||(i=>i.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function ln(i){for(var e=9,t=i.length;t--;)e=Math.imul(e^i.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function pn(i,e="@media "){return e+Z(i).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(r=>`(${r}-width:${t[r]})`).join(" and "))).join(",")}function Z(i=[]){return Array.isArray(i)?i:i==null?[]:[i]}function Dl(i){return i}function dn(){}var he={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Hl(i){return i.match(/[-=:;]/g)?.length||0}function Hs(i){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(i)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(Hl(i),15)<<18}var Ld=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function Js({n:i,i:e,v:t=[]},r,n,s){i&&(i=Xs({n:i,i:e,v:t})),s=[...Z(s)];for(let l of t){let a=r.theme("screens",l);for(let c of Z(a&&pn(a)||r.v(l))){var o;s.push(c),n|=a?67108864|Hs(c):l=="dark"?1073741824:c[0]=="@"?Hs(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Ld.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:i,p:n,r:s,i:e}}var zl=new Map;function zs(i){if(i.d){let e=[],t=Us(i.r.reduce((r,n)=>n[0]=="@"?(e.push(n),r):n?Us(r,s=>Us(n,o=>{let l=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(l){let a=s.indexOf(l[1]);return~a?s.slice(0,a)+l[0]+s.slice(a+l[1].length):qs(s,o)}return qs(o,s)})):r,"&"),r=>qs(r,i.n?"."+Bl(i.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((r,n)=>n+"{"+r+"}",i.d)}}function Us(i,e){return i.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,r,n)=>e(r)+n)}function qs(i,e){return i.replace(/&/g,e)}var Ll=new Intl.Collator("en",{numeric:!0});function Wl(i,e){for(var t=0,r=i.length;t<r;){let n=r+t>>1;0>=Vl(i[n],e)?t=n+1:r=n}return r}function Vl(i,e){let t=i.p&he.o;return t==(e.p&he.o)&&(t==he.b||t==he.o)?0:i.p-e.p||i.o-e.o||Ll.compare(Nl(i.n),Nl(e.n))||Ll.compare(Ul(i.n),Ul(e.n))}function Nl(i){return(i||"").split(/:/).pop().split("/").pop()||"\0"}function Ul(i){return(i||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function js(i,e){return Math.round(parseInt(i,16)*e)}function Xe(i,e={}){if(typeof i=="function")return i(e);let{opacityValue:t="1",opacityVariable:r}=e,n=r?`var(${r})`:t;if(i.includes("<alpha-value>"))return i.replace("<alpha-value>",n);if(i[0]=="#"&&(i.length==4||i.length==7)){let s=(i.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[js(i.substr(1,s),o),js(i.substr(1+s,s),o),js(i.substr(1+2*s,s),o),n]})`}return n=="1"?i:n=="0"?"#0000":i.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function Gl(i,e,t,r,n=[]){return function s(o,{n:l,p:a,r:c=[],i:p},u){let d=[],h="",g=0,m=0;for(let y in o||{}){var k,w;let O=o[y];if(y[0]=="@"){if(!O)continue;if(y[1]=="a"){d.push(...Ks(l,a,cn(""+O),u,a,c,p,!0));continue}if(y[1]=="l"){for(let M of Z(O))d.push(...s(M,{n:l,p:(k=he[y[7]],a&~he.o|k),r:y[7]=="d"?[]:c,i:p},u));continue}if(y[1]=="i"){d.push(...Z(O).map(M=>({p:-1,o:0,r:[],d:y+" "+M})));continue}if(y[1]=="k"){d.push({p:he.d,o:0,r:[y],d:s(O,{p:he.d},u).map(zs).join("")});continue}if(y[1]=="f"){d.push(...Z(O).map(M=>({p:he.d,o:0,r:[y],d:s(M,{p:he.d},u).map(zs).join("")})));continue}}if(typeof O!="object"||Array.isArray(O))y=="label"&&O?l=O+ln(JSON.stringify([a,p,o])):(O||O===0)&&(y=y.replace(/[A-Z]/g,M=>"-"+M.toLowerCase()),m+=1,g=Math.max(g,(w=y)[0]=="-"?0:Hl(w)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(w)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+Z(O).map(M=>u.s(y,Ys(""+M,u.theme)+(p?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let M=a;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(z,J)=>{let W=u.theme("screens",J);return W?(M|=67108864,pn(W,"")):z}),M|=Hs(y)),d.push(...s(O,{n:l,p:M,r:[...c,y],i:p},u))}else d.push(...s(O,{p:a,r:[...c,y]},u))}return d.unshift({n:l,p:a,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:c,d:h}),d.sort(Vl)}(i,Js(e,t,r,n),t)}function Ys(i,e){return i.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,r,n,s,o="")=>{let l=e(n,o);return typeof l=="function"&&/color|fill|stroke/i.test(n)?Xe(l):""+Z(l).filter(a=>Object(a)!==a)})}function Xl(i,e){let t,r=[];for(let n of i)n.d&&n.n?t?.p==n.p&&""+t.r==""+n.r?(t.c=[t.c,n.c].filter(Boolean).join(" "),t.d=t.d+";"+n.d):r.push(t={...n,n:n.n&&e}):r.push({...n,n:n.n&&e});return r}function un(i,e,t=he.u,r,n){let s=[];for(let o of i)for(let l of function(a,c,p,u,d){a={...a,i:a.i||d};let h=function(g,m){let k=zl.get(g.n);return k?k(g,m):m.r(g.n,g.v[0]=="dark")}(a,c);return h?typeof h=="string"?({r:u,p}=Js(a,c,p,u),Xl(un(cn(h),c,p,u,a.i),a.n)):Array.isArray(h)?h.map(g=>{var m,k;return{o:0,...g,r:[...Z(u),...Z(g.r)],p:(m=p,k=g.p??p,m&~he.o|k)}}):Gl(h,a,c,p,u):[{c:Xs(a),p:0,o:0,r:[]}]}(o,e,t,r,n))s.splice(Wl(s,l),0,l);return s}function Ks(i,e,t,r,n,s,o,l){return Xl((l?t.flatMap(a=>un([a],r,n,s,o)):un(t,r,n,s,o)).map(a=>a.p&he.o&&(a.n||e==he.b)?{...a,p:a.p&~he.o|e,o:0}:a),i)}function Nd(i,e,t,r){var n;return n=(s,o)=>{let{n:l,p:a,r:c,i:p}=Js(s,o,e);return t&&Ks(l,e,t,o,a,c,p,r)},zl.set(i,n),i}function Bs(i,e,t){if(i[i.length-1]!="("){let r=[],n=!1,s=!1,o="";for(let l of i)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),n=!n),l.endsWith(":")){r[l=="dark:"?"unshift":"push"](l.slice(0,-1));continue}l[0]=="-"&&(l=l.slice(1),s=!s),l.endsWith("-")&&(l=l.slice(0,-1)),l&&l!="&"&&(o+=(o&&"-")+l)}o&&(s&&(o="-"+o),e[0].push({n:o,v:r.filter(Ud),i:n}))}}function Ud(i,e,t){return t.indexOf(i)==e}var ql=new Map;function cn(i){let e=ql.get(i);if(!e){let t=[],r=[[]],n=0,s=0,o=null,l=0,a=(c,p=0)=>{n!=l&&(t.push(i.slice(n,l+p)),c&&Bs(t,r)),n=l+1};for(;l<i.length;l++){let c=i[l];if(s)i[l-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)i[l-1]!="\\"&&o.test(i.slice(l))&&(o=null,n=l+RegExp.lastMatch.length);else if(c=="/"&&i[l-1]!="\\"&&(i[l+1]=="*"||i[l+1]=="/"))o=i[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")a(),t.push(c);else if(c==":")i[l+1]!=":"&&a(!1,1);else if(/[\s,)]/.test(c)){a(!0);let p=t.lastIndexOf("(");if(c==")"){let u=t[p-1];if(/[~@]$/.test(u)){let d=r.shift();t.length=p,Bs([...t,"#"],r);let{v:h}=r[0].pop();for(let g of d)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);Bs([...t,Nd(u.length>1?u.slice(0,-1)+ln(JSON.stringify([u,d])):u+"("+Dd(d)+")",he.a,d,/@$/.test(u))],r)}p=t.lastIndexOf("(",p-1)}t.length=p+1}else/[~@]/.test(c)&&i[l+1]=="("&&r.unshift([])}a(!0),ql.set(i,e=r[0])}return e}function x(i,e,t){return[i,Ws(e,t)]}function Ws(i,e){return typeof i=="function"?i:typeof i=="string"&&/^[\w-]+$/.test(i)?(t,r)=>({[i]:e?e(t,r):Vs(t,1)}):t=>i||{[t[1]]:Vs(t,2)}}function Vs(i,e,t=i.slice(e).find(Boolean)||i.$$||i.input){return i.input[0]=="-"?`calc(${t} * -1)`:t}function E(i,e,t,r){return[i,Zs(e,t,r)]}function Zs(i,e,t){let r=typeof e=="string"?(n,s)=>({[e]:t?t(n,s):n._}):e||(({1:n,_:s},o,l)=>({[n||l]:s}));return(n,s)=>{let o=Jl(i||n[1]),l=s.theme(o,n.$$)??ot(n.$$,o,s);if(l!=null)return n._=Vs(n,0,l),r(n,s,o)}}function fe(i,e={},t){return[i,qd(e,t)]}function qd(i={},e){return(t,r)=>{let{section:n=Jl(t[0]).replace("-","")+"Color"}=i,[s,o]=jd(t.$$);if(!s)return;let l=r.theme(n,s)||ot(s,n,r);if(!l||typeof l=="object")return;let{opacityVariable:a=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:p=n,selector:u}=i,d=r.theme(c,o||"DEFAULT")||o&&ot(o,c,r),h=e||(({_:m})=>{let k=ir(p,m);return u?{[u]:k}:k});t._={value:Xe(l,{opacityVariable:a||void 0,opacityValue:d||void 0}),color:m=>Xe(l,m),opacityVariable:a||void 0,opacityValue:d||void 0};let g=h(t,r);if(!t.dark){let m=r.d(n,s,l);m&&m!==l&&(t._={value:Xe(m,{opacityVariable:a||void 0,opacityValue:d||"1"}),color:k=>Xe(m,k),opacityVariable:a||void 0,opacityValue:d||void 0},g={"&":g,[r.v("dark")]:h(t,r)})}return g}}function jd(i){return(i.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function ir(i,e){let t={};return typeof e=="string"?t[i]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[i]=e.value),t}function ot(i,e,t){if(i[0]=="["&&i.slice(-1)=="]"){if(i=gi(Ys(i.slice(1,-1),t.theme)),!e)return i;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(i)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(i))||/image/i.test(e)&&!(/^image:/.test(i)||/^[a-z-]+\(/.test(i))||/weight/i.test(e)&&!(/^(number|any):/.test(i)||/^\d+$/.test(i))||/position/i.test(e)&&/^(length|size):/.test(i)))return i.replace(/^[a-z-]+:/,"")}}function Jl(i){return i.replace(/-./g,e=>e[1].toUpperCase())}function gi(i){return i.includes("url(")?i.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",r,n="")=>gi(t)+r+gi(n)):i.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Qs({presets:i=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Z(e.variants),rules:Z(e.rules),ignorelist:Z(e.ignorelist),hash:void 0,stringify:(r,n)=>r+":"+n,finalize:[]};for(let r of Z([...i,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Z(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:l,variants:a,rules:c,ignorelist:p,hash:u=t.hash,stringify:d=t.stringify,finalize:h}=typeof r=="function"?r(t):r;t={preflight:t.preflight!==!1&&n!==!1&&[...t.preflight,...Z(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Z(a)],rules:[...t.rules,...Z(c)],ignorelist:[...t.ignorelist,...Z(p)],hash:u,stringify:d,finalize:[...t.finalize,...Z(h)]}}return t}function jl(i,e,t,r,n,s){for(let o of e){let l=t.get(o);l||t.set(o,l=r(o));let a=l(i,n,s);if(a)return a}}function Bd(i){var e;return Gs(i[0],typeof(e=i[1])=="function"?e:()=>e)}function Hd(i){var e,t;return Array.isArray(i)?Gs(i[0],Ws(i[1],i[2])):Gs(i,Ws(e,t))}function Gs(i,e){return Yl(i,(t,r,n,s)=>{let o=r.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,n)})}function Yl(i,e){let t=Z(i).map(zd);return(r,n,s)=>{for(let o of t){let l=e(r,o,n,s);if(l)return l}}}function zd(i){return typeof i=="string"?RegExp("^"+i+(i.includes("$")||i.slice(-1)=="-"?"":"$")):i}function Kl(i,e){let t=Qs(i),r=function({theme:a,darkMode:c,darkColor:p=dn,variants:u,rules:d,hash:h,stringify:g,ignorelist:m,finalize:k}){let w=new Map,y=new Map,O=new Map,M=new Map,z=Yl(m,(P,q)=>q.test(P));u.push(["dark",Array.isArray(c)||c=="class"?`${Z(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let J=typeof h=="function"?P=>h(P,ln):h?ln:Dl;J!==Dl&&k.push(P=>({...P,n:P.n&&J(P.n),d:P.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(q,X)=>"--"+J(X).replace("#",""))}));let W={theme:function({extend:P={},...q}){let X={},je={get colors(){return ve("colors")},theme:ve,negative(){return{}},breakpoints(Y){let ie={};for(let ce in Y)typeof Y[ce]=="string"&&(ie["screen-"+ce]=Y[ce]);return ie}};return ve;function ve(Y,ie,ce,De){if(Y){if({1:Y,2:De}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Y)||[,Y],/[.[]/.test(Y)){let Ce=[];Y.replace(/\[([^\]]+)\]|([^.[]+)/g,(ne,me,Pe=me)=>Ce.push(Pe)),Y=Ce.shift(),ce=ie,ie=Ce.join("-")}let ae=X[Y]||Object.assign(Object.assign(X[Y]={},Ge(q,Y)),Ge(P,Y));if(ie==null)return ae;ie||(ie="DEFAULT");let Ee=ae[ie]??ie.split("-").reduce((Ce,ne)=>Ce?.[ne],ae)??ce;return De?Xe(Ee,{opacityValue:Ys(De,ve)}):Ee}let Be={};for(let ae of[...Object.keys(q),...Object.keys(P)])Be[ae]=ve(ae);return Be}function Ge(Y,ie){let ce=Y[ie];return typeof ce=="function"&&(ce=ce(je)),ce&&/color|fill|stroke/i.test(ie)?function De(Be,ae=[]){let Ee={};for(let Ce in Be){let ne=Be[Ce],me=[...ae,Ce];Ee[me.join("-")]=ne,Ce=="DEFAULT"&&(me=ae,Ee[ae.join("-")]=ne),typeof ne=="object"&&Object.assign(Ee,De(ne,me))}return Ee}(ce):ce}}(a),e:Bl,h:J,s(P,q){return g(P,q,W)},d(P,q,X){return p(P,q,W,X)},v(P){return w.has(P)||w.set(P,jl(P,u,y,Bd,W)||"&:"+P),w.get(P)},r(P,q){let X=JSON.stringify([P,q]);return O.has(X)||O.set(X,!z(P,W)&&jl(P,d,M,Hd,W,q)),O.get(X)},f(P){return k.reduce((q,X)=>X(q,W),P)}};return W}(t),n=new Map,s=[],o=new Set;e.resume(a=>n.set(a,a),(a,c)=>{e.insert(a,s.length,c),s.push(c),o.add(a)});function l(a){let c=r.f(a),p=zs(c);if(p&&!o.has(p)){o.add(p);let u=Wl(s,a);e.insert(p,u,a),s.splice(u,0,a)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let u of Z(t.preflight))typeof u=="function"&&(u=u(r)),u&&(typeof u=="string"?Ks("",he.b,cn(u),r,he.b,[],!1,!0):Gl(u,{},r,he.b)).forEach(l);c=""+c;let p=n.get(c);if(!p){let u=new Set;for(let d of un(cn(c),r))u.add(d.c).add(l(d));p=[...u].filter(Boolean).join(" "),n.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:r.theme,config:t,snapshot(){let a=e.snapshot(),c=new Set(o),p=new Map(n),u=[...s];return()=>{a(),o=c,n=p,s=u}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Wd(i,e){return i!=e&&""+i.split(" ").sort()!=""+e.split(" ").sort()}function Zl(i){let e=new MutationObserver(t);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),r(n),t([{target:n,type:""}])},disconnect(){e.disconnect()}};function t(n){for(let{type:s,target:o}of n)if(s[0]=="a")r(o);else for(let l of o.querySelectorAll("[class]"))r(l);e.takeRecords()}function r(n){let s,o=n.getAttribute?.("class");o&&Wd(o,s=i(o))&&n.setAttribute("class",s)}}function Vd(i){let e=document.querySelector(i||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function hn(i){let e=i?.cssRules?i:(i&&typeof i!="string"?i:Vd(i)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,r=>r.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,r){try{e.insertRule(t,r)}catch{e.insertRule(":root{}",r)}},resume:dn}}var Gd=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function Ql(i){return Gd.get(i)}function eu(i){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(i);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function tu(i,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(i);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Xd=[["-webkit-",1],["-moz-",2],["-ms-",4]];function iu(){return({stringify:i})=>({stringify(e,t,r){let n="",s=Ql(e);s&&(n+=i(s,t,r)+";");let o=eu(e),l=tu(e,t);for(let a of Xd)o&a[1]&&(n+=i(a[0]+e,t,r)+";"),l&a[1]&&(n+=i(e,a[0]+t,r)+";");return n+i(e,t,r)}})}function nu(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Zs("lineClamp",({_:i})=>ru(i))],["line-clamp-(\\d+)",({1:i})=>ru(i)]]}}function ru(i){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${i}`}}var nr={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...He(4,"rem",4,.5,.5),...He(12,"rem",4,5),14:"3.5rem",...He(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:V("blur"),backdropBrightness:V("brightness"),backdropContrast:V("contrast"),backdropGrayscale:V("grayscale"),backdropHueRotate:V("hueRotate"),backdropInvert:V("invert"),backdropOpacity:V("opacity"),backdropSaturate:V("saturate"),backdropSepia:V("sepia"),backgroundColor:V("colors"),backgroundImage:{none:"none"},backgroundOpacity:V("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...He(200,"",100,0,50),...He(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:i})=>({DEFAULT:i("colors.gray.200","currentColor"),...i("colors")}),borderOpacity:V("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:V("spacing"),borderWidth:{DEFAULT:"1px",...Je(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:V("colors"),caretColor:V("colors"),accentColor:({theme:i})=>({auto:"auto",...i("colors")}),contrast:{...He(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:V("borderColor"),divideOpacity:V("borderOpacity"),divideWidth:V("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:i})=>({...i("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:i})=>({...i("spacing"),...rr(2,6),...rr(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:V("spacing"),gradientColorStops:V("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:i})=>({...i("spacing"),...rr(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:i})=>({...i("spacing"),...rr(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...He(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:i})=>({auto:"auto",...i("spacing")}),maxHeight:({theme:i})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...i("spacing")}),maxWidth:({theme:i,breakpoints:e})=>({...e(i("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...He(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:V("spacing"),placeholderColor:V("colors"),placeholderOpacity:V("opacity"),outlineColor:V("colors"),outlineOffset:Je(8,"px"),outlineWidth:Je(8,"px"),ringColor:({theme:i})=>({...i("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:V("colors"),ringOffsetWidth:Je(8,"px"),ringOpacity:({theme:i})=>({...i("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Je(8,"px")},rotate:{...Je(2,"deg"),...Je(12,"deg",3),...Je(180,"deg",45)},saturate:He(200,"",100,0,50),scale:{...He(150,"",100,0,50),...He(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:V("spacing"),scrollPadding:V("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Je(2,"deg"),...Je(12,"deg",3)},space:V("spacing"),stroke:({theme:i})=>({...i("colors"),none:"none"}),strokeWidth:He(2),textColor:V("colors"),textDecorationColor:V("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Je(8,"px")},textUnderlineOffset:{auto:"auto",...Je(8,"px")},textIndent:V("spacing"),textOpacity:V("opacity"),transitionDuration:({theme:i})=>({...i("durations"),DEFAULT:"150ms"}),transitionDelay:V("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:i})=>({...i("spacing"),...rr(2,4),full:"100%"}),width:({theme:i})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...i("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...He(50,"",1,0,10),auto:"auto"}};function rr(i,e){let t={};do for(var r=1;r<i;r++)t[`${r}/${i}`]=Number((r/i*100).toFixed(6))+"%";while(++i<=e);return t}function Je(i,e,t=0){let r={};for(;t<=i;t=2*t||1)r[t]=t+e;return r}function He(i,e="",t=1,r=0,n=1,s={}){for(;r<=i;r+=n)s[r]=r/t+e;return s}function V(i){return({theme:e})=>e(i)}var su={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${nr.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${nr.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var pu=[x("\\[([-\\w]+):(.+)]",({1:i,2:e},t)=>({"@layer overrides":{"&":{[i]:ot(`[${e}]`,"",t)}}})),x("(group|peer)([~/][^-[]+)?",({input:i},{h:e})=>[{c:e(i)}]),E("aspect-","aspectRatio"),x("container",(i,{theme:e})=>{let{screens:t=e("screens"),center:r,padding:n}=e("container"),s={width:"100%",marginRight:r&&"auto",marginLeft:r&&"auto",...o("xs")};for(let l in t){let a=t[l];typeof a=="string"&&(s[pn(a)]={"&":{maxWidth:a,...o(l)}})}return s;function o(l){let a=n&&(typeof n=="string"?n:n[l]||n.DEFAULT);if(a)return{paddingRight:a,paddingLeft:a}}}),E("content-","content",({_:i})=>({"--tw-content":i,content:"var(--tw-content)"})),x("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),x("box-(border|content)","boxSizing",({1:i})=>i+"-box"),x("hidden",{display:"none"}),x("table-(auto|fixed)","tableLayout"),x(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",x("isolate","isolation"),x("object-(contain|cover|fill|none|scale-down)","objectFit"),E("object-","objectPosition"),x("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",fn),x("overscroll(-[xy])?-(auto|contain|none)",({1:i="",2:e})=>({["overscroll-behavior"+i]:e})),x("(static|fixed|absolute|relative|sticky)","position"),E("-?inset(-[xy])?(?:$|-)","inset",({1:i,_:e})=>({top:i!="-x"&&e,right:i!="-y"&&e,bottom:i!="-x"&&e,left:i!="-y"&&e})),E("-?(top|bottom|left|right)(?:$|-)","inset"),x("(visible|collapse)","visibility"),x("invisible",{visibility:"hidden"}),E("-?z-","zIndex"),x("flex-((row|col)(-reverse)?)","flexDirection",ou),x("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),E("(flex-(?:grow|shrink))(?:$|-)"),E("(flex)-"),E("grow(?:$|-)","flexGrow"),E("shrink(?:$|-)","flexShrink"),E("basis-","flexBasis"),E("-?(order)-"),"-?(order)-(\\d+)",E("grid-cols-","gridTemplateColumns"),x("grid-cols-(\\d+)","gridTemplateColumns",cu),E("col-","gridColumn"),x("col-(span)-(\\d+)","gridColumn",uu),E("col-start-","gridColumnStart"),x("col-start-(auto|\\d+)","gridColumnStart"),E("col-end-","gridColumnEnd"),x("col-end-(auto|\\d+)","gridColumnEnd"),E("grid-rows-","gridTemplateRows"),x("grid-rows-(\\d+)","gridTemplateRows",cu),E("row-","gridRow"),x("row-(span)-(\\d+)","gridRow",uu),E("row-start-","gridRowStart"),x("row-start-(auto|\\d+)","gridRowStart"),E("row-end-","gridRowEnd"),x("row-end-(auto|\\d+)","gridRowEnd"),x("grid-flow-((row|col)(-dense)?)","gridAutoFlow",i=>fn(ou(i))),x("grid-flow-(dense)","gridAutoFlow"),E("auto-cols-","gridAutoColumns"),E("auto-rows-","gridAutoRows"),E("gap-x(?:$|-)","gap","columnGap"),E("gap-y(?:$|-)","gap","rowGap"),E("gap(?:$|-)","gap"),"(justify-(?:items|self))-",x("justify-","justifyContent",au),x("(content|items|self)-",i=>({["align-"+i[1]]:au(i)})),x("(place-(content|items|self))-",({1:i,$$:e})=>({[i]:("wun".includes(e[3])?"space-":"")+e})),E("p([xytrbl])?(?:$|-)","padding",vi("padding")),E("-?m([xytrbl])?(?:$|-)","margin",vi("margin")),E("-?space-(x|y)(?:$|-)","space",({1:i,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[i]]:`calc(${e} * calc(1 - var(--tw-space-${i}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[i]]:`calc(${e} * var(--tw-space-${i}-reverse))`}})),x("space-(x|y)-reverse",({1:i})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"1"}})),E("w-","width"),E("min-w-","minWidth"),E("max-w-","maxWidth"),E("h-","height"),E("min-h-","minHeight"),E("max-h-","maxHeight"),E("font-","fontWeight"),E("font-","fontFamily",({_:i})=>typeof(i=Z(i))[1]=="string"?{fontFamily:et(i)}:{fontFamily:et(i[0]),...i[1]}),x("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),x("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),x("italic","fontStyle"),x("not-italic",{fontStyle:"normal"}),x("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:i,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":i)]:i,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Ct({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),E("tracking-","letterSpacing"),E("leading-","lineHeight"),x("list-(inside|outside)","listStylePosition"),E("list-","listStyleType"),x("list-","listStyleType"),E("placeholder-opacity-","placeholderOpacity",({_:i})=>({"&::placeholder":{"--tw-placeholder-opacity":i}})),fe("placeholder-",{property:"color",selector:"&::placeholder"}),x("text-(left|center|right|justify|start|end)","textAlign"),x("text-(ellipsis|clip)","textOverflow"),E("text-opacity-","textOpacity","--tw-text-opacity"),fe("text-",{property:"color"}),E("text-","fontSize",({_:i})=>typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}),E("indent-","textIndent"),x("(overline|underline|line-through)","textDecorationLine"),x("no-underline",{textDecorationLine:"none"}),E("underline-offset-","textUnderlineOffset"),fe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),E("decoration-","textDecorationThickness"),x("decoration-","textDecorationStyle"),x("(uppercase|lowercase|capitalize)","textTransform"),x("normal-case",{textTransform:"none"}),x("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),x("align-","verticalAlign"),x("whitespace-","whiteSpace"),x("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),x("break-words",{overflowWrap:"break-word"}),x("break-all",{wordBreak:"break-all"}),x("break-keep",{wordBreak:"keep-all"}),fe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),fe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),x("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:i})=>`linear-gradient(to ${Xt(i," ")},var(--tw-gradient-stops))`),fe("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-from":i.value,"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),fe("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${i.value},var(--tw-gradient-to)`})),fe("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),x("bg-(fixed|local|scroll)","backgroundAttachment"),x("bg-origin-(border|padding|content)","backgroundOrigin",({1:i})=>i+"-box"),x(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),x("bg-blend-","backgroundBlendMode"),x("bg-clip-(border|padding|content|text)","backgroundClip",({1:i})=>i+(i=="text"?"":"-box")),E("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),fe("bg-",{section:"backgroundColor"}),E("bg-","backgroundImage"),E("bg-","backgroundPosition"),x("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",fn),E("bg-","backgroundSize"),E("rounded(?:$|-)","borderRadius"),E("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:i,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[i]||[i,i];return{[`border-${Xt(t[0])}-radius`]:e,[`border-${Xt(t[1])}-radius`]:e}}),x("border-(collapse|separate)","borderCollapse"),E("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),x("border-(solid|dashed|dotted|double|none)","borderStyle"),E("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:i,_:e})=>({...Ct({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(i||"-x")]:e,["--tw-border-spacing"+(i||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),fe("border-([xytrbl])-",{section:"borderColor"},vi("border","Color")),fe("border-"),E("border-([xytrbl])(?:$|-)","borderWidth",vi("border","Width")),E("border(?:$|-)","borderWidth"),E("divide-opacity(?:$|-)","divideOpacity",({_:i})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":i}})),x("divide-(solid|dashed|dotted|double|none)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:i}})),x("divide-([xy]-reverse)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+i]:"1"}})),E("divide-([xy])(?:$|-)","divideWidth",({1:i,_:e})=>{let t={x:"lr",y:"tb"}[i];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${i}-reverse`]:"0",[`border-${Xt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${i}-reverse)))`,[`border-${Xt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${i}-reverse))`}}}),fe("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),E("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),fe("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),E("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),x("ring-inset",{"--tw-ring-inset":"inset"}),fe("ring-",{property:"--tw-ring-color"}),E("ring(?:$|-)","ringWidth",({_:i},{theme:e})=>({...Ct({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Xe(e("ringOffsetColor","","#fff")),"--tw-ring-color":Xe(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${i} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),fe("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-shadow-color":i.value,"--tw-shadow":"var(--tw-shadow-colored)"})),E("shadow(?:$|-)","boxShadow",({_:i})=>({...Ct({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":et(i),"--tw-shadow-colored":et(i).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),E("(opacity)-"),x("mix-blend-","mixBlendMode"),...lu(),...lu("backdrop-"),E("transition(?:$|-)","transitionProperty",(i,{theme:e})=>({transitionProperty:et(i),transitionTimingFunction:i._=="none"?void 0:et(e("transitionTimingFunction","")),transitionDuration:i._=="none"?void 0:et(e("transitionDuration",""))})),E("duration(?:$|-)","transitionDuration","transitionDuration",et),E("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",et),E("delay(?:$|-)","transitionDelay","transitionDelay",et),E("animate(?:$|-)","animation",(i,{theme:e,h:t,e:r})=>{let n=et(i),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=r(t(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",x("transform",to),x("transform-(cpu|gpu)",({1:i})=>({"--tw-transform":du(i=="gpu")})),E("scale(-[xy])?-","scale",({1:i,_:e})=>({["--tw-scale"+(i||"-x")]:e,["--tw-scale"+(i||"-y")]:e,...to()})),E("-?(rotate)-","rotate",eo),E("-?(translate-[xy])-","translate",eo),E("-?(skew-[xy])-","skew",eo),x("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",fn),"(appearance)-",E("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",E("(cursor)-"),"(cursor)-",x("snap-(none)","scroll-snap-type"),x("snap-(x|y|both)",({1:i})=>({...Ct({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":i+" var(--tw-scroll-snap-strictness)"})),x("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),x("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),x("snap-(normal|always)","scroll-snap-stop"),x("scroll-(auto|smooth)","scroll-behavior"),E("scroll-p([xytrbl])?(?:$|-)","padding",vi("scroll-padding")),E("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",vi("scroll-margin")),x("touch-(auto|none|manipulation)","touch-action"),x("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:i,2:e,3:t})=>({...Ct({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":i}`]:i,"touch-action":"var(--tw-touch-action)"})),x("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),x("outline",{outlineStyle:"solid"}),x("outline-(dashed|dotted|double)","outlineStyle"),E("-?(outline-offset)-"),fe("outline-",{opacityVariable:!1,opacitySection:"opacity"}),E("outline-","outlineWidth"),"(pointer-events)-",E("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:i})=>({x:"horizontal",y:"vertical"})[i]||i||"both"],x("select-(none|text|all|auto)","userSelect"),fe("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),fe("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),E("stroke-","strokeWidth"),x("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),x("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function fn(i){return(typeof i=="string"?i:i[1]).replace(/-/g," ").trim()}function ou(i){return(typeof i=="string"?i:i[1]).replace("col","column")}function Xt(i,e="-"){let t=[];for(let r of i)t.push({t:"top",r:"right",b:"bottom",l:"left"}[r]);return t.join(e)}function et(i){return i&&""+(i._||i)}function au({$$:i}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[i[3]||""]||"")+i}function vi(i,e=""){return({1:t,_:r})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...ir(i+"-"+Xt(n[0])+e,r),...ir(i+"-"+Xt(n[1])+e,r)}:ir(i+e,r)}}function lu(i=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",i&&"opacity","saturate","sepia",!i&&"drop-shadow"].filter(Boolean),t={};for(let r of e)t[`--tw-${i}${r}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...Ct(t),[`${i}filter`]:e.map(r=>`var(--tw-${i}${r})`).join(" ")},[`(${i}filter)-(none)`,x(`${i}filter`,t),...e.map(r=>E(`${r[0]=="h"?"-?":""}(${i}${r})(?:$|-)`,r,({1:n,_:s})=>({[`--tw-${n}`]:Z(s).map(o=>`${r}(${o})`).join(" "),...t})))]}function eo({1:i,_:e}){return{["--tw-"+i]:e,...to()}}function to(){return{...Ct({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":du()}),transform:"var(--tw-transform)"}}function du(i){return[i?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function uu({1:i,2:e}){return`${i} ${e} / ${i} ${e}`}function cu({1:i}){return`repeat(${i},minmax(0,1fr))`}function Ct(i){return{"@layer defaults":{"*,::before,::after":i,"::backdrop":i}}}var hu=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:i})=>`@media (orientation:${i})`],["contrast-(more|less)",({1:i})=>`@media (prefers-contrast:${i})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:i})=>`&::${i}`],["(marker|selection)",({1:i})=>`& *::${i},&::${i}`],["file","&::file-selector-button"],["(first|last|only)",({1:i})=>`&:${i}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:i,$$:e},t)=>e&&`&[${i}-${t.theme(i,e)||ot(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:i,3:e="",4:t,5:r="",6:n=e},{e:s,h:o,v:l})=>{let a=gi(r)||(t[0]=="["?t:l(t.slice(1)));return`${(a.includes("&")?a:"&"+a).replace(/&/g,`:merge(.${s(o(i+n))})`)}${i[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:i})=>`[dir="${i}"] &`],["supports-",({$$:i},e)=>{if(i&&(i=e.theme("supports",i)||ot(i,"",e)),i)return i.includes(":")||(i+=":var(--tw)"),/^\w*\s*\(/.test(i)||(i=`(${i})`),`@supports ${i.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:i},e)=>{if(i&&(i=e.theme("screens",i)||ot(i,"",e)),typeof i=="string")return`@media not all and (min-width:${i})`}],["min-",({$$:i},e)=>(i&&(i=ot(i,"",e)),i&&`@media (min-width:${i})`)],[/^\[(.+)]$/,({1:i})=>/[&@]/.test(i)&&gi(i).replace(/[}]+$/,"").split("{")]];function fu({colors:i,disablePreflight:e}={}){return{preflight:e?void 0:su,theme:{...nr,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...i}},variants:hu,rules:pu,finalize(t){return t.n&&t.d&&t.r.some(r=>/^&::(before|after)$/.test(r))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var Jd={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Yd={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Kd={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Zd={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Qd={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},eh={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},th={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},ih={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},rh={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},nh={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},sh={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},oh={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},ah={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},lh={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},uh={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},ch={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},ph={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},dh={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},hh={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fh={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},gh={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},vh={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},gu={__proto__:null,slate:Jd,gray:Yd,zinc:Kd,neutral:Zd,stone:Qd,red:eh,orange:th,amber:ih,yellow:rh,lime:nh,green:sh,emerald:oh,teal:ah,cyan:lh,sky:uh,blue:ch,indigo:ph,violet:dh,purple:hh,fuchsia:fh,pink:gh,rose:vh};function vu({disablePreflight:i}={}){return fu({colors:gu,disablePreflight:i})}function yu({className:i="prose",defaultColor:e="gray",extend:t={},colors:r={}}={}){return r={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...r,dark:r.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...r.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${i}-${s}`,(l,a)=>bu(i,o[0]=="."?"."+a.e(a.h(o.slice(1))):o,a,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${i})`,({1:s},{h:o})=>[{c:o(s)}]],[`${i}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[i+"-",({$$:s},o)=>{let l=_u(o.theme("fontSize",s));return l&&{"@layer components":l}}],[i+"-",({$$:s},o)=>n(s,o)],[i,(s,o)=>({...n(e,o),"@layer base":[mu(i,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:D(20,16),marginBottom:D(20,16),paddingLeft:D(26,16)},li:{marginTop:D(8,16),marginBottom:D(8,16)},"ol>li,ul>li":{paddingLeft:D(6,16)},">ul>li p":{marginTop:D(12,16),marginBottom:D(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:D(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:D(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:D(12,16),marginBottom:D(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:D(48,16),marginBottom:D(48,16)},blockquote:{marginTop:D(32,20),marginBottom:D(32,20),paddingLeft:D(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:D(20,16),marginBottom:D(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:D(36,16),marginTop:"0",marginBottom:D(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:D(24,16),marginTop:D(48,24),marginBottom:D(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:D(20,16),marginTop:D(32,20),marginBottom:D(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:D(24,16),marginBottom:D(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:D(32,16),marginBottom:D(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:D(14,16),lineHeight:"1.4",marginTop:D(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:D(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:D(21,24)},"h3 code":{fontSize:D(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:D(14,16),lineHeight:"1.7",marginTop:D(24,14),marginBottom:D(24,14),borderRadius:"0.375rem",paddingTop:D(12,14),paddingRight:D(16,14),paddingBottom:D(12,14),paddingLeft:D(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:D(32,16),marginBottom:D(32,16),fontSize:D(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:D(8,14),paddingBottom:D(8,14),paddingLeft:D(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:D(8,14),paddingRight:D(8,14),paddingBottom:D(8,14),paddingLeft:D(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:D(20,16),lineHeight:"1.6",marginTop:D(24,20),marginBottom:D(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),mu(i,o,t)],"@layer components":{..._u(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let l={},a={},c=(p,u,d)=>{let h=o.theme(`colors.${s}.${u}`,u);d["--tw-prose-"+p]=Xe(h);let g=d!=a&&o.d("colors",`${s}-${u}`,h);g&&(a["--tw-prose-"+p]=Xe(g))};for(let p in r){let u=r[p];p!="dark"&&u&&c(p,u,l)}for(let p in r.dark||{}){let u=r.dark[p];u&&(r.dark?c("invert-"+p,u,l):c(p,u,a))}return Object.keys(l).length?{"@layer defaults":{"&":l,[o.v("dark")]:a}}:void 0}}function mu(i,e,t){let r={};for(let n in t)r[bu(i,n,e,s=>`.${e.e(e.h(i))}${s}`)]=t[n];return r}function bu(i,e,{e:t,h:r},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",l=s,a="")=>n(`${o}:where(${l}):not(:where(.${t(r("not-"+i))} *))${a}`))}function _u(i){return i?typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}:void 0}function D(i,e){return`${(i/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var io=Qs({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[vu(),iu(),nu(),yu()]});function wu(i,e=!0){let t=function(){if(mh)try{let a=hn(new CSSStyleSheet);return a.connect=c=>{let p=ro(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,a.target]},a.disconnect=dn,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[hn(s)],l=new WeakMap;return{get target(){return o[0].target},snapshot(){let a=o.map(c=>c.snapshot());return()=>a.forEach(c=>c())},clear(){o.forEach(a=>a.clear())},destroy(){o.forEach(a=>a.destroy())},insert(a,c,p){o[0].insert(a,c,p);let u=this.target.cssRules[c];o.forEach((d,h)=>h&&d.target.insertRule(u.cssText,c))},resume(a,c){return o[0].resume(a,c)},connect(a){let c=document.createElement("style");ro(a).appendChild(c);let p=hn(c),{cssRules:u}=this.target;for(let d=0;d<u.length;d++)p.target.insertRule(u[d].cssText,d);o.push(p),l.set(a,p)},disconnect(a){let c=o.indexOf(l.get(a));c>=0&&o.splice(c,1)}}}(),r=Kl({...i,hash:i.hash??e},t),n=Zl(r);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(ro(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=r}}}}var mh=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function ro(i){return i.shadowRoot||i.attachShadow({mode:"open"})}var G=i=>wu(io)(i);var gn=class extends G(B){constructor(){super();T(this,"render",()=>L`
1
+ var Lp=Object.defineProperty;var Al=i=>{throw TypeError(i)};var Np=(i,e,t)=>e in i?Lp(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var P=(i,e,t)=>Np(i,typeof e!="symbol"?e+"":e,t),Ms=(i,e,t)=>e.has(i)||Al("Cannot "+t);var f=(i,e,t)=>(Ms(i,e,"read from private field"),t?t.call(i):e.get(i)),y=(i,e,t)=>e.has(i)?Al("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),C=(i,e,t,r)=>(Ms(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),A=(i,e,t)=>(Ms(i,e,"access private method"),t);var Il=(i,e,t,r)=>({set _(n){C(i,e,n,t)},get _(){return f(i,e,r)}});var nn=globalThis,sn=nn.ShadowRoot&&(nn.ShadyCSS===void 0||nn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ls=Symbol(),Tl=new WeakMap,er=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Ls)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(sn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Tl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Tl.set(t,e))}return e}toString(){return this.cssText}},Pl=i=>new er(typeof i=="string"?i:i+"",void 0,Ls),ht=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,s)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[s+1],i[0]);return new er(t,i,Ls)},Ns=(i,e)=>{if(sn)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=nn.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},on=sn?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Pl(t)})(i):i;var{is:Up,defineProperty:jp,getOwnPropertyDescriptor:qp,getOwnPropertyNames:Bp,getOwnPropertySymbols:Hp,getPrototypeOf:zp}=Object,an=globalThis,Rl=an.trustedTypes,Wp=Rl?Rl.emptyScript:"",Vp=an.reactiveElementPolyfillSupport,tr=(i,e)=>i,Us={toAttribute(i,e){switch(e){case Boolean:i=i?Wp:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Fl=(i,e)=>!Up(i,e),Ol={attribute:!0,type:String,converter:Us,reflect:!1,hasChanged:Fl};Symbol.metadata??=Symbol("metadata"),an.litPropertyMetadata??=new WeakMap;var ft=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ol){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&jp(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:s}=qp(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return n?.call(this)},set(o){let l=n?.call(this);s.call(this,o),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ol}static _$Ei(){if(this.hasOwnProperty(tr("elementProperties")))return;let e=zp(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(tr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tr("properties"))){let t=this.properties,r=[...Bp(t),...Hp(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(on(n))}else e!==void 0&&t.push(on(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ns(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(r.converter?.toAttribute!==void 0?r.converter:Us).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=r.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Us;this._$Em=n,this[n]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,r){if(e!==void 0){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??Fl)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[n,s]of r)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};ft.elementStyles=[],ft.shadowRootOptions={mode:"open"},ft[tr("elementProperties")]=new Map,ft[tr("finalized")]=new Map,Vp?.({ReactiveElement:ft}),(an.reactiveElementVersions??=[]).push("2.0.4");var qs=globalThis,ln=qs.trustedTypes,Dl=ln?ln.createPolicy("lit-html",{createHTML:i=>i}):void 0,Bs="$lit$",gt=`lit$${Math.random().toFixed(9).slice(2)}$`,Hs="?"+gt,Gp=`<${Hs}>`,Jt=document,rr=()=>Jt.createComment(""),nr=i=>i===null||typeof i!="object"&&typeof i!="function",zs=Array.isArray,ql=i=>zs(i)||typeof i?.[Symbol.iterator]=="function",js=`[
2
+ \f\r]`,ir=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ml=/-->/g,Ll=/>/g,Vt=RegExp(`>|${js}(?:([^\\s"'>=/]+)(${js}*=${js}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Nl=/'/g,Ul=/"/g,Bl=/^(?:script|style|textarea|title)$/i,Ws=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),L=Ws(1),yg=Ws(2),bg=Ws(3),tt=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),jl=new WeakMap,Gt=Jt.createTreeWalker(Jt,129);function Hl(i,e){if(!zs(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Dl!==void 0?Dl.createHTML(e):e}var zl=(i,e)=>{let t=i.length-1,r=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=ir;for(let l=0;l<t;l++){let a=i[l],c,d,u=-1,p=0;for(;p<a.length&&(o.lastIndex=p,d=o.exec(a),d!==null);)p=o.lastIndex,o===ir?d[1]==="!--"?o=Ml:d[1]!==void 0?o=Ll:d[2]!==void 0?(Bl.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Vt):d[3]!==void 0&&(o=Vt):o===Vt?d[0]===">"?(o=n??ir,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Vt:d[3]==='"'?Ul:Nl):o===Ul||o===Nl?o=Vt:o===Ml||o===Ll?o=ir:(o=Vt,n=void 0);let h=o===Vt&&i[l+1].startsWith("/>")?" ":"";s+=o===ir?a+Gp:u>=0?(r.push(c),a.slice(0,u)+Bs+a.slice(u)+gt+h):a+gt+(u===-2?l:h)}return[Hl(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},sr=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0,l=e.length-1,a=this.parts,[c,d]=zl(e,t);if(this.el=i.createElement(c,r),Gt.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=Gt.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(Bs)){let p=d[o++],h=n.getAttribute(u).split(gt),g=/([.?@])?(.*)/.exec(p);a.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?cn:g[1]==="?"?dn:g[1]==="@"?pn:Yt}),n.removeAttribute(u)}else u.startsWith(gt)&&(a.push({type:6,index:s}),n.removeAttribute(u));if(Bl.test(n.tagName)){let u=n.textContent.split(gt),p=u.length-1;if(p>0){n.textContent=ln?ln.emptyScript:"";for(let h=0;h<p;h++)n.append(u[h],rr()),Gt.nextNode(),a.push({type:2,index:++s});n.append(u[p],rr())}}}else if(n.nodeType===8)if(n.data===Hs)a.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(gt,u+1))!==-1;)a.push({type:7,index:s}),u+=gt.length-1}s++}}static createElement(e,t){let r=Jt.createElement("template");return r.innerHTML=e,r}};function Xt(i,e,t=i,r){if(e===tt)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,s=nr(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=Xt(i,n._$AS(i,e.values),n,r)),e}var un=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??Jt).importNode(t,!0);Gt.currentNode=n;let s=Gt.nextNode(),o=0,l=0,a=r[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new mi(s,s.nextSibling,this,e):a.type===1?c=new a.ctor(s,a.name,a.strings,this,e):a.type===6&&(c=new hn(s,this,e)),this._$AV.push(c),a=r[++l]}o!==a?.index&&(s=Gt.nextNode(),o++)}return Gt.currentNode=Jt,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},mi=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Xt(this,e,t),nr(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==tt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ql(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&nr(this._$AH)?this._$AA.nextSibling.data=e:this.T(Jt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=sr.createElement(Hl(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let s=new un(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=jl.get(e.strings);return t===void 0&&jl.set(e.strings,t=new sr(e)),t}k(e){zs(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let s of e)n===t.length?t.push(r=new i(this.O(rr()),this.O(rr()),this,this.options)):r=t[n],r._$AI(s),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Yt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=U}_$AI(e,t=this,r,n){let s=this.strings,o=!1;if(s===void 0)e=Xt(this,e,t,0),o=!nr(e)||e!==this._$AH&&e!==tt,o&&(this._$AH=e);else{let l=e,a,c;for(e=s[0],a=0;a<s.length-1;a++)c=Xt(this,l[r+a],t,a),c===tt&&(c=this._$AH[a]),o||=!nr(c)||c!==this._$AH[a],c===U?e=U:e!==U&&(e+=(c??"")+s[a+1]),this._$AH[a]=c}o&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},cn=class extends Yt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},dn=class extends Yt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},pn=class extends Yt{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=Xt(this,e,t,0)??U)===tt)return;let r=this._$AH,n=e===U&&r!==U||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==U&&(r===U||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},hn=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Xt(this,e)}},Wl={M:Bs,P:gt,A:Hs,C:1,L:zl,R:un,D:ql,V:Xt,I:mi,H:Yt,N:dn,U:pn,B:cn,F:hn},Jp=qs.litHtmlPolyfillSupport;Jp?.(sr,mi),(qs.litHtmlVersions??=[]).push("3.2.1");var Vl=(i,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let s=t?.renderBefore??null;r._$litPart$=n=new mi(e.insertBefore(rr(),s),s,void 0,t??{})}return n._$AI(i),n};var B=class extends ft{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Vl(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return tt}};B._$litElement$=!0,B.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:B});var Xp=globalThis.litElementPolyfillSupport;Xp?.({LitElement:B});(globalThis.litElementVersions??=[]).push("4.1.1");function to(i){return[...i.v,(i.i?"!":"")+i.n].join(":")}function Yp(i,e=","){return i.map(to).join(e)}var Ql=typeof CSS<"u"&&CSS.escape||(i=>i.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function fn(i){for(var e=9,t=i.length;t--;)e=Math.imul(e^i.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function mn(i,e="@media "){return e+Z(i).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(r=>`(${r}-width:${t[r]})`).join(" and "))).join(",")}function Z(i=[]){return Array.isArray(i)?i:i==null?[]:[i]}function Gl(i){return i}function _n(){}var ge={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function eu(i){return i.match(/[-=:;]/g)?.length||0}function Ys(i){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(i)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(eu(i),15)<<18}var Kp=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function io({n:i,i:e,v:t=[]},r,n,s){i&&(i=to({n:i,i:e,v:t})),s=[...Z(s)];for(let l of t){let a=r.theme("screens",l);for(let c of Z(a&&mn(a)||r.v(l))){var o;s.push(c),n|=a?67108864|Ys(c):l=="dark"?1073741824:c[0]=="@"?Ys(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Kp.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:i,p:n,r:s,i:e}}var tu=new Map;function Ks(i){if(i.d){let e=[],t=Vs(i.r.reduce((r,n)=>n[0]=="@"?(e.push(n),r):n?Vs(r,s=>Vs(n,o=>{let l=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(l){let a=s.indexOf(l[1]);return~a?s.slice(0,a)+l[0]+s.slice(a+l[1].length):Gs(s,o)}return Gs(o,s)})):r,"&"),r=>Gs(r,i.n?"."+Ql(i.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((r,n)=>n+"{"+r+"}",i.d)}}function Vs(i,e){return i.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,r,n)=>e(r)+n)}function Gs(i,e){return i.replace(/&/g,e)}var Jl=new Intl.Collator("en",{numeric:!0});function iu(i,e){for(var t=0,r=i.length;t<r;){let n=r+t>>1;0>=ru(i[n],e)?t=n+1:r=n}return r}function ru(i,e){let t=i.p&ge.o;return t==(e.p&ge.o)&&(t==ge.b||t==ge.o)?0:i.p-e.p||i.o-e.o||Jl.compare(Xl(i.n),Xl(e.n))||Jl.compare(Yl(i.n),Yl(e.n))}function Xl(i){return(i||"").split(/:/).pop().split("/").pop()||"\0"}function Yl(i){return(i||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Js(i,e){return Math.round(parseInt(i,16)*e)}function Ye(i,e={}){if(typeof i=="function")return i(e);let{opacityValue:t="1",opacityVariable:r}=e,n=r?`var(${r})`:t;if(i.includes("<alpha-value>"))return i.replace("<alpha-value>",n);if(i[0]=="#"&&(i.length==4||i.length==7)){let s=(i.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Js(i.substr(1,s),o),Js(i.substr(1+s,s),o),Js(i.substr(1+2*s,s),o),n]})`}return n=="1"?i:n=="0"?"#0000":i.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function nu(i,e,t,r,n=[]){return function s(o,{n:l,p:a,r:c=[],i:d},u){let p=[],h="",g=0,m=0;for(let b in o||{}){var k,w;let O=o[b];if(b[0]=="@"){if(!O)continue;if(b[1]=="a"){p.push(...no(l,a,vn(""+O),u,a,c,d,!0));continue}if(b[1]=="l"){for(let D of Z(O))p.push(...s(D,{n:l,p:(k=ge[b[7]],a&~ge.o|k),r:b[7]=="d"?[]:c,i:d},u));continue}if(b[1]=="i"){p.push(...Z(O).map(D=>({p:-1,o:0,r:[],d:b+" "+D})));continue}if(b[1]=="k"){p.push({p:ge.d,o:0,r:[b],d:s(O,{p:ge.d},u).map(Ks).join("")});continue}if(b[1]=="f"){p.push(...Z(O).map(D=>({p:ge.d,o:0,r:[b],d:s(D,{p:ge.d},u).map(Ks).join("")})));continue}}if(typeof O!="object"||Array.isArray(O))b=="label"&&O?l=O+fn(JSON.stringify([a,d,o])):(O||O===0)&&(b=b.replace(/[A-Z]/g,D=>"-"+D.toLowerCase()),m+=1,g=Math.max(g,(w=b)[0]=="-"?0:eu(w)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(w)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+Z(O).map(D=>u.s(b,ro(""+D,u.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let D=a;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(z,X)=>{let W=u.theme("screens",X);return W?(D|=67108864,mn(W,"")):z}),D|=Ys(b)),p.push(...s(O,{n:l,p:D,r:[...c,b],i:d},u))}else p.push(...s(O,{p:a,r:[...c,b]},u))}return p.unshift({n:l,p:a,o:Math.max(0,15-m)+1.5*Math.min(g||15,15),r:c,d:h}),p.sort(ru)}(i,io(e,t,r,n),t)}function ro(i,e){return i.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,r,n,s,o="")=>{let l=e(n,o);return typeof l=="function"&&/color|fill|stroke/i.test(n)?Ye(l):""+Z(l).filter(a=>Object(a)!==a)})}function su(i,e){let t,r=[];for(let n of i)n.d&&n.n?t?.p==n.p&&""+t.r==""+n.r?(t.c=[t.c,n.c].filter(Boolean).join(" "),t.d=t.d+";"+n.d):r.push(t={...n,n:n.n&&e}):r.push({...n,n:n.n&&e});return r}function gn(i,e,t=ge.u,r,n){let s=[];for(let o of i)for(let l of function(a,c,d,u,p){a={...a,i:a.i||p};let h=function(g,m){let k=tu.get(g.n);return k?k(g,m):m.r(g.n,g.v[0]=="dark")}(a,c);return h?typeof h=="string"?({r:u,p:d}=io(a,c,d,u),su(gn(vn(h),c,d,u,a.i),a.n)):Array.isArray(h)?h.map(g=>{var m,k;return{o:0,...g,r:[...Z(u),...Z(g.r)],p:(m=d,k=g.p??d,m&~ge.o|k)}}):nu(h,a,c,d,u):[{c:to(a),p:0,o:0,r:[]}]}(o,e,t,r,n))s.splice(iu(s,l),0,l);return s}function no(i,e,t,r,n,s,o,l){return su((l?t.flatMap(a=>gn([a],r,n,s,o)):gn(t,r,n,s,o)).map(a=>a.p&ge.o&&(a.n||e==ge.b)?{...a,p:a.p&~ge.o|e,o:0}:a),i)}function Zp(i,e,t,r){var n;return n=(s,o)=>{let{n:l,p:a,r:c,i:d}=io(s,o,e);return t&&no(l,e,t,o,a,c,d,r)},tu.set(i,n),i}function Xs(i,e,t){if(i[i.length-1]!="("){let r=[],n=!1,s=!1,o="";for(let l of i)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),n=!n),l.endsWith(":")){r[l=="dark:"?"unshift":"push"](l.slice(0,-1));continue}l[0]=="-"&&(l=l.slice(1),s=!s),l.endsWith("-")&&(l=l.slice(0,-1)),l&&l!="&"&&(o+=(o&&"-")+l)}o&&(s&&(o="-"+o),e[0].push({n:o,v:r.filter(Qp),i:n}))}}function Qp(i,e,t){return t.indexOf(i)==e}var Kl=new Map;function vn(i){let e=Kl.get(i);if(!e){let t=[],r=[[]],n=0,s=0,o=null,l=0,a=(c,d=0)=>{n!=l&&(t.push(i.slice(n,l+d)),c&&Xs(t,r)),n=l+1};for(;l<i.length;l++){let c=i[l];if(s)i[l-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)i[l-1]!="\\"&&o.test(i.slice(l))&&(o=null,n=l+RegExp.lastMatch.length);else if(c=="/"&&i[l-1]!="\\"&&(i[l+1]=="*"||i[l+1]=="/"))o=i[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")a(),t.push(c);else if(c==":")i[l+1]!=":"&&a(!1,1);else if(/[\s,)]/.test(c)){a(!0);let d=t.lastIndexOf("(");if(c==")"){let u=t[d-1];if(/[~@]$/.test(u)){let p=r.shift();t.length=d,Xs([...t,"#"],r);let{v:h}=r[0].pop();for(let g of p)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);Xs([...t,Zp(u.length>1?u.slice(0,-1)+fn(JSON.stringify([u,p])):u+"("+Yp(p)+")",ge.a,p,/@$/.test(u))],r)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(c)&&i[l+1]=="("&&r.unshift([])}a(!0),Kl.set(i,e=r[0])}return e}function x(i,e,t){return[i,Zs(e,t)]}function Zs(i,e){return typeof i=="function"?i:typeof i=="string"&&/^[\w-]+$/.test(i)?(t,r)=>({[i]:e?e(t,r):Qs(t,1)}):t=>i||{[t[1]]:Qs(t,2)}}function Qs(i,e,t=i.slice(e).find(Boolean)||i.$$||i.input){return i.input[0]=="-"?`calc(${t} * -1)`:t}function E(i,e,t,r){return[i,so(e,t,r)]}function so(i,e,t){let r=typeof e=="string"?(n,s)=>({[e]:t?t(n,s):n._}):e||(({1:n,_:s},o,l)=>({[n||l]:s}));return(n,s)=>{let o=ou(i||n[1]),l=s.theme(o,n.$$)??lt(n.$$,o,s);if(l!=null)return n._=Qs(n,0,l),r(n,s,o)}}function ve(i,e={},t){return[i,eh(e,t)]}function eh(i={},e){return(t,r)=>{let{section:n=ou(t[0]).replace("-","")+"Color"}=i,[s,o]=th(t.$$);if(!s)return;let l=r.theme(n,s)||lt(s,n,r);if(!l||typeof l=="object")return;let{opacityVariable:a=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:u}=i,p=r.theme(c,o||"DEFAULT")||o&&lt(o,c,r),h=e||(({_:m})=>{let k=or(d,m);return u?{[u]:k}:k});t._={value:Ye(l,{opacityVariable:a||void 0,opacityValue:p||void 0}),color:m=>Ye(l,m),opacityVariable:a||void 0,opacityValue:p||void 0};let g=h(t,r);if(!t.dark){let m=r.d(n,s,l);m&&m!==l&&(t._={value:Ye(m,{opacityVariable:a||void 0,opacityValue:p||"1"}),color:k=>Ye(m,k),opacityVariable:a||void 0,opacityValue:p||void 0},g={"&":g,[r.v("dark")]:h(t,r)})}return g}}function th(i){return(i.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function or(i,e){let t={};return typeof e=="string"?t[i]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[i]=e.value),t}function lt(i,e,t){if(i[0]=="["&&i.slice(-1)=="]"){if(i=_i(ro(i.slice(1,-1),t.theme)),!e)return i;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(i)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(i))||/image/i.test(e)&&!(/^image:/.test(i)||/^[a-z-]+\(/.test(i))||/weight/i.test(e)&&!(/^(number|any):/.test(i)||/^\d+$/.test(i))||/position/i.test(e)&&/^(length|size):/.test(i)))return i.replace(/^[a-z-]+:/,"")}}function ou(i){return i.replace(/-./g,e=>e[1].toUpperCase())}function _i(i){return i.includes("url(")?i.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",r,n="")=>_i(t)+r+_i(n)):i.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function oo({presets:i=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Z(e.variants),rules:Z(e.rules),ignorelist:Z(e.ignorelist),hash:void 0,stringify:(r,n)=>r+":"+n,finalize:[]};for(let r of Z([...i,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Z(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:l,variants:a,rules:c,ignorelist:d,hash:u=t.hash,stringify:p=t.stringify,finalize:h}=typeof r=="function"?r(t):r;t={preflight:t.preflight!==!1&&n!==!1&&[...t.preflight,...Z(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Z(a)],rules:[...t.rules,...Z(c)],ignorelist:[...t.ignorelist,...Z(d)],hash:u,stringify:p,finalize:[...t.finalize,...Z(h)]}}return t}function Zl(i,e,t,r,n,s){for(let o of e){let l=t.get(o);l||t.set(o,l=r(o));let a=l(i,n,s);if(a)return a}}function ih(i){var e;return eo(i[0],typeof(e=i[1])=="function"?e:()=>e)}function rh(i){var e,t;return Array.isArray(i)?eo(i[0],Zs(i[1],i[2])):eo(i,Zs(e,t))}function eo(i,e){return au(i,(t,r,n,s)=>{let o=r.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,n)})}function au(i,e){let t=Z(i).map(nh);return(r,n,s)=>{for(let o of t){let l=e(r,o,n,s);if(l)return l}}}function nh(i){return typeof i=="string"?RegExp("^"+i+(i.includes("$")||i.slice(-1)=="-"?"":"$")):i}function lu(i,e){let t=oo(i),r=function({theme:a,darkMode:c,darkColor:d=_n,variants:u,rules:p,hash:h,stringify:g,ignorelist:m,finalize:k}){let w=new Map,b=new Map,O=new Map,D=new Map,z=au(m,(R,j)=>j.test(R));u.push(["dark",Array.isArray(c)||c=="class"?`${Z(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let X=typeof h=="function"?R=>h(R,fn):h?fn:Gl;X!==Gl&&k.push(R=>({...R,n:R.n&&X(R.n),d:R.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(j,J)=>"--"+X(J).replace("#",""))}));let W={theme:function({extend:R={},...j}){let J={},He={get colors(){return _e("colors")},theme:_e,negative(){return{}},breakpoints(Y){let ie={};for(let de in Y)typeof Y[de]=="string"&&(ie["screen-"+de]=Y[de]);return ie}};return _e;function _e(Y,ie,de,Ne){if(Y){if({1:Y,2:Ne}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Y)||[,Y],/[.[]/.test(Y)){let Ae=[];Y.replace(/\[([^\]]+)\]|([^.[]+)/g,(se,ye,Re=ye)=>Ae.push(Re)),Y=Ae.shift(),de=ie,ie=Ae.join("-")}let ae=J[Y]||Object.assign(Object.assign(J[Y]={},Xe(j,Y)),Xe(R,Y));if(ie==null)return ae;ie||(ie="DEFAULT");let $e=ae[ie]??ie.split("-").reduce((Ae,se)=>Ae?.[se],ae)??de;return Ne?Ye($e,{opacityValue:ro(Ne,_e)}):$e}let ze={};for(let ae of[...Object.keys(j),...Object.keys(R)])ze[ae]=_e(ae);return ze}function Xe(Y,ie){let de=Y[ie];return typeof de=="function"&&(de=de(He)),de&&/color|fill|stroke/i.test(ie)?function Ne(ze,ae=[]){let $e={};for(let Ae in ze){let se=ze[Ae],ye=[...ae,Ae];$e[ye.join("-")]=se,Ae=="DEFAULT"&&(ye=ae,$e[ae.join("-")]=se),typeof se=="object"&&Object.assign($e,Ne(se,ye))}return $e}(de):de}}(a),e:Ql,h:X,s(R,j){return g(R,j,W)},d(R,j,J){return d(R,j,W,J)},v(R){return w.has(R)||w.set(R,Zl(R,u,b,ih,W)||"&:"+R),w.get(R)},r(R,j){let J=JSON.stringify([R,j]);return O.has(J)||O.set(J,!z(R,W)&&Zl(R,p,D,rh,W,j)),O.get(J)},f(R){return k.reduce((j,J)=>J(j,W),R)}};return W}(t),n=new Map,s=[],o=new Set;e.resume(a=>n.set(a,a),(a,c)=>{e.insert(a,s.length,c),s.push(c),o.add(a)});function l(a){let c=r.f(a),d=Ks(c);if(d&&!o.has(d)){o.add(d);let u=iu(s,a);e.insert(d,u,a),s.splice(u,0,a)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let u of Z(t.preflight))typeof u=="function"&&(u=u(r)),u&&(typeof u=="string"?no("",ge.b,vn(u),r,ge.b,[],!1,!0):nu(u,{},r,ge.b)).forEach(l);c=""+c;let d=n.get(c);if(!d){let u=new Set;for(let p of gn(vn(c),r))u.add(p.c).add(l(p));d=[...u].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:r.theme,config:t,snapshot(){let a=e.snapshot(),c=new Set(o),d=new Map(n),u=[...s];return()=>{a(),o=c,n=d,s=u}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function sh(i,e){return i!=e&&""+i.split(" ").sort()!=""+e.split(" ").sort()}function uu(i){let e=new MutationObserver(t);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),r(n),t([{target:n,type:""}])},disconnect(){e.disconnect()}};function t(n){for(let{type:s,target:o}of n)if(s[0]=="a")r(o);else for(let l of o.querySelectorAll("[class]"))r(l);e.takeRecords()}function r(n){let s,o=n.getAttribute?.("class");o&&sh(o,s=i(o))&&n.setAttribute("class",s)}}function oh(i){let e=document.querySelector(i||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function yn(i){let e=i?.cssRules?i:(i&&typeof i!="string"?i:oh(i)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,r=>r.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,r){try{e.insertRule(t,r)}catch{e.insertRule(":root{}",r)}},resume:_n}}var ah=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function cu(i){return ah.get(i)}function du(i){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(i);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function pu(i,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(i);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var lh=[["-webkit-",1],["-moz-",2],["-ms-",4]];function hu(){return({stringify:i})=>({stringify(e,t,r){let n="",s=cu(e);s&&(n+=i(s,t,r)+";");let o=du(e),l=pu(e,t);for(let a of lh)o&a[1]&&(n+=i(a[0]+e,t,r)+";"),l&a[1]&&(n+=i(e,a[0]+t,r)+";");return n+i(e,t,r)}})}function gu(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",so("lineClamp",({_:i})=>fu(i))],["line-clamp-(\\d+)",({1:i})=>fu(i)]]}}function fu(i){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${i}`}}var lr={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...We(4,"rem",4,.5,.5),...We(12,"rem",4,5),14:"3.5rem",...We(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:V("blur"),backdropBrightness:V("brightness"),backdropContrast:V("contrast"),backdropGrayscale:V("grayscale"),backdropHueRotate:V("hueRotate"),backdropInvert:V("invert"),backdropOpacity:V("opacity"),backdropSaturate:V("saturate"),backdropSepia:V("sepia"),backgroundColor:V("colors"),backgroundImage:{none:"none"},backgroundOpacity:V("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...We(200,"",100,0,50),...We(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:i})=>({DEFAULT:i("colors.gray.200","currentColor"),...i("colors")}),borderOpacity:V("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:V("spacing"),borderWidth:{DEFAULT:"1px",...Ke(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:V("colors"),caretColor:V("colors"),accentColor:({theme:i})=>({auto:"auto",...i("colors")}),contrast:{...We(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:V("borderColor"),divideOpacity:V("borderOpacity"),divideWidth:V("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:i})=>({...i("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:i})=>({...i("spacing"),...ar(2,6),...ar(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:V("spacing"),gradientColorStops:V("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:i})=>({...i("spacing"),...ar(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:i})=>({...i("spacing"),...ar(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...We(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:i})=>({auto:"auto",...i("spacing")}),maxHeight:({theme:i})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...i("spacing")}),maxWidth:({theme:i,breakpoints:e})=>({...e(i("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...We(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:V("spacing"),placeholderColor:V("colors"),placeholderOpacity:V("opacity"),outlineColor:V("colors"),outlineOffset:Ke(8,"px"),outlineWidth:Ke(8,"px"),ringColor:({theme:i})=>({...i("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:V("colors"),ringOffsetWidth:Ke(8,"px"),ringOpacity:({theme:i})=>({...i("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ke(8,"px")},rotate:{...Ke(2,"deg"),...Ke(12,"deg",3),...Ke(180,"deg",45)},saturate:We(200,"",100,0,50),scale:{...We(150,"",100,0,50),...We(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:V("spacing"),scrollPadding:V("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ke(2,"deg"),...Ke(12,"deg",3)},space:V("spacing"),stroke:({theme:i})=>({...i("colors"),none:"none"}),strokeWidth:We(2),textColor:V("colors"),textDecorationColor:V("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ke(8,"px")},textUnderlineOffset:{auto:"auto",...Ke(8,"px")},textIndent:V("spacing"),textOpacity:V("opacity"),transitionDuration:({theme:i})=>({...i("durations"),DEFAULT:"150ms"}),transitionDelay:V("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:i})=>({...i("spacing"),...ar(2,4),full:"100%"}),width:({theme:i})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...i("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...We(50,"",1,0,10),auto:"auto"}};function ar(i,e){let t={};do for(var r=1;r<i;r++)t[`${r}/${i}`]=Number((r/i*100).toFixed(6))+"%";while(++i<=e);return t}function Ke(i,e,t=0){let r={};for(;t<=i;t=2*t||1)r[t]=t+e;return r}function We(i,e="",t=1,r=0,n=1,s={}){for(;r<=i;r+=n)s[r]=r/t+e;return s}function V(i){return({theme:e})=>e(i)}var vu={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${lr.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${lr.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var xu=[x("\\[([-\\w]+):(.+)]",({1:i,2:e},t)=>({"@layer overrides":{"&":{[i]:lt(`[${e}]`,"",t)}}})),x("(group|peer)([~/][^-[]+)?",({input:i},{h:e})=>[{c:e(i)}]),E("aspect-","aspectRatio"),x("container",(i,{theme:e})=>{let{screens:t=e("screens"),center:r,padding:n}=e("container"),s={width:"100%",marginRight:r&&"auto",marginLeft:r&&"auto",...o("xs")};for(let l in t){let a=t[l];typeof a=="string"&&(s[mn(a)]={"&":{maxWidth:a,...o(l)}})}return s;function o(l){let a=n&&(typeof n=="string"?n:n[l]||n.DEFAULT);if(a)return{paddingRight:a,paddingLeft:a}}}),E("content-","content",({_:i})=>({"--tw-content":i,content:"var(--tw-content)"})),x("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),x("box-(border|content)","boxSizing",({1:i})=>i+"-box"),x("hidden",{display:"none"}),x("table-(auto|fixed)","tableLayout"),x(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",x("isolate","isolation"),x("object-(contain|cover|fill|none|scale-down)","objectFit"),E("object-","objectPosition"),x("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",bn),x("overscroll(-[xy])?-(auto|contain|none)",({1:i="",2:e})=>({["overscroll-behavior"+i]:e})),x("(static|fixed|absolute|relative|sticky)","position"),E("-?inset(-[xy])?(?:$|-)","inset",({1:i,_:e})=>({top:i!="-x"&&e,right:i!="-y"&&e,bottom:i!="-x"&&e,left:i!="-y"&&e})),E("-?(top|bottom|left|right)(?:$|-)","inset"),x("(visible|collapse)","visibility"),x("invisible",{visibility:"hidden"}),E("-?z-","zIndex"),x("flex-((row|col)(-reverse)?)","flexDirection",mu),x("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),E("(flex-(?:grow|shrink))(?:$|-)"),E("(flex)-"),E("grow(?:$|-)","flexGrow"),E("shrink(?:$|-)","flexShrink"),E("basis-","flexBasis"),E("-?(order)-"),"-?(order)-(\\d+)",E("grid-cols-","gridTemplateColumns"),x("grid-cols-(\\d+)","gridTemplateColumns",wu),E("col-","gridColumn"),x("col-(span)-(\\d+)","gridColumn",bu),E("col-start-","gridColumnStart"),x("col-start-(auto|\\d+)","gridColumnStart"),E("col-end-","gridColumnEnd"),x("col-end-(auto|\\d+)","gridColumnEnd"),E("grid-rows-","gridTemplateRows"),x("grid-rows-(\\d+)","gridTemplateRows",wu),E("row-","gridRow"),x("row-(span)-(\\d+)","gridRow",bu),E("row-start-","gridRowStart"),x("row-start-(auto|\\d+)","gridRowStart"),E("row-end-","gridRowEnd"),x("row-end-(auto|\\d+)","gridRowEnd"),x("grid-flow-((row|col)(-dense)?)","gridAutoFlow",i=>bn(mu(i))),x("grid-flow-(dense)","gridAutoFlow"),E("auto-cols-","gridAutoColumns"),E("auto-rows-","gridAutoRows"),E("gap-x(?:$|-)","gap","columnGap"),E("gap-y(?:$|-)","gap","rowGap"),E("gap(?:$|-)","gap"),"(justify-(?:items|self))-",x("justify-","justifyContent",_u),x("(content|items|self)-",i=>({["align-"+i[1]]:_u(i)})),x("(place-(content|items|self))-",({1:i,$$:e})=>({[i]:("wun".includes(e[3])?"space-":"")+e})),E("p([xytrbl])?(?:$|-)","padding",yi("padding")),E("-?m([xytrbl])?(?:$|-)","margin",yi("margin")),E("-?space-(x|y)(?:$|-)","space",({1:i,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[i]]:`calc(${e} * calc(1 - var(--tw-space-${i}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[i]]:`calc(${e} * var(--tw-space-${i}-reverse))`}})),x("space-(x|y)-reverse",({1:i})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"1"}})),E("w-","width"),E("min-w-","minWidth"),E("max-w-","maxWidth"),E("h-","height"),E("min-h-","minHeight"),E("max-h-","maxHeight"),E("font-","fontWeight"),E("font-","fontFamily",({_:i})=>typeof(i=Z(i))[1]=="string"?{fontFamily:it(i)}:{fontFamily:it(i[0]),...i[1]}),x("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),x("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),x("italic","fontStyle"),x("not-italic",{fontStyle:"normal"}),x("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:i,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":i)]:i,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...It({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),E("tracking-","letterSpacing"),E("leading-","lineHeight"),x("list-(inside|outside)","listStylePosition"),E("list-","listStyleType"),x("list-","listStyleType"),E("placeholder-opacity-","placeholderOpacity",({_:i})=>({"&::placeholder":{"--tw-placeholder-opacity":i}})),ve("placeholder-",{property:"color",selector:"&::placeholder"}),x("text-(left|center|right|justify|start|end)","textAlign"),x("text-(ellipsis|clip)","textOverflow"),E("text-opacity-","textOpacity","--tw-text-opacity"),ve("text-",{property:"color"}),E("text-","fontSize",({_:i})=>typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}),E("indent-","textIndent"),x("(overline|underline|line-through)","textDecorationLine"),x("no-underline",{textDecorationLine:"none"}),E("underline-offset-","textUnderlineOffset"),ve("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),E("decoration-","textDecorationThickness"),x("decoration-","textDecorationStyle"),x("(uppercase|lowercase|capitalize)","textTransform"),x("normal-case",{textTransform:"none"}),x("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),x("align-","verticalAlign"),x("whitespace-","whiteSpace"),x("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),x("break-words",{overflowWrap:"break-word"}),x("break-all",{wordBreak:"break-all"}),x("break-keep",{wordBreak:"keep-all"}),ve("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ve("accent-",{opacityVariable:!1,opacitySection:"opacity"}),x("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:i})=>`linear-gradient(to ${Kt(i," ")},var(--tw-gradient-stops))`),ve("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-from":i.value,"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),ve("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-gradient-to":i.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${i.value},var(--tw-gradient-to)`})),ve("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),x("bg-(fixed|local|scroll)","backgroundAttachment"),x("bg-origin-(border|padding|content)","backgroundOrigin",({1:i})=>i+"-box"),x(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),x("bg-blend-","backgroundBlendMode"),x("bg-clip-(border|padding|content|text)","backgroundClip",({1:i})=>i+(i=="text"?"":"-box")),E("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ve("bg-",{section:"backgroundColor"}),E("bg-","backgroundImage"),E("bg-","backgroundPosition"),x("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",bn),E("bg-","backgroundSize"),E("rounded(?:$|-)","borderRadius"),E("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:i,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[i]||[i,i];return{[`border-${Kt(t[0])}-radius`]:e,[`border-${Kt(t[1])}-radius`]:e}}),x("border-(collapse|separate)","borderCollapse"),E("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),x("border-(solid|dashed|dotted|double|none)","borderStyle"),E("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:i,_:e})=>({...It({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(i||"-x")]:e,["--tw-border-spacing"+(i||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),ve("border-([xytrbl])-",{section:"borderColor"},yi("border","Color")),ve("border-"),E("border-([xytrbl])(?:$|-)","borderWidth",yi("border","Width")),E("border(?:$|-)","borderWidth"),E("divide-opacity(?:$|-)","divideOpacity",({_:i})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":i}})),x("divide-(solid|dashed|dotted|double|none)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:i}})),x("divide-([xy]-reverse)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+i]:"1"}})),E("divide-([xy])(?:$|-)","divideWidth",({1:i,_:e})=>{let t={x:"lr",y:"tb"}[i];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${i}-reverse`]:"0",[`border-${Kt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${i}-reverse)))`,[`border-${Kt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${i}-reverse))`}}}),ve("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),E("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ve("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),E("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),x("ring-inset",{"--tw-ring-inset":"inset"}),ve("ring-",{property:"--tw-ring-color"}),E("ring(?:$|-)","ringWidth",({_:i},{theme:e})=>({...It({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Ye(e("ringOffsetColor","","#fff")),"--tw-ring-color":Ye(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${i} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),ve("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-shadow-color":i.value,"--tw-shadow":"var(--tw-shadow-colored)"})),E("shadow(?:$|-)","boxShadow",({_:i})=>({...It({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":it(i),"--tw-shadow-colored":it(i).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),E("(opacity)-"),x("mix-blend-","mixBlendMode"),...yu(),...yu("backdrop-"),E("transition(?:$|-)","transitionProperty",(i,{theme:e})=>({transitionProperty:it(i),transitionTimingFunction:i._=="none"?void 0:it(e("transitionTimingFunction","")),transitionDuration:i._=="none"?void 0:it(e("transitionDuration",""))})),E("duration(?:$|-)","transitionDuration","transitionDuration",it),E("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",it),E("delay(?:$|-)","transitionDelay","transitionDelay",it),E("animate(?:$|-)","animation",(i,{theme:e,h:t,e:r})=>{let n=it(i),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=r(t(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",x("transform",lo),x("transform-(cpu|gpu)",({1:i})=>({"--tw-transform":ku(i=="gpu")})),E("scale(-[xy])?-","scale",({1:i,_:e})=>({["--tw-scale"+(i||"-x")]:e,["--tw-scale"+(i||"-y")]:e,...lo()})),E("-?(rotate)-","rotate",ao),E("-?(translate-[xy])-","translate",ao),E("-?(skew-[xy])-","skew",ao),x("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",bn),"(appearance)-",E("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",E("(cursor)-"),"(cursor)-",x("snap-(none)","scroll-snap-type"),x("snap-(x|y|both)",({1:i})=>({...It({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":i+" var(--tw-scroll-snap-strictness)"})),x("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),x("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),x("snap-(normal|always)","scroll-snap-stop"),x("scroll-(auto|smooth)","scroll-behavior"),E("scroll-p([xytrbl])?(?:$|-)","padding",yi("scroll-padding")),E("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",yi("scroll-margin")),x("touch-(auto|none|manipulation)","touch-action"),x("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:i,2:e,3:t})=>({...It({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":i}`]:i,"touch-action":"var(--tw-touch-action)"})),x("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),x("outline",{outlineStyle:"solid"}),x("outline-(dashed|dotted|double)","outlineStyle"),E("-?(outline-offset)-"),ve("outline-",{opacityVariable:!1,opacitySection:"opacity"}),E("outline-","outlineWidth"),"(pointer-events)-",E("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:i})=>({x:"horizontal",y:"vertical"})[i]||i||"both"],x("select-(none|text|all|auto)","userSelect"),ve("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ve("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),E("stroke-","strokeWidth"),x("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),x("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function bn(i){return(typeof i=="string"?i:i[1]).replace(/-/g," ").trim()}function mu(i){return(typeof i=="string"?i:i[1]).replace("col","column")}function Kt(i,e="-"){let t=[];for(let r of i)t.push({t:"top",r:"right",b:"bottom",l:"left"}[r]);return t.join(e)}function it(i){return i&&""+(i._||i)}function _u({$$:i}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[i[3]||""]||"")+i}function yi(i,e=""){return({1:t,_:r})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...or(i+"-"+Kt(n[0])+e,r),...or(i+"-"+Kt(n[1])+e,r)}:or(i+e,r)}}function yu(i=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",i&&"opacity","saturate","sepia",!i&&"drop-shadow"].filter(Boolean),t={};for(let r of e)t[`--tw-${i}${r}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...It(t),[`${i}filter`]:e.map(r=>`var(--tw-${i}${r})`).join(" ")},[`(${i}filter)-(none)`,x(`${i}filter`,t),...e.map(r=>E(`${r[0]=="h"?"-?":""}(${i}${r})(?:$|-)`,r,({1:n,_:s})=>({[`--tw-${n}`]:Z(s).map(o=>`${r}(${o})`).join(" "),...t})))]}function ao({1:i,_:e}){return{["--tw-"+i]:e,...lo()}}function lo(){return{...It({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":ku()}),transform:"var(--tw-transform)"}}function ku(i){return[i?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function bu({1:i,2:e}){return`${i} ${e} / ${i} ${e}`}function wu({1:i}){return`repeat(${i},minmax(0,1fr))`}function It(i){return{"@layer defaults":{"*,::before,::after":i,"::backdrop":i}}}var Su=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:i})=>`@media (orientation:${i})`],["contrast-(more|less)",({1:i})=>`@media (prefers-contrast:${i})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:i})=>`&::${i}`],["(marker|selection)",({1:i})=>`& *::${i},&::${i}`],["file","&::file-selector-button"],["(first|last|only)",({1:i})=>`&:${i}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:i,$$:e},t)=>e&&`&[${i}-${t.theme(i,e)||lt(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:i,3:e="",4:t,5:r="",6:n=e},{e:s,h:o,v:l})=>{let a=_i(r)||(t[0]=="["?t:l(t.slice(1)));return`${(a.includes("&")?a:"&"+a).replace(/&/g,`:merge(.${s(o(i+n))})`)}${i[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:i})=>`[dir="${i}"] &`],["supports-",({$$:i},e)=>{if(i&&(i=e.theme("supports",i)||lt(i,"",e)),i)return i.includes(":")||(i+=":var(--tw)"),/^\w*\s*\(/.test(i)||(i=`(${i})`),`@supports ${i.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:i},e)=>{if(i&&(i=e.theme("screens",i)||lt(i,"",e)),typeof i=="string")return`@media not all and (min-width:${i})`}],["min-",({$$:i},e)=>(i&&(i=lt(i,"",e)),i&&`@media (min-width:${i})`)],[/^\[(.+)]$/,({1:i})=>/[&@]/.test(i)&&_i(i).replace(/[}]+$/,"").split("{")]];function Eu({colors:i,disablePreflight:e}={}){return{preflight:e?void 0:vu,theme:{...lr,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...i}},variants:Su,rules:xu,finalize(t){return t.n&&t.d&&t.r.some(r=>/^&::(before|after)$/.test(r))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var uh={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},ch={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},dh={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},ph={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},hh={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},fh={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},gh={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},vh={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},mh={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},_h={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},yh={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},bh={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},wh={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},xh={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},kh={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Sh={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Eh={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Ch={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},$h={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Ah={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Ih={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Th={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Cu={__proto__:null,slate:uh,gray:ch,zinc:dh,neutral:ph,stone:hh,red:fh,orange:gh,amber:vh,yellow:mh,lime:_h,green:yh,emerald:bh,teal:wh,cyan:xh,sky:kh,blue:Sh,indigo:Eh,violet:Ch,purple:$h,fuchsia:Ah,pink:Ih,rose:Th};function $u({disablePreflight:i}={}){return Eu({colors:Cu,disablePreflight:i})}function Tu({className:i="prose",defaultColor:e="gray",extend:t={},colors:r={}}={}){return r={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...r,dark:r.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...r.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${i}-${s}`,(l,a)=>Pu(i,o[0]=="."?"."+a.e(a.h(o.slice(1))):o,a,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${i})`,({1:s},{h:o})=>[{c:o(s)}]],[`${i}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[i+"-",({$$:s},o)=>{let l=Iu(o.theme("fontSize",s));return l&&{"@layer components":l}}],[i+"-",({$$:s},o)=>n(s,o)],[i,(s,o)=>({...n(e,o),"@layer base":[Au(i,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:M(20,16),marginBottom:M(20,16),paddingLeft:M(26,16)},li:{marginTop:M(8,16),marginBottom:M(8,16)},"ol>li,ul>li":{paddingLeft:M(6,16)},">ul>li p":{marginTop:M(12,16),marginBottom:M(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:M(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:M(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:M(12,16),marginBottom:M(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:M(48,16),marginBottom:M(48,16)},blockquote:{marginTop:M(32,20),marginBottom:M(32,20),paddingLeft:M(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:M(20,16),marginBottom:M(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:M(36,16),marginTop:"0",marginBottom:M(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:M(24,16),marginTop:M(48,24),marginBottom:M(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:M(20,16),marginTop:M(32,20),marginBottom:M(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:M(24,16),marginBottom:M(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:M(32,16),marginBottom:M(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:M(14,16),lineHeight:"1.4",marginTop:M(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:M(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:M(21,24)},"h3 code":{fontSize:M(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:M(14,16),lineHeight:"1.7",marginTop:M(24,14),marginBottom:M(24,14),borderRadius:"0.375rem",paddingTop:M(12,14),paddingRight:M(16,14),paddingBottom:M(12,14),paddingLeft:M(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:M(32,16),marginBottom:M(32,16),fontSize:M(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:M(8,14),paddingBottom:M(8,14),paddingLeft:M(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:M(8,14),paddingRight:M(8,14),paddingBottom:M(8,14),paddingLeft:M(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:M(20,16),lineHeight:"1.6",marginTop:M(24,20),marginBottom:M(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Au(i,o,t)],"@layer components":{...Iu(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let l={},a={},c=(d,u,p)=>{let h=o.theme(`colors.${s}.${u}`,u);p["--tw-prose-"+d]=Ye(h);let g=p!=a&&o.d("colors",`${s}-${u}`,h);g&&(a["--tw-prose-"+d]=Ye(g))};for(let d in r){let u=r[d];d!="dark"&&u&&c(d,u,l)}for(let d in r.dark||{}){let u=r.dark[d];u&&(r.dark?c("invert-"+d,u,l):c(d,u,a))}return Object.keys(l).length?{"@layer defaults":{"&":l,[o.v("dark")]:a}}:void 0}}function Au(i,e,t){let r={};for(let n in t)r[Pu(i,n,e,s=>`.${e.e(e.h(i))}${s}`)]=t[n];return r}function Pu(i,e,{e:t,h:r},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",l=s,a="")=>n(`${o}:where(${l}):not(:where(.${t(r("not-"+i))} *))${a}`))}function Iu(i){return i?typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}:void 0}function M(i,e){return`${(i/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var uo=oo({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[$u(),hu(),gu(),Tu()]});function Ru(i,e=!0){let t=function(){if(Ph)try{let a=yn(new CSSStyleSheet);return a.connect=c=>{let d=co(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,a.target]},a.disconnect=_n,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[yn(s)],l=new WeakMap;return{get target(){return o[0].target},snapshot(){let a=o.map(c=>c.snapshot());return()=>a.forEach(c=>c())},clear(){o.forEach(a=>a.clear())},destroy(){o.forEach(a=>a.destroy())},insert(a,c,d){o[0].insert(a,c,d);let u=this.target.cssRules[c];o.forEach((p,h)=>h&&p.target.insertRule(u.cssText,c))},resume(a,c){return o[0].resume(a,c)},connect(a){let c=document.createElement("style");co(a).appendChild(c);let d=yn(c),{cssRules:u}=this.target;for(let p=0;p<u.length;p++)d.target.insertRule(u[p].cssText,p);o.push(d),l.set(a,d)},disconnect(a){let c=o.indexOf(l.get(a));c>=0&&o.splice(c,1)}}}(),r=lu({...i,hash:i.hash??e},t),n=uu(r);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(co(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=r}}}}var Ph=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function co(i){return i.shadowRoot||i.attachShadow({mode:"open"})}var G=i=>Ru(uo)(i);var wn=class extends G(B){constructor(){super();P(this,"render",()=>L`
4
4
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
5
5
  <!-- the background color is set on the root button so that when we cross fade between the open/close states there's no white flicker -->
6
6
  <button class="leading-0 relative inline-block h-14 w-14 overflow-hidden rounded-full bg-slate-800 text-sm text-white shadow-xl transition-transform hover:scale-105 active:scale-90">
@@ -26,9 +26,9 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
26
26
  </svg>
27
27
  </div>
28
28
  </button>
29
- `);this.state="open",this.src=""}};T(gn,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",gn);var vn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},mn=i=>(...e)=>({_$litDirective$:i,values:e}),mi=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:_h}=Fl;var xu=()=>document.createComment(""),_i=(i,e,t)=>{let r=i._$AA.parentNode,n=e===void 0?i._$AB:e._$AA;if(t===void 0){let s=r.insertBefore(xu(),n),o=r.insertBefore(xu(),n);t=new _h(s,o,i,i.options)}else{let s=t._$AB.nextSibling,o=t._$AM,l=o!==i;if(l){let a;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(a=i._$AU)!==o._$AU&&t._$AP(a)}if(s!==n||l){let a=t._$AA;for(;a!==s;){let c=a.nextSibling;r.insertBefore(a,n),a=c}}}return t},$t=(i,e,t=i)=>(i._$AI(e,t),i),yh={},ku=(i,e=yh)=>i._$AH=e,Su=i=>i._$AH,_n=i=>{i._$AP?.(!1,!0);let e=i._$AA,t=i._$AB.nextSibling;for(;e!==t;){let r=e.nextSibling;e.remove(),e=r}};var Eu=(i,e,t)=>{let r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},sr=mn(class extends mi{constructor(i){if(super(i),i.type!==vn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let n=[],s=[],o=0;for(let l of i)n[o]=r?r(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){let n=Su(i),{values:s,keys:o}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=o,s;let l=this.ut??=[],a=[],c,p,u=0,d=n.length-1,h=0,g=s.length-1;for(;u<=d&&h<=g;)if(n[u]===null)u++;else if(n[d]===null)d--;else if(l[u]===o[h])a[h]=$t(n[u],s[h]),u++,h++;else if(l[d]===o[g])a[g]=$t(n[d],s[g]),d--,g--;else if(l[u]===o[g])a[g]=$t(n[u],s[g]),_i(i,a[g+1],n[u]),u++,g--;else if(l[d]===o[h])a[h]=$t(n[d],s[h]),_i(i,n[u],n[d]),d--,h++;else if(c===void 0&&(c=Eu(o,h,g),p=Eu(l,u,d)),c.has(l[u]))if(c.has(l[d])){let m=p.get(o[h]),k=m!==void 0?n[m]:null;if(k===null){let w=_i(i,n[u]);$t(w,s[h]),a[h]=w}else a[h]=$t(k,s[h]),_i(i,n[u],k),n[m]=null;h++}else _n(n[d]),d--;else _n(n[u]),u++;for(;h<=g;){let m=_i(i,a[g+1]);$t(m,s[h]),a[h++]=m}for(;u<=d;){let m=n[u++];m!==null&&_n(m)}return this.ut=o,ku(i,a),Qe}});function Cu(i,e,t){return i?e(i):t?.(i)}var yn,$u,bn=class bn extends G(B){constructor(){super();b(this,yn);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?U:L`
29
+ `);this.state="open",this.src=""}};P(wn,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",wn);var xn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},kn=i=>(...e)=>({_$litDirective$:i,values:e}),bi=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Rh}=Wl;var Ou=()=>document.createComment(""),wi=(i,e,t)=>{let r=i._$AA.parentNode,n=e===void 0?i._$AB:e._$AA;if(t===void 0){let s=r.insertBefore(Ou(),n),o=r.insertBefore(Ou(),n);t=new Rh(s,o,i,i.options)}else{let s=t._$AB.nextSibling,o=t._$AM,l=o!==i;if(l){let a;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(a=i._$AU)!==o._$AU&&t._$AP(a)}if(s!==n||l){let a=t._$AA;for(;a!==s;){let c=a.nextSibling;r.insertBefore(a,n),a=c}}}return t},Tt=(i,e,t=i)=>(i._$AI(e,t),i),Oh={},Fu=(i,e=Oh)=>i._$AH=e,Du=i=>i._$AH,Sn=i=>{i._$AP?.(!1,!0);let e=i._$AA,t=i._$AB.nextSibling;for(;e!==t;){let r=e.nextSibling;e.remove(),e=r}};var Mu=(i,e,t)=>{let r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},ur=kn(class extends bi{constructor(i){if(super(i),i.type!==xn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let n=[],s=[],o=0;for(let l of i)n[o]=r?r(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){let n=Du(i),{values:s,keys:o}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=o,s;let l=this.ut??=[],a=[],c,d,u=0,p=n.length-1,h=0,g=s.length-1;for(;u<=p&&h<=g;)if(n[u]===null)u++;else if(n[p]===null)p--;else if(l[u]===o[h])a[h]=Tt(n[u],s[h]),u++,h++;else if(l[p]===o[g])a[g]=Tt(n[p],s[g]),p--,g--;else if(l[u]===o[g])a[g]=Tt(n[u],s[g]),wi(i,a[g+1],n[u]),u++,g--;else if(l[p]===o[h])a[h]=Tt(n[p],s[h]),wi(i,n[u],n[p]),p--,h++;else if(c===void 0&&(c=Mu(o,h,g),d=Mu(l,u,p)),c.has(l[u]))if(c.has(l[p])){let m=d.get(o[h]),k=m!==void 0?n[m]:null;if(k===null){let w=wi(i,n[u]);Tt(w,s[h]),a[h]=w}else a[h]=Tt(k,s[h]),wi(i,n[u],k),n[m]=null;h++}else Sn(n[p]),p--;else Sn(n[u]),u++;for(;h<=g;){let m=wi(i,a[g+1]);Tt(m,s[h]),a[h++]=m}for(;u<=p;){let m=n[u++];m!==null&&Sn(m)}return this.ut=o,Fu(i,a),tt}});function Lu(i,e,t){return i?e(i):t?.(i)}var En,Nu,Cn=class Cn extends G(B){constructor(){super();y(this,En);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?U:L`
30
30
  <div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pb-2 pt-6">
31
- ${Cu(this.examples.title,()=>L`
31
+ ${Lu(this.examples.title,()=>L`
32
32
  <h2 class="mt-14 px-2 pb-2 pt-9 text-left text-3xl font-bold leading-tight tracking-tight">
33
33
  <span>${this.examples.title}</span>
34
34
  <svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
@@ -40,17 +40,17 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
40
40
  `)}
41
41
  ${this.examples?.items?.length?L`
42
42
  <ul class="mt-auto flex select-none flex-wrap justify-end gap-2.5 text-sm/6 text-black">
43
- ${sr(this.examples.items,t=>t,t=>L`
43
+ ${ur(this.examples.items,t=>t,t=>L`
44
44
  <li
45
45
  class="border-1 hover:bg-[${this.color}]/[0.08] border-gray my-auto inline-block cursor-pointer rounded-2xl px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:opacity-80 hover:shadow"
46
- @click="${()=>$(this,yn,$u).call(this,t)}">
46
+ @click="${()=>A(this,En,Nu).call(this,t)}">
47
47
  <span>${t.trim()}</span>
48
48
  </li>
49
49
  `)}
50
50
  </ul>
51
51
  `:U}
52
52
  </div>
53
- `}};yn=new WeakSet,$u=function(t){this.dispatchEvent(new bn.ExampleClickEvent({example:t}))},T(bn,"properties",{examples:{type:Object},color:{type:String}});var or=bn,no;or.ExampleClickEvent=(no=class extends CustomEvent{constructor(e,t={}){super(or.ExampleClickEvent.type,{detail:e,...t})}},T(no,"type","mw:example-click"),no);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",or);var bi,Au,Iu,yi=class yi extends G(B){constructor(){super();b(this,bi);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return L`
53
+ `}};En=new WeakSet,Nu=function(t){this.dispatchEvent(new Cn.ExampleClickEvent({example:t}))},P(Cn,"properties",{examples:{type:Object},color:{type:String}});var cr=Cn,po;cr.ExampleClickEvent=(po=class extends CustomEvent{constructor(e,t={}){super(cr.ExampleClickEvent.type,{detail:e,...t})}},P(po,"type","mw:example-click"),po);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",cr);var ki,Uu,ju,xi=class xi extends G(B){constructor(){super();y(this,ki);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return L`
54
54
  <div class="relative h-12">
55
55
  <div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
56
56
 
@@ -73,7 +73,7 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
73
73
  <div class="flex-grow"></div>
74
74
 
75
75
  <!-- new chat btn -->
76
- <button @click=${$(this,bi,Au)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
76
+ <button @click=${A(this,ki,Uu)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
77
77
  <!-- svg icon of a bubble with a plus -->
78
78
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
79
79
  <path
@@ -85,7 +85,7 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
85
85
  </button>
86
86
 
87
87
  <!-- close chat btn -->
88
- <button @click=${$(this,bi,Iu)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
88
+ <button @click=${A(this,ki,ju)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
89
89
  <!-- svg icon of an X -->
90
90
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="white">
91
91
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
@@ -100,7 +100,7 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
100
100
  </div>
101
101
  </div>
102
102
  </div>
103
- `}};bi=new WeakSet,Au=function(){this.dispatchEvent(new yi.NewChatClickEvent)},Iu=function(){this.dispatchEvent(new yi.CloseClickEvent)},T(yi,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),T(yi,"styles",pt`
103
+ `}};ki=new WeakSet,Uu=function(){this.dispatchEvent(new xi.NewChatClickEvent)},ju=function(){this.dispatchEvent(new xi.CloseClickEvent)},P(xi,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),P(xi,"styles",ht`
104
104
  /* blurred background */
105
105
 
106
106
  .gradient-blur {
@@ -112,16 +112,16 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
112
112
  /* bg-color gradient */
113
113
  background-image: linear-gradient(to bottom, white 20%, transparent);
114
114
  }
115
- `);var Jt=yi,so;Jt.NewChatClickEvent=(so=class extends CustomEvent{constructor(e={}){super(Jt.NewChatClickEvent.type,{...e})}},T(so,"type","mw:new-chat-click"),so);var oo;Jt.CloseClickEvent=(oo=class extends CustomEvent{constructor(e={}){super(Jt.CloseClickEvent.type,{...e})}},T(oo,"type","mw:close-click"),oo);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Jt);var ao={maxHeight:120,initialHeight:32,paddingY:12},$e,po,Tu,Pu,Ru,Ou,ho,wi=class wi extends G(B){constructor(){super();b(this,$e);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return L`
116
- <form @submit="${$(this,$e,Ru)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
115
+ `);var Zt=xi,ho;Zt.NewChatClickEvent=(ho=class extends CustomEvent{constructor(e={}){super(Zt.NewChatClickEvent.type,{...e})}},P(ho,"type","mw:new-chat-click"),ho);var fo;Zt.CloseClickEvent=(fo=class extends CustomEvent{constructor(e={}){super(Zt.CloseClickEvent.type,{...e})}},P(fo,"type","mw:close-click"),fo);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Zt);var go={maxHeight:120,initialHeight:32,paddingY:12},Ie,yo,qu,Bu,Hu,zu,bo,Si=class Si extends G(B){constructor(){super();y(this,Ie);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return L`
116
+ <form @submit="${A(this,Ie,Hu)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
117
117
  <textarea
118
118
  name="input"
119
- @input="${$(this,$e,Ou)}"
120
- @keydown="${$(this,$e,Pu)}"
119
+ @input="${A(this,Ie,zu)}"
120
+ @keydown="${A(this,Ie,Bu)}"
121
121
  autofocus
122
122
  ?disabled="${this.disabled}"
123
123
  placeholder="${this.placeholder}"
124
- class="box-content h-[${ao.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${ao.paddingY}px] text-base text-gray-800 outline-none"></textarea>
124
+ class="box-content h-[${go.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${go.paddingY}px] text-base text-gray-800 outline-none"></textarea>
125
125
 
126
126
  <button type="submit" ?disabled="${this.disabled}" class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
127
127
  ${this.streaming?L`
@@ -145,7 +145,7 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
145
145
  <slot>
146
146
  <div class="h-5 w-full"></div>
147
147
  </slot>
148
- `}};$e=new WeakSet,po=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Tu=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Pu=function(t){bh(t)&&(t.preventDefault(),this.streaming||f(this,$e,Tu)?.click())},Ru=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new wi.CancelEvent);return}let r=f(this,$e,po);if(!r)throw new Error("Expected input element to be present");r.value&&this.dispatchEvent(new wi.SubmitEvent(r.value))&&(r.value=""),$(this,$e,ho).call(this)},Ou=function(t){this.dispatchEvent(new wi.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),$(this,$e,ho).call(this)},ho=function(){let t=f(this,$e,po);if(!t)return;let{maxHeight:r,initialHeight:n,paddingY:s}=ao;t.style.height=`${n}px`;let o=t.scrollHeight,l=s*2,a=Math.min(o-l,r);t.style.height=`${a}px`},T(wi,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var ft=wi,lo;ft.ChangeEvent=(lo=class extends CustomEvent{constructor(e,t={}){super(ft.ChangeEvent.type,{detail:e,...t})}},T(lo,"type","mw:change"),lo);var uo;ft.SubmitEvent=(uo=class extends CustomEvent{constructor(e,t={}){super(ft.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},T(uo,"type","mw:submit"),uo);var co;ft.CancelEvent=(co=class extends CustomEvent{constructor(e={}){super(ft.CancelEvent.type,{...e})}},T(co,"type","mw:cancel"),co);function bh(i){return i.code==="Enter"&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",ft);var wn=class extends G(B){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let t=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return L`
148
+ `}};Ie=new WeakSet,yo=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},qu=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Bu=function(t){Fh(t)&&(t.preventDefault(),this.streaming||f(this,Ie,qu)?.click())},Hu=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new Si.CancelEvent);return}let r=f(this,Ie,yo);if(!r)throw new Error("Expected input element to be present");r.value&&this.dispatchEvent(new Si.SubmitEvent(r.value))&&(r.value=""),A(this,Ie,bo).call(this)},zu=function(t){this.dispatchEvent(new Si.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),A(this,Ie,bo).call(this)},bo=function(){let t=f(this,Ie,yo);if(!t)return;let{maxHeight:r,initialHeight:n,paddingY:s}=go;t.style.height=`${n}px`;let o=t.scrollHeight,l=s*2,a=Math.min(o-l,r);t.style.height=`${a}px`},P(Si,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var vt=Si,vo;vt.ChangeEvent=(vo=class extends CustomEvent{constructor(e,t={}){super(vt.ChangeEvent.type,{detail:e,...t})}},P(vo,"type","mw:change"),vo);var mo;vt.SubmitEvent=(mo=class extends CustomEvent{constructor(e,t={}){super(vt.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},P(mo,"type","mw:submit"),mo);var _o;vt.CancelEvent=(_o=class extends CustomEvent{constructor(e={}){super(vt.CancelEvent.type,{...e})}},P(_o,"type","mw:cancel"),_o);function Fh(i){return i.code==="Enter"&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",vt);var $n=class extends G(B){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let t=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return L`
149
149
  <div class="ml-20 flex justify-end font-sans text-base">
150
150
  <div class="max-w-full">
151
151
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -180,7 +180,7 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
180
180
  </div>
181
181
  </div>
182
182
  </div>
183
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};T(wn,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",wn);var ar,Le,at,lr,fo,xn=class{constructor(e,t){b(this,lr);b(this,ar);b(this,Le);b(this,at);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");R(this,ar,e),f(this,ar).addController(this),R(this,Le,t)}connect(e){R(this,Le,e),R(this,at,$(this,lr,fo).call(this))}hostConnected(){setTimeout(()=>{R(this,at,$(this,lr,fo).call(this))},0)}hostDisconnected(){f(this,at)?.close(1e3,"lit_host_disconnected"),R(this,at,void 0)}send(e){f(this,at)?.send(e)}close(e,t){f(this,at)?.close(e,t)}get isConnected(){return f(this,at)?.readyState===WebSocket.OPEN}};ar=new WeakMap,Le=new WeakMap,at=new WeakMap,lr=new WeakSet,fo=function(){let e=new WebSocket(f(this,Le).url());return f(this,Le).onClose&&(e.onclose=f(this,Le).onClose),f(this,Le).onOpen&&(e.onopen=f(this,Le).onOpen),f(this,Le).onError&&(e.onerror=f(this,Le).onError),f(this,Le).onMessage&&(e.onmessage=f(this,Le).onMessage),e};var Fu="664df22d-d461-42d6-801e-f70247e2cd7c",_e,ye,tt,xi,ki,xe,Yt,Mu,Du,Lu,Nu,kn=class{constructor(e,t){b(this,xe);b(this,_e);b(this,ye);b(this,tt);T(this,"isStreaming",!1);T(this,"typingIndicator");T(this,"ranOutOfCredits",!1);T(this,"messages",[]);T(this,"conversationId","");b(this,xi,0);b(this,ki);T(this,"isLiveMode",!1);R(this,_e,e),R(this,ye,t),R(this,tt,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:r,role:n="user",expectStreaming:s=!1}={}){return $(this,xe,Yt).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:r},{expectStreaming:s})}sendUserCancel(){return $(this,xe,Yt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return $(this,xe,Yt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return $(this,xe,Yt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){$(this,xe,Yt).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,tt).close(1e3,"closed by user")}retry(){clearTimeout(f(this,ki)),R(this,ki,setTimeout(()=>{f(this,ye).onReconnect?.(),R(this,tt,this.initWS())},1e3*f(this,xi))),_l(this,xi)._++}initWS(){return new xn(f(this,_e),{url:()=>f(this,ye).url(this.conversationId,{}),onOpen:e=>$(this,xe,Mu).call(this,e),onMessage:e=>$(this,xe,Du).call(this,JSON.parse(e.data)),onError:e=>$(this,xe,Lu).call(this,e),onClose:e=>$(this,xe,Nu).call(this,e)})}hostConnected(){this.conversationId=f(this,ye).restoreConversationState?.()?.conversationId||"",this.messages=f(this,ye).restoreConversationState?.()?.messages||[]}reset(){$(this,xe,Yt).call(this,{type:"NEW_CHAT"}),f(this,ye).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,f(this,_e).requestUpdate()}hostDisconnected(){clearTimeout(f(this,ki))}reconnectSocket(){f(this,tt).close(1e3,"destroy"),R(this,tt,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};_e=new WeakMap,ye=new WeakMap,tt=new WeakMap,xi=new WeakMap,ki=new WeakMap,xe=new WeakSet,Yt=function(e,{expectStreaming:t=!1}={}){return f(this,tt).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,_e).requestUpdate()),f(this,tt).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Mu=function(e){R(this,xi,0)},Du=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,r,n)=>r===n.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,f(this,_e).requestUpdate(),f(this,ye).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message),f(this,_e).requestUpdate(),f(this,ye).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,f(this,_e).requestUpdate(),f(this,ye).onMessageDone?.(e,t),f(this,ye).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,f(this,_e).requestUpdate();break}case"ERROR":{f(this,ye).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,f(this,ye).onConnect?.(e.conversationId),f(this,ye).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,f(this,_e).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,_e).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,_e).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Fu)||this.messages.push({id:Fu,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,_e).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,_e).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Lu=function(e){console.error("onError",e),f(this,ye).onError?.(e)},Nu=function(e){f(this,_e).isConnected&&!f(this,tt).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,_e).requestUpdate(),f(this,ye).onClose?.()};var ur,Si,At,Kt,En,Uu,Sn=class{constructor(e,t,{timeoutMs:r=2e3}={}){b(this,En);b(this,ur);b(this,Si);b(this,At);b(this,Kt,!1);T(this,"timeoutMs");R(this,ur,e),R(this,Si,t),this.timeoutMs=r,e.addController(this)}get isTyping(){return f(this,Kt)}hostDisconnected(){clearTimeout(f(this,At)),R(this,At,void 0)}onInput(e){if(f(this,ur).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,At)),R(this,At,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,Kt)||$(this,En,Uu).call(this)}}typingStopped(){clearTimeout(f(this,At)),R(this,Kt,!1),f(this,Si).typingStopped()}};ur=new WeakMap,Si=new WeakMap,At=new WeakMap,Kt=new WeakMap,En=new WeakSet,Uu=function(){R(this,Kt,!0),f(this,Si).typingStarted()};function qu(i,e){let t=new Map;for(let r of i){let n=e(r);t.has(n)||t.set(n,[]),(t.get(n)||[]).push(r)}return t}function ju(i,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(i);return`${i.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var go;function vo(i){return{lang:i?.lang??go?.lang,message:i?.message,abortEarly:i?.abortEarly??go?.abortEarly,abortPipeEarly:i?.abortPipeEarly??go?.abortPipeEarly}}var wh;function xh(i){return wh?.get(i)}var kh;function Sh(i){return kh?.get(i)}var Eh;function Ch(i,e){return Eh?.get(i)?.get(e)}function Ei(i){let e=typeof i;return e==="string"?`"${i}"`:e==="number"||e==="bigint"||e==="boolean"?`${i}`:e==="object"||e==="function"?(i&&Object.getPrototypeOf(i)?.constructor?.name)??"null":e}function Ne(i,e,t,r,n){let s=n&&"input"in n?n.input:t.value,o=n?.expected??i.expects??null,l=n?.received??Ei(s),a={kind:i.kind,type:i.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:i.requirement,path:n?.path,issues:n?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=i.kind==="schema",p=n?.message??i.message??Ch(i.reference,a.lang)??(c?Sh(a.lang):null)??r.message??xh(a.lang);p&&(a.message=typeof p=="function"?p(a):p),c&&(t.typed=!1),t.issues?t.issues.push(a):t.issues=[a]}function it(i){return{version:1,vendor:"valibot",validate(e){return i["~run"]({value:e},vo())}}}function $h(i,e){return Object.hasOwn(i,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Hu(i,e){let t=[...new Set(i)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Ah=class extends Error{constructor(e){super(e[0].message);T(this,"issues");this.name="ValiError",this.issues=e}};function mo(i,e){return{kind:"validation",type:"max_length",reference:mo,async:!1,expects:`<=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length>this.requirement&&Ne(this,"length",t,r,{received:`${t.value.length}`}),t}}}function _o(i,e){return{kind:"validation",type:"max_value",reference:_o,async:!1,expects:`<=${i instanceof Date?i.toJSON():Ei(i)}`,requirement:i,message:e,"~run"(t,r){return t.typed&&!(t.value<=this.requirement)&&Ne(this,"value",t,r,{received:t.value instanceof Date?t.value.toJSON():Ei(t.value)}),t}}}function yo(i,e){return{kind:"validation",type:"min_length",reference:yo,async:!1,expects:`>=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length<this.requirement&&Ne(this,"length",t,r,{received:`${t.value.length}`}),t}}}function bo(i,e){return{kind:"validation",type:"min_value",reference:bo,async:!1,expects:`>=${i instanceof Date?i.toJSON():Ei(i)}`,requirement:i,message:e,"~run"(t,r){return t.typed&&!(t.value>=this.requirement)&&Ne(this,"value",t,r,{received:t.value instanceof Date?t.value.toJSON():Ei(t.value)}),t}}}function Ih(i,e,t){return typeof i.default=="function"?i.default(e,t):i.default}function gt(i,e){return{kind:"schema",type:"array",reference:gt,expects:"Array",async:!1,item:i,message:e,get"~standard"(){return it(this)},"~run"(t,r){let n=t.value;if(Array.isArray(n)){t.typed=!0,t.value=[];for(let s=0;s<n.length;s++){let o=n[s],l=this.item["~run"]({value:o},r);if(l.issues){let a={type:"array",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else Ne(this,"type",t,r);return t}}}function be(i){return{kind:"schema",type:"boolean",reference:be,expects:"boolean",async:!1,message:i,get"~standard"(){return it(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:Ne(this,"type",e,t),e}}}function wo(i){return{kind:"schema",type:"null",reference:wo,expects:"null",async:!1,message:i,get"~standard"(){return it(this)},"~run"(e,t){return e.value===null?e.typed=!0:Ne(this,"type",e,t),e}}}function Ae(i){return{kind:"schema",type:"number",reference:Ae,expects:"number",async:!1,message:i,get"~standard"(){return it(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ne(this,"type",e,t),e}}}function re(i,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:i,message:e,get"~standard"(){return it(this)},"~run"(t,r){let n=t.value;if(n&&typeof n=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=n[s],l=this.entries[s]["~run"]({value:o},r);if(l.issues){let a={type:"object",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),(l.value!==void 0||s in n)&&(t.value[s]=l.value)}}else Ne(this,"type",t,r);return t}}}function A(i,e){return{kind:"schema",type:"optional",reference:A,expects:`(${i.expects} | undefined)`,async:!1,wrapped:i,default:e,get"~standard"(){return it(this)},"~run"(t,r){return t.value===void 0&&(this.default!==void 0&&(t.value=Ih(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,r)}}}function Ci(i,e){return{kind:"schema",type:"picklist",reference:Ci,expects:Hu(i.map(Ei),"|"),async:!1,options:i,message:e,get"~standard"(){return it(this)},"~run"(t,r){return this.options.includes(t.value)?t.typed=!0:Ne(this,"type",t,r),t}}}function xo(i,e,t){return{kind:"schema",type:"record",reference:xo,expects:"Object",async:!1,key:i,value:e,message:t,get"~standard"(){return it(this)},"~run"(r,n){let s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(let o in s)if($h(s,o)){let l=s[o],a=this.key["~run"]({value:o},n);if(a.issues){let p={type:"object",origin:"key",input:s,key:o,value:l};for(let u of a.issues)u.path=[p],r.issues?.push(u);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}let c=this.value["~run"]({value:l},n);if(c.issues){let p={type:"object",origin:"value",input:s,key:o,value:l};for(let u of c.issues)u.path?u.path.unshift(p):u.path=[p],r.issues?.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}(!a.typed||!c.typed)&&(r.typed=!1),a.typed&&(r.value[a.value]=c.value)}}else Ne(this,"type",r,n);return r}}}function N(i){return{kind:"schema",type:"string",reference:N,expects:"string",async:!1,message:i,get"~standard"(){return it(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:Ne(this,"type",e,t),e}}}function Bu(i){let e;if(i)for(let t of i)e?e.push(...t.issues):e=t.issues;return e}function ko(i,e){return{kind:"schema",type:"union",reference:ko,expects:Hu(i.map(t=>t.expects),"|"),async:!1,options:i,message:e,get"~standard"(){return it(this)},"~run"(t,r){let n,s,o;for(let l of this.options){let a=l["~run"]({value:t.value},r);if(a.typed)if(a.issues)s?s.push(a):s=[a];else{n=a;break}else o?o.push(a):o=[a]}if(n)return n;if(s){if(s.length===1)return s[0];Ne(this,"type",t,r,{issues:Bu(s)}),t.typed=!0}else{if(o?.length===1)return o[0];Ne(this,"type",t,r,{issues:Bu(o)})}return t}}}function zu(i,e,t){let r=i["~run"]({value:e},vo(t));if(r.issues)throw new Ah(r.issues);return r.value}function Cn(...i){return{...i[0],pipe:i,get"~standard"(){return it(this)},"~run"(e,t){for(let r of i)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=r["~run"](e,t))}return e}}}function So(i,e,t){let r=i["~run"]({value:e},vo(t));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var cr={SCRAPER:"scraper",UNAS:"unas",SHOPRENTER:"shoprenter",SHOPIFY:"shopify",SHOPER:"shoper"},Th=Object.freeze([cr.UNAS,cr.SHOPRENTER,cr.SHOPIFY,cr.SHOPER]),Vu=Object.freeze([...Th,cr.SCRAPER]);var um=re({wsApiUrl:N(),url:N(),logoUrl:A(N()),title:N(),status:N(),color:N(),showStillLearningBanner:A(be()),allowedOrigins:A(gt(N())),input:re({placeholder:N()}),bubble:re({imageUrl:A(N()),position:re({bottom:A(N()),right:A(N()),left:A(N())}),mobilePosition:A(re({bottom:A(N()),right:A(N()),left:A(N())})),zIndex:A(Ae())}),examples:re({title:N(),items:gt(N())}),instructions:re({items:gt(N()),limit:A(Ae())}),popup:A(re({mobileEnabled:A(be()),desktopEnabled:A(be()),delayMs:A(Ae()),text:A(N()),mobileTitleText:A(N()),mobileButtonText:A(N())})),tryItOut:A(re({mobileEnabled:A(be()),desktopEnabled:A(be()),text:A(N())})),contactDetails:A(re({email:A(N()),phone:A(N()),socialMedia:A(re({facebook:A(N()),instagram:A(N()),twitter:A(N())}))})),notifications:A(re({email:A(N())})),neverShowStillLearningBanner:A(be()),hidden:A(be()),newChatTitle:A(N()),webhookURL:A(N()),automatedResponse:A(re({enabled:A(be()),text:A(N()),latencyThresholdMs:A(Ae())})),removePoweredBy:A(be()),claimable:A(be()),feed:A(N()),scraper:A(Ci(["netkazan","jateknet","json-schema-org","arukereso-xml","partocean","google-rev1"])),scraperAuthorization:A(N()),platform:A(Ci(Vu)),workingHours:A(re({dailyAvailability:gt(re({dayOfWeek:Cn(Ae(),bo(0),_o(6)),startTime:N(),endTime:N(),isActive:be()})),userTimeZone:A(N())})),planOverrides:A(re({maxProducts:A(Ae()),conversations:A(Ae()),faqs:A(re({max:A(Ae()),questionLength:A(Ae()),answerLength:A(Ae())}))})),omitGeneralGuidelines:A(be()),forceStripe:A(be()),products:A(re({blocklistUrls:A(gt(N()))})),autoRefresh:A(re({enabled:A(be()),intervalMins:A(Ae())})),lang:A(N())});var pr=class extends mi{constructor(e){if(super(e),this.it=U,e.type!==vn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===Qe)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};pr.directiveName="unsafeHTML",pr.resultType=1;var Gu=mn(pr);var Ph="\xB7 \xB7 \xB7",Rh=re({conversationId:A(N()),messages:A(gt(re({id:N(),timestamp:Ae(),role:Ci(["user","assistant","support"]),content:N(),content_html:A(N())})))}),Oh=xo(N(),ko([N(),Ae(),be(),wo()])),Fh=Cn(N(),yo(1),mo(1e3)),$i,Ai,Q,Co,$n,hr,le,fr,Xu,Ju,Yu,Ku,Zu,Qu,ec,$o,An=class An extends G(B){constructor(){super();b(this,Q);b(this,$i);b(this,Ai);b(this,hr,new Sn(this,{typingStarted:()=>f(this,le).sendUserTypingStart(),typingStopped:()=>f(this,le).sendUserTypingStop()}));b(this,le,new kn(this,{url:t=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&f(this,Q,$o)?.scrollTo(0,f(this,Q,$o).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(f(this,Q,$n))},onConnect:t=>{},persistConversationState:(t,r)=>{localStorage.setItem(f(this,Q,$n),JSON.stringify({conversationId:t,messages:r}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,Q,$n))||"{}"),r=zu(Rh,t);return{conversationId:r.conversationId||"",messages:r.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));b(this,fr,"single");this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get widgetId(){return this.config.widgetId}get conversationId(){return f(this,le).conversationId}get messages(){return f(this,le).messages}firstUpdated(){$(this,Q,Co).call(this)}updated(){$(this,Q,Co).call(this)}render(){console.assert(this.config,"config is required");let t=qu(this.messages,r=>{try{let n=new Date(r.timestamp),s=Math.floor(n.getUTCMinutes()/5)*5;return n.setUTCMinutes(s,0,0),n.valueOf().toString()}catch(n){console.error(n)}});return L`
183
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};P($n,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",$n);var dr,Ue,ut,pr,wo,An=class{constructor(e,t){y(this,pr);y(this,dr);y(this,Ue);y(this,ut);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");C(this,dr,e),f(this,dr).addController(this),C(this,Ue,t)}connect(e){C(this,Ue,e),C(this,ut,A(this,pr,wo).call(this))}hostConnected(){setTimeout(()=>{C(this,ut,A(this,pr,wo).call(this))},0)}hostDisconnected(){f(this,ut)?.close(1e3,"lit_host_disconnected"),C(this,ut,void 0)}send(e){f(this,ut)?.send(e)}close(e,t){f(this,ut)?.close(e,t)}get isConnected(){return f(this,ut)?.readyState===WebSocket.OPEN}};dr=new WeakMap,Ue=new WeakMap,ut=new WeakMap,pr=new WeakSet,wo=function(){let e=new WebSocket(f(this,Ue).url());return f(this,Ue).onClose&&(e.onclose=f(this,Ue).onClose),f(this,Ue).onOpen&&(e.onopen=f(this,Ue).onOpen),f(this,Ue).onError&&(e.onerror=f(this,Ue).onError),f(this,Ue).onMessage&&(e.onmessage=f(this,Ue).onMessage),e};var Wu="664df22d-d461-42d6-801e-f70247e2cd7c",be,we,rt,Ei,Ci,Se,Qt,Vu,Gu,Ju,Xu,In=class{constructor(e,t){y(this,Se);y(this,be);y(this,we);y(this,rt);P(this,"isStreaming",!1);P(this,"typingIndicator");P(this,"ranOutOfCredits",!1);P(this,"messages",[]);P(this,"conversationId","");y(this,Ei,0);y(this,Ci);P(this,"isLiveMode",!1);C(this,be,e),C(this,we,t),C(this,rt,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:r,role:n="user",expectStreaming:s=!1}={}){return A(this,Se,Qt).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:r},{expectStreaming:s})}sendUserCancel(){return A(this,Se,Qt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return A(this,Se,Qt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return A(this,Se,Qt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){A(this,Se,Qt).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,rt).close(1e3,"closed by user")}retry(){clearTimeout(f(this,Ci)),C(this,Ci,setTimeout(()=>{f(this,we).onReconnect?.(),C(this,rt,this.initWS())},1e3*f(this,Ei))),Il(this,Ei)._++}initWS(){return new An(f(this,be),{url:()=>f(this,we).url(this.conversationId,{}),onOpen:e=>A(this,Se,Vu).call(this,e),onMessage:e=>A(this,Se,Gu).call(this,JSON.parse(e.data)),onError:e=>A(this,Se,Ju).call(this,e),onClose:e=>A(this,Se,Xu).call(this,e)})}hostConnected(){this.conversationId=f(this,we).restoreConversationState?.()?.conversationId||"",this.messages=f(this,we).restoreConversationState?.()?.messages||[]}reset(){A(this,Se,Qt).call(this,{type:"NEW_CHAT"}),f(this,we).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,f(this,be).requestUpdate()}hostDisconnected(){clearTimeout(f(this,Ci))}reconnectSocket(){f(this,rt).close(1e3,"destroy"),C(this,rt,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};be=new WeakMap,we=new WeakMap,rt=new WeakMap,Ei=new WeakMap,Ci=new WeakMap,Se=new WeakSet,Qt=function(e,{expectStreaming:t=!1}={}){return f(this,rt).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,be).requestUpdate()),f(this,rt).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Vu=function(e){C(this,Ei,0)},Gu=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,r,n)=>r===n.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,f(this,be).requestUpdate(),f(this,we).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message),f(this,be).requestUpdate(),f(this,we).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(r=>r.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,f(this,be).requestUpdate(),f(this,we).onMessageDone?.(e,t),f(this,we).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,f(this,be).requestUpdate();break}case"ERROR":{f(this,we).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,f(this,we).onConnect?.(e.conversationId),f(this,we).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,f(this,be).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,be).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,be).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Wu)||this.messages.push({id:Wu,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,be).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,be).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Ju=function(e){console.error("onError",e),f(this,we).onError?.(e)},Xu=function(e){f(this,be).isConnected&&!f(this,rt).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,be).requestUpdate(),f(this,we).onClose?.()};var hr,$i,Pt,ei,Pn,Yu,Tn=class{constructor(e,t,{timeoutMs:r=2e3}={}){y(this,Pn);y(this,hr);y(this,$i);y(this,Pt);y(this,ei,!1);P(this,"timeoutMs");C(this,hr,e),C(this,$i,t),this.timeoutMs=r,e.addController(this)}get isTyping(){return f(this,ei)}hostDisconnected(){clearTimeout(f(this,Pt)),C(this,Pt,void 0)}onInput(e){if(f(this,hr).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,Pt)),C(this,Pt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,ei)||A(this,Pn,Yu).call(this)}}typingStopped(){clearTimeout(f(this,Pt)),C(this,ei,!1),f(this,$i).typingStopped()}};hr=new WeakMap,$i=new WeakMap,Pt=new WeakMap,ei=new WeakMap,Pn=new WeakSet,Yu=function(){C(this,ei,!0),f(this,$i).typingStarted()};function Ku(i,e){let t=new Map;for(let r of i){let n=e(r);t.has(n)||t.set(n,[]),(t.get(n)||[]).push(r)}return t}function Zu(i,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(i);return`${i.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var xo;function ko(i){return{lang:i?.lang??xo?.lang,message:i?.message,abortEarly:i?.abortEarly??xo?.abortEarly,abortPipeEarly:i?.abortPipeEarly??xo?.abortPipeEarly}}var Dh;function Mh(i){return Dh?.get(i)}var Lh;function Nh(i){return Lh?.get(i)}var Uh;function jh(i,e){return Uh?.get(i)?.get(e)}function Ai(i){let e=typeof i;return e==="string"?`"${i}"`:e==="number"||e==="bigint"||e==="boolean"?`${i}`:e==="object"||e==="function"?(i&&Object.getPrototypeOf(i)?.constructor?.name)??"null":e}function je(i,e,t,r,n){let s=n&&"input"in n?n.input:t.value,o=n?.expected??i.expects??null,l=n?.received??Ai(s),a={kind:i.kind,type:i.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:i.requirement,path:n?.path,issues:n?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=i.kind==="schema",d=n?.message??i.message??jh(i.reference,a.lang)??(c?Nh(a.lang):null)??r.message??Mh(a.lang);d&&(a.message=typeof d=="function"?d(a):d),c&&(t.typed=!1),t.issues?t.issues.push(a):t.issues=[a]}function nt(i){return{version:1,vendor:"valibot",validate(e){return i["~run"]({value:e},ko())}}}function qh(i,e){return Object.hasOwn(i,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function ec(i,e){let t=[...new Set(i)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Bh=class extends Error{constructor(e){super(e[0].message);P(this,"issues");this.name="ValiError",this.issues=e}};function So(i,e){return{kind:"validation",type:"max_length",reference:So,async:!1,expects:`<=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length>this.requirement&&je(this,"length",t,r,{received:`${t.value.length}`}),t}}}function Eo(i,e){return{kind:"validation",type:"max_value",reference:Eo,async:!1,expects:`<=${i instanceof Date?i.toJSON():Ai(i)}`,requirement:i,message:e,"~run"(t,r){return t.typed&&!(t.value<=this.requirement)&&je(this,"value",t,r,{received:t.value instanceof Date?t.value.toJSON():Ai(t.value)}),t}}}function Co(i,e){return{kind:"validation",type:"min_length",reference:Co,async:!1,expects:`>=${i}`,requirement:i,message:e,"~run"(t,r){return t.typed&&t.value.length<this.requirement&&je(this,"length",t,r,{received:`${t.value.length}`}),t}}}function $o(i,e){return{kind:"validation",type:"min_value",reference:$o,async:!1,expects:`>=${i instanceof Date?i.toJSON():Ai(i)}`,requirement:i,message:e,"~run"(t,r){return t.typed&&!(t.value>=this.requirement)&&je(this,"value",t,r,{received:t.value instanceof Date?t.value.toJSON():Ai(t.value)}),t}}}function Hh(i,e,t){return typeof i.default=="function"?i.default(e,t):i.default}function mt(i,e){return{kind:"schema",type:"array",reference:mt,expects:"Array",async:!1,item:i,message:e,get"~standard"(){return nt(this)},"~run"(t,r){let n=t.value;if(Array.isArray(n)){t.typed=!0,t.value=[];for(let s=0;s<n.length;s++){let o=n[s],l=this.item["~run"]({value:o},r);if(l.issues){let a={type:"array",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else je(this,"type",t,r);return t}}}function xe(i){return{kind:"schema",type:"boolean",reference:xe,expects:"boolean",async:!1,message:i,get"~standard"(){return nt(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:je(this,"type",e,t),e}}}function Ao(i){return{kind:"schema",type:"null",reference:Ao,expects:"null",async:!1,message:i,get"~standard"(){return nt(this)},"~run"(e,t){return e.value===null?e.typed=!0:je(this,"type",e,t),e}}}function Te(i){return{kind:"schema",type:"number",reference:Te,expects:"number",async:!1,message:i,get"~standard"(){return nt(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:je(this,"type",e,t),e}}}function re(i,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:i,message:e,get"~standard"(){return nt(this)},"~run"(t,r){let n=t.value;if(n&&typeof n=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=n[s],l=this.entries[s]["~run"]({value:o},r);if(l.issues){let a={type:"object",origin:"value",input:n,key:s,value:o};for(let c of l.issues)c.path?c.path.unshift(a):c.path=[a],t.issues?.push(c);if(t.issues||(t.issues=l.issues),r.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),(l.value!==void 0||s in n)&&(t.value[s]=l.value)}}else je(this,"type",t,r);return t}}}function I(i,e){return{kind:"schema",type:"optional",reference:I,expects:`(${i.expects} | undefined)`,async:!1,wrapped:i,default:e,get"~standard"(){return nt(this)},"~run"(t,r){return t.value===void 0&&(this.default!==void 0&&(t.value=Hh(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,r)}}}function Ii(i,e){return{kind:"schema",type:"picklist",reference:Ii,expects:ec(i.map(Ai),"|"),async:!1,options:i,message:e,get"~standard"(){return nt(this)},"~run"(t,r){return this.options.includes(t.value)?t.typed=!0:je(this,"type",t,r),t}}}function Io(i,e,t){return{kind:"schema",type:"record",reference:Io,expects:"Object",async:!1,key:i,value:e,message:t,get"~standard"(){return nt(this)},"~run"(r,n){let s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(let o in s)if(qh(s,o)){let l=s[o],a=this.key["~run"]({value:o},n);if(a.issues){let d={type:"object",origin:"key",input:s,key:o,value:l};for(let u of a.issues)u.path=[d],r.issues?.push(u);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}let c=this.value["~run"]({value:l},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:l};for(let u of c.issues)u.path?u.path.unshift(d):u.path=[d],r.issues?.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}(!a.typed||!c.typed)&&(r.typed=!1),a.typed&&(r.value[a.value]=c.value)}}else je(this,"type",r,n);return r}}}function N(i){return{kind:"schema",type:"string",reference:N,expects:"string",async:!1,message:i,get"~standard"(){return nt(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:je(this,"type",e,t),e}}}function Qu(i){let e;if(i)for(let t of i)e?e.push(...t.issues):e=t.issues;return e}function To(i,e){return{kind:"schema",type:"union",reference:To,expects:ec(i.map(t=>t.expects),"|"),async:!1,options:i,message:e,get"~standard"(){return nt(this)},"~run"(t,r){let n,s,o;for(let l of this.options){let a=l["~run"]({value:t.value},r);if(a.typed)if(a.issues)s?s.push(a):s=[a];else{n=a;break}else o?o.push(a):o=[a]}if(n)return n;if(s){if(s.length===1)return s[0];je(this,"type",t,r,{issues:Qu(s)}),t.typed=!0}else{if(o?.length===1)return o[0];je(this,"type",t,r,{issues:Qu(o)})}return t}}}function tc(i,e,t){let r=i["~run"]({value:e},ko(t));if(r.issues)throw new Bh(r.issues);return r.value}function Rn(...i){return{...i[0],pipe:i,get"~standard"(){return nt(this)},"~run"(e,t){for(let r of i)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=r["~run"](e,t))}return e}}}function Po(i,e,t){let r=i["~run"]({value:e},ko(t));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var fr={SCRAPER:"scraper",UNAS:"unas",SHOPRENTER:"shoprenter",SHOPIFY:"shopify",SHOPER:"shoper"},zh=Object.freeze([fr.UNAS,fr.SHOPRENTER,fr.SHOPIFY,fr.SHOPER]),rc=Object.freeze([...zh,fr.SCRAPER]);var km=re({wsApiUrl:N(),url:N(),logoUrl:I(N()),title:N(),status:N(),color:N(),showStillLearningBanner:I(xe()),allowedOrigins:I(mt(N())),input:re({placeholder:N()}),bubble:re({imageUrl:I(N()),position:re({bottom:I(N()),right:I(N()),left:I(N())}),mobilePosition:I(re({bottom:I(N()),right:I(N()),left:I(N())})),zIndex:I(Te())}),examples:re({title:N(),items:mt(N())}),instructions:re({items:mt(N()),limit:I(Te())}),popup:I(re({mobileEnabled:I(xe()),desktopEnabled:I(xe()),delayMs:I(Te()),text:I(N()),mobileTitleText:I(N()),mobileButtonText:I(N())})),tryItOut:I(re({mobileEnabled:I(xe()),desktopEnabled:I(xe()),text:I(N())})),contactDetails:I(re({email:I(N()),phone:I(N()),socialMedia:I(re({facebook:I(N()),instagram:I(N()),twitter:I(N())}))})),notifications:I(re({email:I(N())})),neverShowStillLearningBanner:I(xe()),hidden:I(xe()),newChatTitle:I(N()),webhookURL:I(N()),automatedResponse:I(re({enabled:I(xe()),text:I(N()),latencyThresholdMs:I(Te())})),removePoweredBy:I(xe()),claimable:I(xe()),feed:I(N()),scraper:I(Ii(["netkazan","jateknet","json-schema-org","arukereso-xml","partocean","google-rev1"])),scraperAuthorization:I(N()),platform:I(Ii(rc)),workingHours:I(re({dailyAvailability:mt(re({dayOfWeek:Rn(Te(),$o(0),Eo(6)),startTime:N(),endTime:N(),isActive:xe()})),userTimeZone:I(N())})),planOverrides:I(re({maxProducts:I(Te()),conversations:I(Te()),faqs:I(re({max:I(Te()),questionLength:I(Te()),answerLength:I(Te())}))})),omitGeneralGuidelines:I(xe()),forceStripe:I(xe()),products:I(re({blocklistUrls:I(mt(N()))})),autoRefresh:I(re({enabled:I(xe()),intervalMins:I(Te())})),lang:I(N())});var gr=class extends bi{constructor(e){if(super(e),this.it=U,e.type!==xn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===tt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};gr.directiveName="unsafeHTML",gr.resultType=1;var nc=kn(gr);var Wh="\xB7 \xB7 \xB7",Vh=re({conversationId:I(N()),messages:I(mt(re({id:N(),timestamp:Te(),role:Ii(["user","assistant","support"]),content:N(),content_html:I(N())})))}),Gh=Io(N(),To([N(),Te(),xe(),Ao()])),Jh=Rn(N(),Co(1),So(1e3)),Ti,Pi,Q,Oo,On,mr,le,_r,sc,oc,ac,lc,uc,cc,dc,Fo,Fn=class Fn extends G(B){constructor(){super();y(this,Q);y(this,Ti);y(this,Pi);y(this,mr,new Tn(this,{typingStarted:()=>f(this,le).sendUserTypingStart(),typingStopped:()=>f(this,le).sendUserTypingStop()}));y(this,le,new In(this,{url:t=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&f(this,Q,Fo)?.scrollTo(0,f(this,Q,Fo).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(f(this,Q,On))},onConnect:t=>{},persistConversationState:(t,r)=>{localStorage.setItem(f(this,Q,On),JSON.stringify({conversationId:t,messages:r}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,Q,On))||"{}"),r=tc(Vh,t);return{conversationId:r.conversationId||"",messages:r.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));y(this,_r,"single");this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get widgetId(){return this.config.widgetId}get conversationId(){return f(this,le).conversationId}get messages(){return f(this,le).messages}firstUpdated(){A(this,Q,Oo).call(this)}updated(){A(this,Q,Oo).call(this)}render(){console.assert(this.config,"config is required");let t=Ku(this.messages,r=>{try{let n=new Date(r.timestamp),s=Math.floor(n.getUTCMinutes()/5)*5;return n.setUTCMinutes(s,0,0),n.valueOf().toString()}catch(n){console.error(n)}});return L`
184
184
  <div class="relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px]">
185
185
  <div
186
186
  class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px]">
@@ -189,8 +189,8 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
189
189
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
190
190
  ?show-new-chat="${!f(this,le).isLiveMode&&this.messages.length>0}"
191
191
  ?show-close="${this.showClose}"
192
- @mw:new-chat-click="${$(this,Q,Qu)}"
193
- @mw:close-click="${$(this,Q,ec)}">
192
+ @mw:new-chat-click="${A(this,Q,cc)}"
193
+ @mw:close-click="${A(this,Q,dc)}">
194
194
  </mw-chat-header>
195
195
 
196
196
  <!-- used by the dashboard to inject content -->
@@ -223,19 +223,19 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
223
223
  <!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
224
224
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
225
225
  <div class="${this.messages.length>0?"pt-20":""}">
226
- ${sr(Array.from(t),([r])=>r,([r,n])=>L`
227
- <div class="my-2 text-center text-xs text-gray-500">${ju(new Date(Number(r)),window.navigator.language)}</div>
228
- ${sr(n??[],s=>s.id,(s,o)=>{let a=n[o+1]?.role===s.role,p=(o>0?n[o-1]:void 0)?.role===s.role,d=(n.length>0?n[n.length-1]:void 0)?.id===s.id;R(this,fr,d&&!p&&!a?"single-current":!p&&!a?"single":!p&&a?"first":d&&p&&!a?"last-current":p&&!a?"last":p&&a?"middle":"single");let g=f(this,le).isLiveMode&&s.role==="user"&&s.id===f(this,le).lastMsg?.id?"sent":"";return L`
226
+ ${ur(Array.from(t),([r])=>r,([r,n])=>L`
227
+ <div class="my-2 text-center text-xs text-gray-500">${Zu(new Date(Number(r)),window.navigator.language)}</div>
228
+ ${ur(n??[],s=>s.id,(s,o)=>{let a=n[o+1]?.role===s.role,d=(o>0?n[o-1]:void 0)?.role===s.role,p=(n.length>0?n[n.length-1]:void 0)?.id===s.id;C(this,_r,p&&!d&&!a?"single-current":!d&&!a?"single":!d&&a?"first":p&&d&&!a?"last-current":d&&!a?"last":d&&a?"middle":"single");let g=f(this,le).isLiveMode&&s.role==="user"&&s.id===f(this,le).lastMsg?.id?"sent":"";return L`
229
229
  <div class="${a?"mb-[2px]":"mb-3"} mx-2 flex-row">
230
230
  <mw-chat-message
231
231
  color="${this.config.color}"
232
232
  status="${g}"
233
233
  logo="${s.metadata?.avatar||this.config.logoUrl}"
234
234
  side="${s.role}"
235
- position=${f(this,fr)}
236
- @click="${$(this,Q,Xu)}">
235
+ position=${f(this,_r)}
236
+ @click="${A(this,Q,sc)}">
237
237
  <div class="prose break-words text-inherit">
238
- ${s.content===Ph?L`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?Gu(s.content_html):L`<p>${s.content}</p>`}
238
+ ${s.content===Wh?L`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?nc(s.content_html):L`<p>${s.content}</p>`}
239
239
  </div>
240
240
  </mw-chat-message>
241
241
  </div>
@@ -260,14 +260,14 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
260
260
  class="flex-grow"
261
261
  .examples="${this.messages.length>0?[]:this.config.examples}"
262
262
  color="${this.config.color}"
263
- @mw:example-click="${$(this,Q,Ju)}"></mw-chat-background>
263
+ @mw:example-click="${A(this,Q,oc)}"></mw-chat-background>
264
264
  </div>
265
265
 
266
266
  <div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
267
267
  <mw-chat-input
268
- @mw:change="${$(this,Q,Ku)}"
269
- @mw:submit="${$(this,Q,Yu)}"
270
- @mw:cancel="${$(this,Q,Zu)}"
268
+ @mw:change="${A(this,Q,lc)}"
269
+ @mw:submit="${A(this,Q,ac)}"
270
+ @mw:cancel="${A(this,Q,uc)}"
271
271
  placeholder="${this.config.input?.placeholder}"
272
272
  ?disabled="${f(this,le).ranOutOfCredits}"
273
273
  ?streaming="${f(this,le)?.isStreaming??!0}">
@@ -282,7 +282,7 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
282
282
  </div>
283
283
  </div>
284
284
  </div>
285
- `}reloadConfig(){f(this,le).reloadConfig(),this.requestUpdate()}};$i=new WeakMap,Ai=new WeakMap,Q=new WeakSet,Co=function(){if(this.xUserData){let t;try{t=JSON.parse(this.xUserData)}catch(n){console.error("Molin: x-user-data is not valid JSON",n)}let r=So(Oh,t);r.success?R(this,$i,r.output):console.error("Molin: x-user-data does not pass schema validation",r.issues)}if(this.xPromptExt){let t=So(Fh,this.xPromptExt);t.success?R(this,Ai,t.output):console.error("Molin: x-prompt-ext does not pass schema validation",t.issues)}},$n=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},hr=new WeakMap,le=new WeakMap,fr=new WeakMap,Xu=function(t){let r=t.target;if(r instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:r.href,conversationId:this.conversationId}),window.self!==window.top){window.open(r.href,"_blank");return}window.open(r.href,r.target)}},Ju=function(t){let r=t.detail.example;if(!f(this,le)?.sendUserInput(r,{xUserData:f(this,$i),xPromptExt:f(this,Ai)})){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!0,conversationId:this.conversationId})},Yu=function(t){let r=t.detail;if(!f(this,le)?.sendUserInput(r,{xUserData:f(this,$i),xPromptExt:f(this,Ai)})){t.preventDefault();return}f(this,hr).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId})},Ku=function(t){f(this,hr).onInput(t.detail.full)},Zu=function(){f(this,le)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Qu=function(){f(this,le).reset()},ec=function(){this.dispatchEvent(new An.CloseClickEvent)},$o=function(){return this.renderRoot.querySelector("#scrollable-content")},T(An,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var dr=An,Eo;dr.CloseClickEvent=(Eo=class extends CustomEvent{constructor(e={}){super(dr.CloseClickEvent.type,{...e})}},T(Eo,"type","mw:close-click"),Eo);customElements.get("mw-chat")||customElements.define("mw-chat",dr);var Ao=class extends G(B){constructor(){super(...arguments);T(this,"render",()=>L`
285
+ `}reloadConfig(){f(this,le).reloadConfig(),this.requestUpdate()}};Ti=new WeakMap,Pi=new WeakMap,Q=new WeakSet,Oo=function(){if(this.xUserData){let t;try{t=JSON.parse(this.xUserData)}catch(n){console.error("Molin: x-user-data is not valid JSON",n)}let r=Po(Gh,t);r.success?C(this,Ti,r.output):console.error("Molin: x-user-data does not pass schema validation",r.issues)}if(this.xPromptExt){let t=Po(Jh,this.xPromptExt);t.success?C(this,Pi,t.output):console.error("Molin: x-prompt-ext does not pass schema validation",t.issues)}},On=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},mr=new WeakMap,le=new WeakMap,_r=new WeakMap,sc=function(t){let r=t.target;if(r instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:r.href,conversationId:this.conversationId}),window.self!==window.top){window.open(r.href,"_blank");return}window.open(r.href,r.target)}},oc=function(t){let r=t.detail.example;if(!f(this,le)?.sendUserInput(r,{xUserData:f(this,Ti),xPromptExt:f(this,Pi)})){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!0,conversationId:this.conversationId})},ac=function(t){let r=t.detail;if(!f(this,le)?.sendUserInput(r,{xUserData:f(this,Ti),xPromptExt:f(this,Pi)})){t.preventDefault();return}f(this,mr).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId})},lc=function(t){f(this,mr).onInput(t.detail.full)},uc=function(){f(this,le)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},cc=function(){f(this,le).reset()},dc=function(){this.dispatchEvent(new Fn.CloseClickEvent)},Fo=function(){return this.renderRoot.querySelector("#scrollable-content")},P(Fn,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var vr=Fn,Ro;vr.CloseClickEvent=(Ro=class extends CustomEvent{constructor(e={}){super(vr.CloseClickEvent.type,{...e})}},P(Ro,"type","mw:close-click"),Ro);customElements.get("mw-chat")||customElements.define("mw-chat",vr);var Do=class extends G(B){constructor(){super(...arguments);P(this,"render",()=>L`
286
286
  <svg class="leading-0 inline-block h-full w-full" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
287
287
  <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
288
288
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -294,35 +294,35 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
294
294
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
295
295
  </circle>
296
296
  </svg>
297
- `)}};customElements.get("mw-loading")||customElements.define("mw-loading",Ao);var Ii,tc,ic,gr=class gr extends G(B){constructor(){super();b(this,Ii);T(this,"render",()=>L`
297
+ `)}};customElements.get("mw-loading")||customElements.define("mw-loading",Do);var Ri,pc,hc,yr=class yr extends G(B){constructor(){super();y(this,Ri);P(this,"render",()=>L`
298
298
  <!-- wrapper -->
299
299
  <div class="group relative z-[2147483647] w-[300px] cursor-pointer select-none rounded-2xl rounded-t-2xl bg-white font-sans text-base leading-normal shadow-2xl">
300
300
  <!-- close button -->
301
301
  <button
302
302
  class="absolute -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 pb-[2px] text-center text-gray-700 opacity-0 shadow transition-opacity duration-300 ease-in-out group-hover:opacity-100"
303
- @click="${$(this,Ii,tc)}"
303
+ @click="${A(this,Ri,pc)}"
304
304
  aria-label="Close">
305
305
  ×
306
306
  </button>
307
307
 
308
308
  <!-- content -->
309
- <div class="p-4 text-left text-gray-800" @click="${$(this,Ii,ic)}">
309
+ <div class="p-4 text-left text-gray-800" @click="${A(this,Ri,hc)}">
310
310
  <p>${this.text}</p>
311
311
  </div>
312
312
  </div>
313
- `);this.text="Hello there. How can we help?"}};Ii=new WeakSet,tc=function(){this.dispatchEvent(new gr.CloseEvent)},ic=function(){this.dispatchEvent(new gr.ClickEvent)},T(gr,"properties",{text:{type:String}});var Zt=gr,Io;Zt.CloseEvent=(Io=class extends CustomEvent{constructor(e={}){super(Zt.CloseEvent.type,{...e})}},T(Io,"type","mw:close"),Io);var To;Zt.ClickEvent=(To=class extends CustomEvent{constructor(e={}){super(Zt.ClickEvent.type,{...e})}},T(To,"type","mw:click"),To);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Zt);var Ti,rc,nc,vr=class vr extends G(B){constructor(){super();b(this,Ti);T(this,"render",()=>L`
313
+ `);this.text="Hello there. How can we help?"}};Ri=new WeakSet,pc=function(){this.dispatchEvent(new yr.CloseEvent)},hc=function(){this.dispatchEvent(new yr.ClickEvent)},P(yr,"properties",{text:{type:String}});var ti=yr,Mo;ti.CloseEvent=(Mo=class extends CustomEvent{constructor(e={}){super(ti.CloseEvent.type,{...e})}},P(Mo,"type","mw:close"),Mo);var Lo;ti.ClickEvent=(Lo=class extends CustomEvent{constructor(e={}){super(ti.ClickEvent.type,{...e})}},P(Lo,"type","mw:click"),Lo);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",ti);var Oi,fc,gc,br=class br extends G(B){constructor(){super();y(this,Oi);P(this,"render",()=>L`
314
314
  <!-- wrapper -->
315
315
  <div class="group relative z-[2147483647] select-none rounded-t-2xl bg-white text-left font-sans text-[16px] text-base leading-normal text-gray-800 shadow-2xl transition-all">
316
316
  <!-- close button -->
317
317
  <button
318
318
  class="absolute right-4 top-[28px] inline-flex h-7 w-7 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 pb-[2px] text-center text-xl shadow-none duration-300 ease-in-out focus:outline-none"
319
- @click="${$(this,Ti,rc)}"
319
+ @click="${A(this,Oi,fc)}"
320
320
  aria-label="Close">
321
321
  ×
322
322
  </button>
323
323
 
324
324
  <!-- content -->
325
- <div class="p-4 text-gray-800" @click="${$(this,Ti,nc)}">
325
+ <div class="p-4 text-gray-800" @click="${A(this,Oi,gc)}">
326
326
  <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
327
327
  <p class="py-2.5 text-left">${this.text}</p>
328
328
  <div class="h-4"></div>
@@ -335,26 +335,26 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
335
335
  <!-- can append any other content -->
336
336
  <slot name="footer"></slot>
337
337
  </div>
338
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Ti=new WeakSet,rc=function(){this.dispatchEvent(new vr.CloseEvent)},nc=function(){this.dispatchEvent(new vr.ClickEvent)},T(vr,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Qt=vr,Po;Qt.CloseEvent=(Po=class extends CustomEvent{constructor(e={}){super(Qt.CloseEvent.type,{...e})}},T(Po,"type","mw:close"),Po);var Ro;Qt.ClickEvent=(Ro=class extends CustomEvent{constructor(e={}){super(Qt.ClickEvent.type,{...e})}},T(Ro,"type","mw:click"),Ro);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Qt);var Pi,mr,ei,In=class{constructor(e,t){b(this,Pi);b(this,mr,!1);b(this,ei,()=>{f(this,mr)||(f(this,Pi).userFirstInteracted?.(),R(this,mr,!0)),f(this,Pi).userInteracted?.()});R(this,Pi,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",f(this,ei)),window.addEventListener("keydown",f(this,ei))}stopListening(){window.removeEventListener("click",f(this,ei)),window.removeEventListener("keydown",f(this,ei))}};Pi=new WeakMap,mr=new WeakMap,ei=new WeakMap;var Mh=24*60*60*1e3,Ri,ze,ti,_r,ii,yr,Pn,sc,Tn=class{constructor(e,t,r=Date){b(this,Pn);b(this,Ri);b(this,ze);b(this,ti);b(this,_r);b(this,ii,!1);b(this,yr,!1);R(this,Ri,e),R(this,ze,t),R(this,ti,r),e.addController(this)}get showing(){return f(this,ii)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!f(this,ii)&&(R(this,ii,!0),f(this,Ri).requestUpdate(),e)){f(this,ze).playPopupSound();let t=f(this,ze).getPersistedState();f(this,ze).setPersistedState({...t,playedSoundOnce:!0})}}hide(){R(this,yr,!0),this.abortAutoShowTimer(),R(this,ii,!1),f(this,Ri).requestUpdate()}abortAutoShowTimer(){clearTimeout(f(this,_r))}onCloseClick(){let e=f(this,ze).getPersistedState();f(this,ze).setPersistedState({...e,userDismissedAt:f(this,ti).now()}),this.hide()}onContentClick(){let e=f(this,ze).getPersistedState();f(this,ze).setPersistedState({...e,userDismissedAt:f(this,ti).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),f(this,yr)||R(this,_r,setTimeout(()=>$(this,Pn,sc).call(this),f(this,ze).getDelayMs()))}};Ri=new WeakMap,ze=new WeakMap,ti=new WeakMap,_r=new WeakMap,ii=new WeakMap,yr=new WeakMap,Pn=new WeakSet,sc=function(){let e=f(this,ze).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&f(this,ti).now()-e.userDismissedAt<Mh||this.show({sound:!t})};var It,Mo,vt,Rn,Fo,On=class On extends G(B){constructor(){super();b(this,vt);b(this,It,new Tn(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));b(this,Mo,new In(this,f(this,It)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=f(this,It).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return L`
338
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Oi=new WeakSet,fc=function(){this.dispatchEvent(new br.CloseEvent)},gc=function(){this.dispatchEvent(new br.ClickEvent)},P(br,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var ii=br,No;ii.CloseEvent=(No=class extends CustomEvent{constructor(e={}){super(ii.CloseEvent.type,{...e})}},P(No,"type","mw:close"),No);var Uo;ii.ClickEvent=(Uo=class extends CustomEvent{constructor(e={}){super(ii.ClickEvent.type,{...e})}},P(Uo,"type","mw:click"),Uo);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",ii);var Fi,wr,ri,Dn=class{constructor(e,t){y(this,Fi);y(this,wr,!1);y(this,ri,()=>{f(this,wr)||(f(this,Fi).userFirstInteracted?.(),C(this,wr,!0)),f(this,Fi).userInteracted?.()});C(this,Fi,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",f(this,ri)),window.addEventListener("keydown",f(this,ri))}stopListening(){window.removeEventListener("click",f(this,ri)),window.removeEventListener("keydown",f(this,ri))}};Fi=new WeakMap,wr=new WeakMap,ri=new WeakMap;var Xh=24*60*60*1e3,Di,Ve,ni,xr,si,kr,Ln,vc,Mn=class{constructor(e,t,r=Date){y(this,Ln);y(this,Di);y(this,Ve);y(this,ni);y(this,xr);y(this,si,!1);y(this,kr,!1);C(this,Di,e),C(this,Ve,t),C(this,ni,r),e.addController(this)}get showing(){return f(this,si)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!f(this,si)&&(C(this,si,!0),f(this,Di).requestUpdate(),e)){f(this,Ve).playPopupSound();let t=f(this,Ve).getPersistedState();f(this,Ve).setPersistedState({...t,playedSoundOnce:!0})}}hide(){C(this,kr,!0),this.abortAutoShowTimer(),C(this,si,!1),f(this,Di).requestUpdate()}abortAutoShowTimer(){clearTimeout(f(this,xr))}onCloseClick(){let e=f(this,Ve).getPersistedState();f(this,Ve).setPersistedState({...e,userDismissedAt:f(this,ni).now()}),this.hide()}onContentClick(){let e=f(this,Ve).getPersistedState();f(this,Ve).setPersistedState({...e,userDismissedAt:f(this,ni).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),f(this,kr)||C(this,xr,setTimeout(()=>A(this,Ln,vc).call(this),f(this,Ve).getDelayMs()))}};Di=new WeakMap,Ve=new WeakMap,ni=new WeakMap,xr=new WeakMap,si=new WeakMap,kr=new WeakMap,Ln=new WeakSet,vc=function(){let e=f(this,Ve).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&f(this,ni).now()-e.userDismissedAt<Xh||this.show({sound:!t})};var Rt,Bo,_t,Nn,qo,Un=class Un extends G(B){constructor(){super();y(this,_t);y(this,Rt,new Mn(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));y(this,Bo,new Dn(this,f(this,Rt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=f(this,Rt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return L`
339
339
  <!-- mobile shadow backdrop -->
340
- <div @click="${$(this,vt,Rn)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
340
+ <div @click="${A(this,_t,Nn)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
341
341
 
342
342
  <!-- mobile overlay -->
343
343
  <div class="${t} fixed bottom-0 left-0 right-0 z-[2147483647] sm:hidden">
344
- <mw-popup-mobile title="${r.mobile.title}" text="${r.mobile.text}" button="${r.mobile.button}" color="${r.mobile.color}" @mw:click="${$(this,vt,Fo)}" @mw:close="${$(this,vt,Rn)}">
344
+ <mw-popup-mobile title="${r.mobile.title}" text="${r.mobile.text}" button="${r.mobile.button}" color="${r.mobile.color}" @mw:click="${A(this,_t,qo)}" @mw:close="${A(this,_t,Nn)}">
345
345
  ${r.mobile.poweredBy?L`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:U}
346
346
  </mw-popup-mobile>
347
347
  </div>
348
348
 
349
349
  <!-- desktop -->
350
350
  <div class="${t} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
351
- <mw-popup-desktop text="${r.desktop.text}" @mw:click="${$(this,vt,Fo)}" @mw:close="${$(this,vt,Rn)}"></mw-popup-desktop>
351
+ <mw-popup-desktop text="${r.desktop.text}" @mw:click="${A(this,_t,qo)}" @mw:close="${A(this,_t,Nn)}"></mw-popup-desktop>
352
352
  </div>
353
- `}hide(){f(this,It).hide()}};It=new WeakMap,Mo=new WeakMap,vt=new WeakSet,Rn=function(){f(this,It).onCloseClick()},Fo=function(){this.dispatchEvent(new On.ClickEvent),f(this,It).onContentClick()},T(On,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var br=On,Oo;br.ClickEvent=(Oo=class extends CustomEvent{constructor(e={}){super(br.ClickEvent.type,{...e})}},T(Oo,"type","mw:click"),Oo);customElements.get("mw-popup")||customElements.define("mw-popup",br);var Dh="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Do=class extends G(B){constructor(){super(...arguments);T(this,"render",()=>L`
353
+ `}hide(){f(this,Rt).hide()}};Rt=new WeakMap,Bo=new WeakMap,_t=new WeakSet,Nn=function(){f(this,Rt).onCloseClick()},qo=function(){this.dispatchEvent(new Un.ClickEvent),f(this,Rt).onContentClick()},P(Un,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Sr=Un,jo;Sr.ClickEvent=(jo=class extends CustomEvent{constructor(e={}){super(Sr.ClickEvent.type,{...e})}},P(jo,"type","mw:click"),jo);customElements.get("mw-popup")||customElements.define("mw-popup",Sr);var Yh="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Ho=class extends G(B){constructor(){super(...arguments);P(this,"render",()=>L`
354
354
  <p class="flex items-center justify-center whitespace-nowrap text-xs">
355
355
  <span>Powered by</span>
356
356
 
357
- <a href="${Dh}" target="_blank" class="inline-flex items-center underline">
357
+ <a href="${Yh}" target="_blank" class="inline-flex items-center underline">
358
358
  <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
359
359
  <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
360
360
  <path
@@ -373,15 +373,15 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
373
373
  <span>Molin AI</span>
374
374
  </a>
375
375
  </p>
376
- `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Do);var Mn,oc,Fn=class extends G(B){constructor(){super();b(this,Mn);T(this,"render",()=>L`
376
+ `)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Ho);var qn,mc,jn=class extends G(B){constructor(){super();y(this,qn);P(this,"render",()=>L`
377
377
  <span class="relative inline-flex">
378
378
  <slot></slot>
379
- <span class="${f(this,Mn,oc)} pointer-events-none absolute z-10 flex h-3 w-3">
379
+ <span class="${f(this,qn,mc)} pointer-events-none absolute z-10 flex h-3 w-3">
380
380
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
381
381
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
382
382
  </span>
383
383
  </span>
384
- `);this.color="sky-500",this.position="top-right"}};Mn=new WeakSet,oc=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},T(Fn,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Fn);var Dn=class extends G(B){constructor(){super();T(this,"render",()=>L`
384
+ `);this.color="sky-500",this.position="top-right"}};qn=new WeakSet,mc=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},P(jn,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",jn);var Bn=class extends G(B){constructor(){super();P(this,"render",()=>L`
385
385
  <div class="${this.positionClasses} fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base">
386
386
  <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
387
387
 
@@ -394,46 +394,46 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
394
394
  stroke-linecap="round"></path>
395
395
  </svg>
396
396
  </div>
397
- `);this.positionClasses="",this.text="Try it out"}};T(Dn,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Dn);window.__INIT_MOLIN_SHOP_AI=function(e){if(Lh(e),e.auto){let t=document.createElement("molin-shop-ai");t.setAttribute("cdn",e.cdn),t.setAttribute("widget",e.widgetId),document.body.appendChild(t)}};function Lh(i){window.__INIT_MOLIN_SHOP_AI_OPTIONS=i}function ac(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var ri,wr,Tt,ni,Nn,lc,Ln=class{constructor(e,t,r){b(this,Nn);b(this,ri);b(this,wr);b(this,Tt);b(this,ni);T(this,"isLoading",!1);T(this,"data");R(this,ri,e),R(this,wr,t),R(this,Tt,r),e.addController(this)}fetch(){if(this.isLoading)return;f(this,ni)?.abort();let e=new AbortController;R(this,ni,e),this.isLoading=!0,this.data=void 0,f(this,ri).requestUpdate(),(async()=>{let t=$(this,Nn,lc).call(this);return t.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(t,{signal:e.signal})})().then(async t=>{if(!t.ok)throw new Error(`${t.statusText}: ${await t.text()}`);this.isLoading=!1,this.data=typeof f(this,Tt)?.transform=="function"?await f(this,Tt).transform(t):t,f(this,ri).requestUpdate()}).catch(t=>{f(this,Tt)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,ri).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,Tt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,ni)?.abort(),R(this,ni,void 0)}};ri=new WeakMap,wr=new WeakMap,Tt=new WeakMap,ni=new WeakMap,Nn=new WeakSet,lc=function(){let e=f(this,wr);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var lt,xr,Oi,Fi,Pt=class{constructor(e,t){b(this,lt);b(this,xr);b(this,Oi);b(this,Fi);R(this,lt,e),R(this,xr,t),e.addController(this)}get data(){return f(this,Fi)||f(this,Oi)?.data}hostConnected(){if(f(this,Oi)||f(this,Fi))return;let e=ac();e&&e.widgetId===f(this,lt).widgetId?R(this,Fi,e.config):R(this,Oi,new Ln(f(this,lt),()=>{if(f(this,lt).cdn&&f(this,lt).widgetId)return`${f(this,lt).cdn}/config?w=${f(this,lt).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:f(this,xr)?.onError}))}};lt=new WeakMap,xr=new WeakMap,Oi=new WeakMap,Fi=new WeakMap;var v=typeof window<"u"?window:void 0,qe=typeof globalThis<"u"?globalThis:v,sp=Array.prototype,uc=sp.forEach,cc=sp.indexOf,Ve=qe?.navigator,I=qe?.document,Ue=qe?.location,Go=qe?.fetch,Xo=qe!=null&&qe.XMLHttpRequest&&"withCredentials"in new qe.XMLHttpRequest?qe.XMLHttpRequest:void 0,pc=qe?.AbortController,we=Ve?.userAgent,j=v??{},Ot={DEBUG:!1,LIB_VERSION:"1.187.2"},Yn={},gs=function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Ui(i,e,t){if(pe(i)){if(uc&&i.forEach===uc)i.forEach(e,t);else if("length"in i&&i.length===+i.length){for(var r=0,n=i.length;r<n;r++)if(r in i&&e.call(t,i[r],r)===Yn)return}}}function K(i,e,t){if(!ee(i)){if(pe(i))return Ui(i,e,t);if(Hh(i)){for(var r of i.entries())if(e.call(t,r[1],r[0])===Yn)return}else for(var n in i)if(lp.call(i,n)&&e.call(t,i[n],n)===Yn)return}}var Oe=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Ui(t,function(n){for(var s in n)n[s]!==void 0&&(i[s]=n[s])}),i};function H(i,e){return i.indexOf(e)!==-1}function Xn(i){for(var e=Object.keys(i),t=e.length,r=new Array(t);t--;)r[t]=[e[t],i[e[t]]];return r}var dc=function(i){try{return i()}catch{return}},Nh=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.apply(this,t)}catch(n){_.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_.critical(n)}}},Kn=function(i){var e={};return K(i,function(t,r){Ie(t)&&t.length>0&&(e[r]=t)}),e},Jo=function(i){return i.replace(/^\$/,"")};function Uh(i,e){return t=i,r=s=>Ie(s)&&!qt(e)?s.slice(0,e):s,n=new Set,function s(o,l){return o!==Object(o)?r?r(o,l):o:n.has(o)?void 0:(n.add(o),pe(o)?(a=[],Ui(o,c=>{a.push(s(c))})):(a={},K(o,(c,p)=>{n.has(c)||(a[p]=s(c,p))})),a);var a}(t);var t,r,n}var qh=function(i){var e,t,r,n,s="";for(e=t=0,r=(i=(i+"").replace(/\r\n/g,`
397
+ `);this.positionClasses="",this.text="Try it out"}};P(Bn,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Bn);window.__INIT_MOLIN_SHOP_AI=function(e){if(Kh(e),e.auto){let t=document.createElement("molin-shop-ai");t.setAttribute("cdn",e.cdn),t.setAttribute("widget",e.widgetId),document.body.appendChild(t)}};function Kh(i){window.__INIT_MOLIN_SHOP_AI_OPTIONS=i}function _c(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Oe,yt,zn,Er,Mi,zo=class{constructor(){y(this,Oe,[]);y(this,yt);y(this,zn,10);y(this,Er,5e3);y(this,Mi,!1)}async add(e,t){if(f(this,Oe).push({event:e,properties:Object.assign({},t,wc()),distinct_id:bc(t.distinct_id),timestamp:new Date().toISOString()}),f(this,Oe).length>=f(this,zn))return this.flush();f(this,yt)||C(this,yt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Er)))}async flush(){if(f(this,Mi)||f(this,Oe).length===0)return;let e=[...f(this,Oe)];try{C(this,Mi,!0),clearTimeout(f(this,yt)),C(this,yt,void 0),C(this,Oe,[]);let t=new AbortController,r=setTimeout(()=>t.abort(),5e3),n=await fetch(new URL("/widgets/data/collect",Wo()).href,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:e}),signal:t.signal});if(clearTimeout(r),!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n}catch(t){if(t.name==="AbortError")console.error("Request timed out, retrying events"),C(this,Oe,[...e,...f(this,Oe)]);else{console.error("Failed to send events to backend:",t);let r=e.filter(n=>n.event.includes("error"));C(this,Oe,[...r,...f(this,Oe)])}}finally{C(this,Mi,!1),f(this,Oe).length>0&&!f(this,yt)&&C(this,yt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Er)))}}async flushBeforeUnload(){if(f(this,Oe).length>0)try{navigator.sendBeacon(new URL("/widgets/data/collect",Wo()).href,JSON.stringify({events:f(this,Oe)}))}catch(e){console.error("Failed to send final events:",e)}}};Oe=new WeakMap,yt=new WeakMap,zn=new WeakMap,Er=new WeakMap,Mi=new WeakMap;var yc=new zo;window.addEventListener("unload",()=>{yc.flushBeforeUnload().catch(console.error)});async function pe(i,e){try{if(e.immediate){let t=await fetch(new URL("/widgets/data/collect",Wo()).href,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:i,properties:Object.assign({},e,wc()),distinct_id:bc(e.distinct_id)})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}return yc.add(i,e)}catch(t){console.error("Failed to send event:",t)}}function bc(i=crypto.randomUUID()){let e="molin_shop_assistant_distinct_id";try{let t=localStorage.getItem(e);return t||(t=i,localStorage.setItem(e,t)),t}catch(t){console.error("Failed to handle distinct ID:",t);try{localStorage.setItem(e,i)}catch(r){console.error("Failed to store new distinct ID:",r)}return i}}function wc(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack}}var Hn;function Wo(){if(Hn)return Hn;let i=new URL(import.meta.url).hostname;return Hn=new Map([["localhost","http://localhost:8787"],["widget.molin.foo","https://molin.foo"],["widget.molin.ai","https://molin.ai"]]).get(i)||"https://molin.ai",Hn}var oi,Cr,Ot,ai,Vn,kc,Wn=class{constructor(e,t,r){y(this,Vn);y(this,oi);y(this,Cr);y(this,Ot);y(this,ai);P(this,"isLoading",!1);P(this,"data");C(this,oi,e),C(this,Cr,t),C(this,Ot,r),e.addController(this)}fetch(){if(this.isLoading)return;f(this,ai)?.abort();let e=new AbortController;C(this,ai,e),this.isLoading=!0,this.data=void 0,f(this,oi).requestUpdate(),(async()=>{let t=A(this,Vn,kc).call(this);return t.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(t,{signal:e.signal})})().then(async t=>{if(!t.ok)throw new Error(`${t.statusText}: ${await t.text()}`);this.isLoading=!1,this.data=typeof f(this,Ot)?.transform=="function"?await f(this,Ot).transform(t):t,f(this,oi).requestUpdate()}).catch(t=>{f(this,Ot)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,oi).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,Ot)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,ai)?.abort(),C(this,ai,void 0)}};oi=new WeakMap,Cr=new WeakMap,Ot=new WeakMap,ai=new WeakMap,Vn=new WeakSet,kc=function(){let e=f(this,Cr);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ct,$r,Li,Ni,Ft=class{constructor(e,t){y(this,ct);y(this,$r);y(this,Li);y(this,Ni);C(this,ct,e),C(this,$r,t),e.addController(this)}get data(){return f(this,Ni)||f(this,Li)?.data}hostConnected(){if(f(this,Li)||f(this,Ni))return;let e=_c();e&&e.widgetId===f(this,ct).widgetId?C(this,Ni,e.config):C(this,Li,new Wn(f(this,ct),()=>{if(f(this,ct).cdn&&f(this,ct).widgetId)return`${f(this,ct).cdn}/config?w=${f(this,ct).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:f(this,$r)?.onError}))}};ct=new WeakMap,$r=new WeakMap,Li=new WeakMap,Ni=new WeakMap;var v=typeof window<"u"?window:void 0,Be=typeof globalThis<"u"?globalThis:v,bd=Array.prototype,Sc=bd.forEach,Ec=bd.indexOf,Je=Be?.navigator,T=Be?.document,qe=Be?.location,ia=Be?.fetch,ra=Be!=null&&Be.XMLHttpRequest&&"withCredentials"in new Be.XMLHttpRequest?Be.XMLHttpRequest:void 0,Cc=Be?.AbortController,ke=Je?.userAgent,q=v??{},Mt={DEBUG:!1,LIB_VERSION:"1.187.2"},ns={},ks=function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Hi(i,e,t){if(he(i)){if(Sc&&i.forEach===Sc)i.forEach(e,t);else if("length"in i&&i.length===+i.length){for(var r=0,n=i.length;r<n;r++)if(r in i&&e.call(t,i[r],r)===ns)return}}}function K(i,e,t){if(!ee(i)){if(he(i))return Hi(i,e,t);if(nf(i)){for(var r of i.entries())if(e.call(t,r[1],r[0])===ns)return}else for(var n in i)if(kd.call(i,n)&&e.call(t,i[n],n)===ns)return}}var De=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Hi(t,function(n){for(var s in n)n[s]!==void 0&&(i[s]=n[s])}),i};function H(i,e){return i.indexOf(e)!==-1}function is(i){for(var e=Object.keys(i),t=e.length,r=new Array(t);t--;)r[t]=[e[t],i[e[t]]];return r}var $c=function(i){try{return i()}catch{return}},Zh=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.apply(this,t)}catch(n){_.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_.critical(n)}}},ss=function(i){var e={};return K(i,function(t,r){Pe(t)&&t.length>0&&(e[r]=t)}),e},na=function(i){return i.replace(/^\$/,"")};function Qh(i,e){return t=i,r=s=>Pe(s)&&!Ht(e)?s.slice(0,e):s,n=new Set,function s(o,l){return o!==Object(o)?r?r(o,l):o:n.has(o)?void 0:(n.add(o),he(o)?(a=[],Hi(o,c=>{a.push(s(c))})):(a={},K(o,(c,d)=>{n.has(c)||(a[d]=s(c,d))})),a);var a}(t);var t,r,n}var ef=function(i){var e,t,r,n,s="";for(e=t=0,r=(i=(i+"").replace(/\r\n/g,`
398
398
  `).replace(/\r/g,`
399
- `)).length,n=0;n<r;n++){var o=i.charCodeAt(n),l=null;o<128?t++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),qt(l)||(t>e&&(s+=i.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=i.substring(e,i.length)),s},wt=function(){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation),e}return i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},function(e,t,r,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(t,r,!!s);else{var o="on"+t,l=e[o];e[o]=function(a,c,p){return function(u){if(u=u||i(v?.event)){var d,h=!0;Ye(p)&&(d=p(u));var g=c.call(a,u);return d!==!1&&g!==!1||(h=!1),h}}}(e,r,l)}else _.error("No valid element provided to register_event")}}();function op(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}var st,Lo="$copy_autocapture",jh=["$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(i){i.GZipJS="gzip-js",i.Base64="base64"})(st||(st={}));var Bh=Array.isArray,ap=Object.prototype,lp=ap.hasOwnProperty,vs=ap.toString,pe=Bh||function(i){return vs.call(i)==="[object Array]"},Ye=i=>typeof i=="function",de=i=>i===Object(i)&&!pe(i),Di=i=>{if(de(i)){for(var e in i)if(lp.call(i,e))return!1;return!0}return!1},F=i=>i===void 0,Ie=i=>vs.call(i)=="[object String]",hc=i=>Ie(i)&&i.trim().length===0,qt=i=>i===null,ee=i=>F(i)||qt(i),We=i=>vs.call(i)=="[object Number]",ui=i=>vs.call(i)==="[object Boolean]",Hh=i=>i instanceof FormData,zh=i=>H(jh,i),fc="[PostHog.js]",_={_log:function(i){if(v&&(Ot.DEBUG||j.POSTHOG_DEBUG)&&!F(v.console)&&v.console){for(var e=("__rrweb_original__"in v.console[i])?v.console[i].__rrweb_original__:v.console[i],t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];e(fc,...r)}},info:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];_._log("log",...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];_._log("warn",...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];_._log("error",...e)},critical:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];console.error(fc,...e)},uninitializedWarning:i=>{_.error("You must initialize PostHog before calling ".concat(i))}},gc=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return _.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var r=()=>{if(!I)return t("document not found");var n=I.createElement("script");n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=l=>t(void 0,l),n.onerror=l=>t(l);var s,o=I.querySelectorAll("body > script");o.length>0?(s=o[0].parentNode)===null||s===void 0||s.insertBefore(n,o[0]):I.body.appendChild(n)};I!=null&&I.body?r():I?.addEventListener("DOMContentLoaded",r)};function vc(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function S(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vc(Object(t),!0).forEach(function(r){C(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):vc(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function C(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Wh(i,e){if(i==null)return{};var t,r,n=function(o,l){if(o==null)return{};var a,c,p={},u=Object.keys(o);for(c=0;c<u.length;c++)a=u[c],l.indexOf(a)>=0||(p[a]=o[a]);return p}(i,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}j.__PosthogExtensions__=j.__PosthogExtensions__||{},j.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{var r="/static/".concat(e,".js")+"?v=".concat(i.version);if(e==="toolbar"){var n=3e5,s=Math.floor(Date.now()/n)*n;r="".concat(r,"&t=").concat(s)}var o=i.requestRouter.endpointFor("assets",r);gc(i,o,t)},j.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var r=i.requestRouter.endpointFor("api",e);gc(i,r,t)};var up="$people_distinct_id",$r="__alias",Ar="__timers",mc="$autocapture_disabled_server_side",Yo="$heatmaps_enabled_server_side",_c="$exception_capture_enabled_server_side",yc="$web_vitals_enabled_server_side",cp="$dead_clicks_enabled_server_side",bc="$web_vitals_allowed_metrics",Ko="$session_recording_enabled_server_side",wc="$console_log_recording_enabled_server_side",xc="$session_recording_network_payload_capture",kc="$session_recording_canvas_recording",Sc="$replay_sample_rate",Ec="$replay_minimum_duration",Zn="$sesid",Ir="$session_is_sampled",No="$session_recording_url_trigger_activated_session",Uo="$session_recording_event_trigger_activated_session",Li="$enabled_feature_flags",Zo="$early_access_features",Ni="$stored_person_properties",Ft="$stored_group_properties",Qo="$surveys",Un="$surveys_activated",Qn="$flag_call_reported",_t="$user_state",ea="$client_session_props",ta="$capture_rate_limit",ia="$initial_campaign_params",ra="$initial_referrer_info",Cc="$initial_person_info",es="$epp",pp="__POSTHOG_TOOLBAR__",Vh=[up,$r,"__cmpns",Ar,Ko,Yo,Zn,Li,_t,Zo,Ft,Ni,Qo,Qn,ea,ta,ia,ra,es],qo="$active_feature_flags",qn="$override_feature_flags",$c="$feature_flag_payloads",Ac=i=>{var e={};for(var[t,r]of Xn(i||{}))r&&(e[t]=r);return e},na=class{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(Li),t=this.instance.get_property(qn);if(!t)return e||{};for(var r=Oe({},e),n=Object.keys(t),s=0;s<n.length;s++)r[n[s]]=t[n[s]];return this._override_warning||(_.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){return this.instance.get_property($c)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())},5)}_reloadFeatureFlagsRequest(){if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var e=this.instance.config.token,t=this.instance.get_property(Ni),r=this.instance.get_property(Ft),n={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:n,compression:this.instance.config.disable_compression?void 0:st.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:s=>{var o;this.setReloadingPaused(!1);var l=!0;s.statusCode===200&&(this.$anon_distinct_id=void 0,l=!1),this.receivedFeatureFlags((o=s.json)!==null&&o!==void 0?o:{},l),this._startReloadTimer()}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r,n=this.getFlagVariants()[e],s="".concat(n),o=this.instance.get_property(Qn)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(pe(o[e])?o[e].push(s):o[e]=[s],(r=this.instance.persistence)===null||r===void 0||r.register({[Qn]:o}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}_.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);_.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.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads();(function(s,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s.featureFlags,p=s.featureFlagPayloads;if(c)if(pe(c)){var u={};if(c)for(var d=0;d<c.length;d++)u[c[d]]=!0;o&&o.register({[qo]:c,[Li]:u})}else{var h=c,g=p;s.errorsWhileComputingFlags&&(h=S(S({},l),h),g=S(S({},a),g)),o&&o.register({[qo]:Object.keys(Ac(h)),[Li]:h||{},[$c]:g||{}})}})(e,this.instance.persistence,r,n),this._fireFeatureFlagsCallbacks(t)}}override(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return _.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(qn);else if(pe(e)){for(var r={},n=0;n<e.length;n++)r[e[n]]=!0;this.instance.persistence.register({[qn]:r})}else this.instance.persistence.register({[qn]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var r,n={["$feature_enrollment/".concat(e)]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:n}),this.setPersonPropertiesForFlags(n,!1);var s=S(S({},this.getFlagVariants()),{},{[e]:t});(r=this.instance.persistence)===null||r===void 0||r.register({[qo]:Object.keys(Ac(s)),[Li]:s}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(Zo);if(r&&!t)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:n=>{var s;if(n.json){var o=n.json.earlyAccessFeatures;return(s=this.instance.persistence)===null||s===void 0||s.register({[Zo]:o}),e(o)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(r=>t[r]),flagVariants:Object.keys(t).filter(r=>t[r]).reduce((r,n)=>(r[n]=t[n],r),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(n=>n(t,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ni)||{};this.instance.register({[Ni]:S(S({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Ni)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ft)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(n=>{r[n]=S(S({},r[n]),e[n]),delete e[n]}),this.instance.register({[Ft]:S(S({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(Ft)||{};this.instance.register({[Ft]:S(S({},t),{},{[e]:{}})})}else this.instance.unregister(Ft)}};Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return We(i)&&isFinite(i)&&Math.floor(i)===i});var Ic="0123456789abcdef",sa=class i{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new i(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Ic.charAt(this.bytes[t]>>>4)+Ic.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 i(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(r!==0)return Math.sign(r)}return 0}},oa=class{constructor(){C(this,"timestamp",0),C(this,"counter",0),C(this,"random",new aa)}generate(){var e=this.generateOrAbort();if(F(e)){this.timestamp=0;var t=this.generateOrAbort();if(F(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return sa.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}},Tc,dp=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<i.length;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};v&&!F(v.crypto)&&crypto.getRandomValues&&(dp=i=>crypto.getRandomValues(i));var aa=class{constructor(){C(this,"buffer",new Uint32Array(8)),C(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(dp(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},Dt=()=>Gh().toString(),Gh=()=>(Tc||(Tc=new oa)).generate(),Xh="Thu, 01 Jan 1970 00:00:00 GMT",kr="",Jh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Yh(i,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:I;if(kr)return kr;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var o=n.split("."),l=Math.min(o.length,8),a="dmn_chk_"+Dt(),c=new RegExp("(^|;)\\s*"+a+"=1");!kr&&l--;){var p=o.slice(l).join("."),u=a+"=1;domain=."+p;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+Xh,kr=p)}return kr}(i);if(!t){var r=(n=>{var s=n.match(Jh);return s?s[0]:""})(i);r!==t&&_.info("Warning: cookie subdomain discovery mismatch",r,t),t=r}return t?"; domain=."+t:""}return""}var kt={is_supported:()=>!!I,error:function(i){_.error("cookieStore error: "+i)},get:function(i){if(I){try{for(var e=i+"=",t=I.cookie.split(";").filter(s=>s.length),r=0;r<t.length;r++){for(var n=t[r];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},parse:function(i){var e;try{e=JSON.parse(kt.get(i))||{}}catch{}return e},set:function(i,e,t,r,n){if(I)try{var s="",o="",l=Yh(I.location.hostname,r);if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),s="; expires="+a.toUTCString()}n&&(o="; secure");var c=i+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&_.warn("cookieStore warning: large cookie, len="+c.length),I.cookie=c,c}catch{return}},remove:function(i,e){try{kt.set(i,"",-1,e)}catch{return}}},jo=null,ge={is_supported:function(){if(!qt(jo))return jo;var i=!0;if(F(v))i=!1;else try{var e="__mplssupport__";ge.set(e,"xyz"),ge.get(e)!=='"xyz"'&&(i=!1),ge.remove(e)}catch{i=!1}return i||_.error("localStorage unsupported; falling back to cookie store"),jo=i,i},error:function(i){_.error("localStorage error: "+i)},get:function(i){try{return v?.localStorage.getItem(i)}catch(e){ge.error(e)}return null},parse:function(i){try{return JSON.parse(ge.get(i))||{}}catch{}return null},set:function(i,e){try{v?.localStorage.setItem(i,JSON.stringify(e))}catch(t){ge.error(t)}},remove:function(i){try{v?.localStorage.removeItem(i)}catch(e){ge.error(e)}}},Kh=["distinct_id",Zn,Ir,es],jn=S(S({},ge),{},{parse:function(i){try{var e={};try{e=kt.parse(i)||{}}catch{}var t=Oe(e,JSON.parse(ge.get(i)||"{}"));return ge.set(i,t),t}catch{}return null},set:function(i,e,t,r,n,s){try{ge.set(i,e,void 0,void 0,s);var o={};Kh.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&kt.set(i,o,t,r,n,s)}catch(l){ge.error(l)}},remove:function(i,e){try{v?.localStorage.removeItem(i),kt.remove(i,e)}catch(t){ge.error(t)}}}),Bn={},Zh={is_supported:function(){return!0},error:function(i){_.error("memoryStorage error: "+i)},get:function(i){return Bn[i]||null},parse:function(i){return Bn[i]||null},set:function(i,e){Bn[i]=e},remove:function(i){delete Bn[i]}},si=null,Se={is_supported:function(){if(!qt(si))return si;if(si=!0,F(v))si=!1;else try{var i="__support__";Se.set(i,"xyz"),Se.get(i)!=='"xyz"'&&(si=!1),Se.remove(i)}catch{si=!1}return si},error:function(i){_.error("sessionStorage error: ",i)},get:function(i){try{return v?.sessionStorage.getItem(i)}catch(e){Se.error(e)}return null},parse:function(i){try{return JSON.parse(Se.get(i))||null}catch{}return null},set:function(i,e){try{v?.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){Se.error(t)}},remove:function(i){try{v?.sessionStorage.removeItem(i)}catch(e){Se.error(e)}}},Qh=["localhost","127.0.0.1"],Pr=i=>{var e=I?.createElement("a");return F(e)?null:(e.href=i,e)},Bi=function(i,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(i)},ef=function(i){var e,t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",n=[];return K(i,function(s,o){F(s)||F(o)||o==="undefined"||(e=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),t=encodeURIComponent(o),n[n.length]=t+"="+e)}),n.join(r)},ts=function(i,e){for(var t,r=((i.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<r.length;n++){var s=r[n].split("=");if(s[0]===e){t=s;break}}if(!pe(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{_.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},is=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Ke="Mobile",rs="iOS",ut="Android",Dr="Tablet",hp=ut+" "+Dr,fp="iPad",gp="Apple",vp=gp+" Watch",Lr="Safari",Hi="BlackBerry",mp="Samsung",_p=mp+"Browser",yp=mp+" Internet",Nt="Chrome",tf=Nt+" OS",bp=Nt+" "+rs,Ya="Internet Explorer",wp=Ya+" "+Ke,Ka="Opera",rf=Ka+" Mini",Za="Edge",xp="Microsoft "+Za,qi="Firefox",kp=qi+" "+rs,Nr="Nintendo",Ur="PlayStation",ji="Xbox",Sp=ut+" "+Ke,Ep=Ke+" "+Lr,Tr="Windows",la=Tr+" Phone",Pc="Nokia",ua="Ouya",Cp="Generic",nf=Cp+" "+Ke.toLowerCase(),$p=Cp+" "+Dr.toLowerCase(),ca="Konqueror",Re="(\\d+(\\.\\d+)?)",Bo=new RegExp("Version/"+Re),sf=new RegExp(ji,"i"),of=new RegExp(Ur+" \\w+","i"),af=new RegExp(Nr+" \\w+","i"),Qa=new RegExp(Hi+"|PlayBook|BB10","i"),lf={"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"},uf=(i,e)=>e&&H(e,gp)||function(t){return H(t,Lr)&&!H(t,Nt)&&!H(t,ut)}(i),Rc=function(i,e){return e=e||"",H(i," OPR/")&&H(i,"Mini")?rf:H(i," OPR/")?Ka:Qa.test(i)?Hi:H(i,"IE"+Ke)||H(i,"WPDesktop")?wp:H(i,_p)?yp:H(i,Za)||H(i,"Edg/")?xp:H(i,"FBIOS")?"Facebook "+Ke:H(i,"UCWEB")||H(i,"UCBrowser")?"UC Browser":H(i,"CriOS")?bp:H(i,"CrMo")?Nt:H(i,ut)&&H(i,Lr)?Sp:H(i,Nt)?Nt:H(i,"FxiOS")?kp:H(i.toLowerCase(),ca.toLowerCase())?ca:uf(i,e)?H(i,Ke)?Ep:Lr:H(i,qi)?qi:H(i,"MSIE")||H(i,"Trident/")?Ya:H(i,"Gecko")?qi:""},cf={[wp]:[new RegExp("rv:"+Re)],[xp]:[new RegExp(Za+"?\\/"+Re)],[Nt]:[new RegExp("("+Nt+"|CrMo)\\/"+Re)],[bp]:[new RegExp("CriOS\\/"+Re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Re)],[Lr]:[Bo],[Ep]:[Bo],[Ka]:[new RegExp("(Opera|OPR)\\/"+Re)],[qi]:[new RegExp(qi+"\\/"+Re)],[kp]:[new RegExp("FxiOS\\/"+Re)],[ca]:[new RegExp("Konqueror[:/]?"+Re,"i")],[Hi]:[new RegExp(Hi+" "+Re),Bo],[Sp]:[new RegExp("android\\s"+Re,"i")],[yp]:[new RegExp(_p+"\\/"+Re)],[Ya]:[new RegExp("(rv:|MSIE )"+Re)],Mozilla:[new RegExp("rv:"+Re)]},Oc=[[new RegExp(ji+"; "+ji+" (.*?)[);]","i"),i=>[ji,i&&i[1]||""]],[new RegExp(Nr,"i"),[Nr,""]],[new RegExp(Ur,"i"),[Ur,""]],[Qa,[Hi,""]],[new RegExp(Tr,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[la,""];if(new RegExp(Ke).test(e)&&!/IEMobile\b/.test(e))return[Tr+" "+Ke,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=t[1],n=lf[r]||"";return/arm/i.test(e)&&(n="RT"),[Tr,n]}return[Tr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[rs,e.join(".")]}return[rs,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=F(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+ut+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ut+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[ut,e.join(".")]}return[ut,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[tf,""]],[/Linux|debian/i,["Linux",""]]],Fc=function(i){return af.test(i)?Nr:of.test(i)?Ur:sf.test(i)?ji:new RegExp(ua,"i").test(i)?ua:new RegExp("("+la+"|WPDesktop)","i").test(i)?la:/iPad/.test(i)?fp:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?vp:Qa.test(i)?Hi:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(Pc,"i").test(i)?Pc:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(Ke).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?ut:hp:ut:new RegExp("(pda|"+Ke+")","i").test(i)?nf:new RegExp(Dr,"i").test(i)&&!new RegExp(Dr+" pc","i").test(i)?$p:""},Hn="https?://(.*)",pf=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],ue={campaignParams:function(i){return I?this._campaignParamsFromUrl(I.URL,i):{}},_campaignParamsFromUrl:function(i,e){var t=pf.concat(e||[]),r={};return K(t,function(n){var s=ts(i,n);r[n]=s||null}),r},_searchEngine:function(i){return i?i.search(Hn+"google.([^/?]*)")===0?"google":i.search(Hn+"bing.com")===0?"bing":i.search(Hn+"yahoo.com")===0?"yahoo":i.search(Hn+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(i){var e=ue._searchEngine(i),t=e!="yahoo"?"q":"p",r={};if(!qt(e)){r.$search_engine=e;var n=I?ts(I.referrer,t):"";n.length&&(r.ph_keyword=n)}return r},searchInfo:function(){var i=I?.referrer;return i?this._searchInfoFromReferrer(i):{}},browser:Rc,browserVersion:function(i,e){var t=Rc(i,e),r=cf[t];if(F(r))return null;for(var n=0;n<r.length;n++){var s=r[n],o=i.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(i){for(var e=0;e<Oc.length;e++){var[t,r]=Oc[e],n=t.exec(i),s=n&&(Ye(r)?r(n,i):r);if(s)return s}return["",""]},device:Fc,deviceType:function(i){var e=Fc(i);return e===fp||e===hp||e==="Kobo"||e==="Kindle Fire"||e===$p?Dr:e===Nr||e===ji||e===Ur||e===ua?"Console":e===vp?"Wearable":e?Ke:"Desktop"},referrer:function(){return I?.referrer||"$direct"},referringDomain:function(){var i;return I!=null&&I.referrer&&((i=Pr(I.referrer))===null||i===void 0?void 0:i.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:Ue?.href}},initialPersonPropsFromInfo:function(i){var e,{r:t,u:r}=i,n={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Pr(t))===null||e===void 0?void 0:e.host};if(r){n.$initial_current_url=r;var s=Pr(r);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,K(this._campaignParamsFromUrl(r),function(o,l){n["$initial_"+Jo(l)]=o})}return t&&K(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+Jo(l)]=o}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},properties:function(){if(!we)return{};var[i,e]=ue.os(we);return Oe(Kn({$os:i,$os_version:e,$browser:ue.browser(we,navigator.vendor),$device:ue.device(we),$device_type:ue.deviceType(we),$timezone:ue.timezone()}),{$current_url:Ue?.href,$host:Ue?.host,$pathname:Ue?.pathname,$raw_user_agent:we.length>1e3?we.substring(0,997)+"...":we,$browser_version:ue.browserVersion(we,navigator.vendor),$browser_language:ue.browserLanguage(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:Ot.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!we)return{};var[i,e]=ue.os(we);return Oe(Kn({$os:i,$os_version:e,$browser:ue.browser(we,navigator.vendor)}),{$browser_version:ue.browserVersion(we,navigator.vendor)})}},df=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Rr=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t=>{var r="";return t.token&&(r=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+r+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&_.info("Persistence loaded",e.persistence,S({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){df.indexOf(e.persistence.toLowerCase())===-1&&(_.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&ge.is_supported()?ge:t==="localstorage+cookie"&&jn.is_supported()?jn:t==="sessionstorage"&&Se.is_supported()?Se:t==="memory"?Zh:t==="cookie"?kt:jn.is_supported()?jn:kt}properties(){var e={};return K(this.props,function(t,r){if(r===Li&&de(t))for(var n=Object.keys(t),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=t[n[s]];else l=r,a=!1,(qt(o=Vh)?a:cc&&o.indexOf===cc?o.indexOf(l)!=-1:(K(o,function(c){if(a||(a=c===l))return Yn}),a))||(e[r]=t);var o,l,a}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Oe({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(de(e)){F(t)&&(t="None"),this.expire_days=F(r)?this.default_expiry:r;var n=!1;if(K(e,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==t||(this.props[o]=s,n=!0)}),n)return this.save(),!0}return!1}register(e,t){if(de(e)){this.expire_days=F(t)?this.default_expiry:t;var r=!1;if(K(e,(n,s)=>{e.hasOwnProperty(s)&&this.props[s]!==n&&(this.props[s]=n,r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=ue.campaignParams(this.config.custom_campaign_params);Di(Kn(e))||this.register(ue.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0}}update_search_keyword(){this.register(ue.searchInfo())}update_referrer_info(){this.register_once(ue.referrerInfo(),void 0)}set_initial_person_info(){this.props[ia]||this.props[ra]||this.register_once({[Cc]:ue.initialPersonInfo()},void 0)}get_referrer_info(){return Kn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};K([ra,ia],n=>{var s=this.props[n];s&&K(s,function(o,l){e["$initial_"+Jo(l)]=o})});var t=this.props[Cc];if(t){var r=ue.initialPersonPropsFromInfo(t);Oe(e,r)}return e}safe_merge(e){return K(this.props,function(t,r){r in e||(e[r]=t)}),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.buildStorage(e),n=this.props;this.clear(),this.storage=r,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Ar]||{};r[e]=t,this.props[Ar]=r,this.save()}remove_event_timer(e){var t=(this.props[Ar]||{})[e];return F(t)||(delete this.props[Ar][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function ns(i){var e,t;return((e=JSON.stringify(i,(t=[],function(r,n){if(de(n)){for(;t.length>0&&t.at(-1)!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n})))===null||e===void 0?void 0:e.length)||0}function pa(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(i.size>=e&&i.data.length>1){var t=Math.floor(i.data.length/2),r=i.data.slice(0,t),n=i.data.slice(t);return[pa({size:ns(r),data:r,sessionId:i.sessionId,windowId:i.windowId}),pa({size:ns(n),data:n,sessionId:i.sessionId,windowId:i.windowId})].flatMap(s=>s)}return[i]}var yt=(i=>(i[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i))(yt||{}),nt=(i=>(i[i.Mutation=0]="Mutation",i[i.MouseMove=1]="MouseMove",i[i.MouseInteraction=2]="MouseInteraction",i[i.Scroll=3]="Scroll",i[i.ViewportResize=4]="ViewportResize",i[i.Input=5]="Input",i[i.TouchMove=6]="TouchMove",i[i.MediaInteraction=7]="MediaInteraction",i[i.StyleSheetRule=8]="StyleSheetRule",i[i.CanvasMutation=9]="CanvasMutation",i[i.Font=10]="Font",i[i.Log=11]="Log",i[i.Drag=12]="Drag",i[i.StyleDeclaration=13]="StyleDeclaration",i[i.Selection=14]="Selection",i[i.AdoptedStyleSheet=15]="AdoptedStyleSheet",i[i.CustomElement=16]="CustomElement",i))(nt||{});function Mc(i){var e;return i.id===pp||!((e=i.closest)===null||e===void 0||!e.call(i,".toolbar-global-fade-container"))}function ms(i){return!!i&&i.nodeType===1}function Ut(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function Ap(i){return!!i&&i.nodeType===3}function Ip(i){return!!i&&i.nodeType===11}function el(i){return i?gs(i).split(/\s+/):[]}function Dc(i){var e=v?.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function ss(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return el(e)}function Tp(i){return ee(i)?null:gs(i).split(/(\s+)/).filter(e=>zi(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function _s(i){var e="";return ha(i)&&!Op(i)&&i.childNodes&&i.childNodes.length&&K(i.childNodes,function(t){var r;Ap(t)&&t.textContent&&(e+=(r=Tp(t.textContent))!==null&&r!==void 0?r:"")}),gs(e)}function Pp(i){return F(i.target)?i.srcElement||null:(e=i.target)!==null&&e!==void 0&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var da=["a","button","form","input","select","textarea","label"];function Rp(i){var e=i.parentNode;return!(!e||!ms(e))&&e}function hf(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!v||!i||Ut(i,"html")||!ms(i)||t!=null&&t.url_allowlist&&!Dc(t.url_allowlist)||t!=null&&t.url_ignorelist&&Dc(t.url_ignorelist))return!1;if(t!=null&&t.dom_event_allowlist){var s=t.dom_event_allowlist;if(s&&!s.some(h=>e.type===h))return!1}for(var o=!1,l=[i],a=!0,c=i;c.parentNode&&!Ut(c,"body");)if(Ip(c.parentNode))l.push(c.parentNode.host),c=c.parentNode.host;else{if(!(a=Rp(c)))break;if(r||da.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{var p=v.getComputedStyle(a);p&&p.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(a),c=a}if(!function(h,g){var m=g?.element_allowlist;if(F(m))return!0;var k=function(O){if(m.some(M=>O.tagName.toLowerCase()===M))return{v:!0}};for(var w of h){var y=k(w);if(typeof y=="object")return y.v}return!1}(l,t)||!function(h,g){var m=g?.css_selector_allowlist;if(F(m))return!0;var k=function(O){if(m.some(M=>O.matches(M)))return{v:!0}};for(var w of h){var y=k(w);if(typeof y=="object")return y.v}return!1}(l,t))return!1;var u=v.getComputedStyle(i);if(u&&u.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var d=i.tagName.toLowerCase();switch(d){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return o?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(da.indexOf(d)>-1||i.getAttribute("contenteditable")==="true")}}function ha(i){for(var e=i;e.parentNode&&!Ut(e,"body");e=e.parentNode){var t=ss(e);if(H(t,"ph-sensitive")||H(t,"ph-no-capture"))return!1}if(H(ss(i),"ph-include"))return!0;var r=i.type||"";if(Ie(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=i.name||i.id||"";return!(Ie(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function Op(i){return!!(Ut(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Ut(i,"select")||Ut(i,"textarea")||i.getAttribute("contenteditable")==="true")}var Fp="(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})",ff=new RegExp("^(?:".concat(Fp,")$")),gf=new RegExp(Fp),Mp="\\d{3}-?\\d{2}-?\\d{4}",vf=new RegExp("^(".concat(Mp,")$")),mf=new RegExp("(".concat(Mp,")"));function zi(i){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(ee(i)||Ie(i)&&(i=gs(i),(e?ff:gf).test((i||"").replace(/[- ]/g,""))||(e?vf:mf).test(i)))}function Dp(i){var e=_s(i);return zi(e="".concat(e," ").concat(Lp(i)).trim())?e:""}function Lp(i){var e="";return i&&i.childNodes&&i.childNodes.length&&K(i.childNodes,function(t){var r;if(t&&((r=t.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var n=_s(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(Lp(t)).trim())}catch(s){_.error(s)}}),e}function _f(i){return function(e){var t=e.map(r=>{var n,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))o+=".".concat(l.replace(/"/g,""));var a=S(S(S(S({},r.text?{text:r.text}:{}),{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),c={};return Xn(a).sort((p,u)=>{var[d]=p,[h]=u;return d.localeCompare(h)}).forEach(p=>{var[u,d]=p;return c[Lc(u.toString())]=Lc(d.toString())}),o+=":",o+=Xn(a).map(p=>{var[u,d]=p;return"".concat(u,'="').concat(d,'"')}).join("")});return t.join(";")}(function(e){return e.map(t=>{var r,n,s={text:(r=t.$el_text)===null||r===void 0?void 0:r.slice(0,400),tag_name:t.tag_name,href:(n=t.attr__href)===null||n===void 0?void 0:n.slice(0,2048),attr_class:yf(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Xn(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,a]=o;return s.attributes[l]=a}),s})}(i))}function Lc(i){return i.replace(/"|\\"/g,'\\"')}function yf(i){var e=i.attr__class;return e?pe(e)?e:el(e):void 0}var fa="[SessionRecording]",ga="redacted",zn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:i=>i,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},bf=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],wf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],xf=["/s/","/e/","/i/"];function Nc(i,e,t,r){if(ee(i))return i;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(i);return Ie(n)&&(n=parseInt(n)),n>t?fa+" ".concat(r," body too large to record (").concat(n," bytes)"):i}function Uc(i,e){if(ee(i))return i;var t=i;return zi(t,!1)||(t=fa+" "+e+" body "+ga),K(wf,r=>{var n,s;(n=t)!==null&&n!==void 0&&n.length&&((s=t)===null||s===void 0?void 0:s.indexOf(r))!==-1&&(t=fa+" "+e+" body "+ga+" as might contain: "+r)}),t}var kf=(i,e)=>{var t,r,n,s={payloadSizeLimitBytes:zn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...zn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...zn.payloadHostDenyList]},o=i.session_recording.recordHeaders!==!1&&e.recordHeaders,l=i.session_recording.recordBody!==!1&&e.recordBody,a=i.capture_performance!==!1&&e.recordPerformance,c=(t=s,n=Math.min(1e6,(r=t.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),d=>(d!=null&&d.requestBody&&(d.requestBody=Nc(d.requestBody,d.requestHeaders,n,"Request")),d!=null&&d.responseBody&&(d.responseBody=Nc(d.responseBody,d.responseHeaders,n,"Response")),d)),p=d=>{return c((m=>{var k=Pr(m.name);if(!(k&&k.pathname&&xf.some(w=>k.pathname.indexOf(w)===0)))return m})((g=(h=d).requestHeaders,ee(g)||K(Object.keys(g??{}),m=>{bf.includes(m.toLowerCase())&&(g[m]=ga)}),h)));var h,g},u=Ye(i.session_recording.maskNetworkRequestFn);return u&&Ye(i.session_recording.maskCapturedNetworkRequestFn)&&_.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(i.session_recording.maskCapturedNetworkRequestFn=d=>{var h=i.session_recording.maskNetworkRequestFn({url:d.name});return S(S({},d),{},{name:h?.url})}),s.maskRequestFn=Ye(i.session_recording.maskCapturedNetworkRequestFn)?d=>{var h,g,m,k=p(d);return k&&(h=(g=(m=i.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,k))!==null&&h!==void 0?h:void 0}:d=>function(h){if(!F(h))return h.requestBody=Uc(h.requestBody,"Request"),h.responseBody=Uc(h.responseBody,"Response"),h}(p(d)),S(S(S({},zn),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function xt(i,e,t,r){return e>t&&(_.warn("min cannot be greater than max."),e=t),We(i)?i>t?(r&&_.warn(r+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(r&&_.warn(r+" cannot be less than min: "+e+". Using min value instead."),e):i:(r&&_.warn(r+" must be a number. Defaulting to max value:"+t),t)}var va=class{constructor(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,"bucketSize",100),C(this,"refillRate",10),C(this,"mutationBuckets",{}),C(this,"loggedTracker",{}),C(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(s=>{this.mutationBuckets[s]=this.mutationBuckets[s]+this.refillRate,this.mutationBuckets[s]>=this.bucketSize&&delete this.mutationBuckets[s]})}),C(this,"getNodeOrRelevantParent",s=>{var o=this.rrweb.mirror.getNode(s);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[this.rrweb.mirror.getId(l),l]}return[s,o]}),C(this,"numberOfChanges",s=>{var o,l,a,c,p,u,d,h;return((o=(l=s.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((a=(c=s.attributes)===null||c===void 0?void 0:c.length)!==null&&a!==void 0?a:0)+((p=(u=s.texts)===null||u===void 0?void 0:u.length)!==null&&p!==void 0?p:0)+((d=(h=s.adds)===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0)}),C(this,"throttleMutations",s=>{if(s.type!==3||s.data.source!==0)return s;var o=s.data,l=this.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(c=>{var p,u,d,[h,g]=this.getNodeOrRelevantParent(c.id);return this.mutationBuckets[h]===0?!1:(this.mutationBuckets[h]=(p=this.mutationBuckets[h])!==null&&p!==void 0?p:this.bucketSize,this.mutationBuckets[h]=Math.max(this.mutationBuckets[h]-1,0),this.mutationBuckets[h]===0&&(this.loggedTracker[h]||(this.loggedTracker[h]=!0,(u=(d=this.options).onBlockedNode)===null||u===void 0||u.call(d,h,g))),c)}));var a=this.numberOfChanges(o);return a!==0||l===a?s:void 0}),this.rrweb=e,this.options=n,this.refillRate=xt((t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=xt((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},Ze=Uint8Array,Fe=Uint16Array,Wi=Uint32Array,tl=new Ze([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]),il=new Ze([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]),qc=new Ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Np=function(i,e){for(var t=new Fe(31),r=0;r<31;++r)t[r]=e+=1<<i[r-1];var n=new Wi(t[30]);for(r=1;r<30;++r)for(var s=t[r];s<t[r+1];++s)n[s]=s-t[r]<<5|r;return[t,n]},Up=Np(tl,2),Sf=Up[0],ma=Up[1];Sf[28]=258,ma[258]=28;for(_a=Np(il,0)[1],os=new Fe(32768),te=0;te<32768;++te)Rt=(43690&te)>>>1|(21845&te)<<1,Rt=(61680&(Rt=(52428&Rt)>>>2|(13107&Rt)<<2))>>>4|(3855&Rt)<<4,os[te]=((65280&Rt)>>>8|(255&Rt)<<8)>>>1;var Rt,_a,os,te,Or=function(i,e,t){for(var r=i.length,n=0,s=new Fe(e);n<r;++n)++s[i[n]-1];var o,l=new Fe(e);for(n=0;n<e;++n)l[n]=l[n-1]+s[n-1]<<1;if(t){o=new Fe(1<<e);var a=15-e;for(n=0;n<r;++n)if(i[n])for(var c=n<<4|i[n],p=e-i[n],u=l[i[n]-1]++<<p,d=u|(1<<p)-1;u<=d;++u)o[os[u]>>>a]=c}else for(o=new Fe(r),n=0;n<r;++n)o[n]=os[l[i[n]-1]++]>>>15-i[n];return o},pi=new Ze(288);for(te=0;te<144;++te)pi[te]=8;for(te=144;te<256;++te)pi[te]=9;for(te=256;te<280;++te)pi[te]=7;for(te=280;te<288;++te)pi[te]=8;var as=new Ze(32);for(te=0;te<32;++te)as[te]=5;var Ef=Or(pi,9,0),Cf=Or(as,5,0),qp=function(i){return(i/8>>0)+(7&i&&1)},jp=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var r=new(i instanceof Fe?Fe:i instanceof Wi?Wi:Ze)(t-e);return r.set(i.subarray(e,t)),r},mt=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8},Sr=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8,i[r+2]|=t>>>16},Ho=function(i,e){for(var t=[],r=0;r<i.length;++r)i[r]&&t.push({s:r,f:i[r]});var n=t.length,s=t.slice();if(!n)return[new Ze(0),0];if(n==1){var o=new Ze(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(z,J){return z.f-J.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],c=0,p=1,u=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};p!=n-1;)l=t[t[c].f<t[u].f?c++:u++],a=t[c!=p&&t[c].f<t[u].f?c++:u++],t[p++]={s:-1,f:l.f+a.f,l,r:a};var d=s[0].s;for(r=1;r<n;++r)s[r].s>d&&(d=s[r].s);var h=new Fe(d+1),g=ya(t[p-1],h,0);if(g>e){r=0;var m=0,k=g-e,w=1<<k;for(s.sort(function(z,J){return h[J.s]-h[z.s]||z.f-J.f});r<n;++r){var y=s[r].s;if(!(h[y]>e))break;m+=w-(1<<g-h[y]),h[y]=e}for(m>>>=k;m>0;){var O=s[r].s;h[O]<e?m-=1<<e-h[O]++-1:++r}for(;r>=0&&m;--r){var M=s[r].s;h[M]==e&&(--h[M],++m)}g=e}return[new Ze(h),g]},ya=function(i,e,t){return i.s==-1?Math.max(ya(i.l,e,t+1),ya(i.r,e,t+1)):e[i.s]=t},jc=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Fe(++e),r=0,n=i[0],s=1,o=function(a){t[r++]=a},l=1;l<=e;++l)if(i[l]==n&&l!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=i[l]}return[t.subarray(0,r),e]},Er=function(i,e){for(var t=0,r=0;r<e.length;++r)t+=i[r]*e[r];return t},ba=function(i,e,t){var r=t.length,n=qp(e+2);i[n]=255&r,i[n+1]=r>>>8,i[n+2]=255^i[n],i[n+3]=255^i[n+1];for(var s=0;s<r;++s)i[n+s+4]=t[s];return 8*(n+4+r)},Bc=function(i,e,t,r,n,s,o,l,a,c,p){mt(e,p++,t),++n[256];for(var u=Ho(n,15),d=u[0],h=u[1],g=Ho(s,15),m=g[0],k=g[1],w=jc(d),y=w[0],O=w[1],M=jc(m),z=M[0],J=M[1],W=new Fe(19),P=0;P<y.length;++P)W[31&y[P]]++;for(P=0;P<z.length;++P)W[31&z[P]]++;for(var q=Ho(W,7),X=q[0],je=q[1],ve=19;ve>4&&!X[qc[ve-1]];--ve);var Ge,Y,ie,ce,De=c+5<<3,Be=Er(n,pi)+Er(s,as)+o,ae=Er(n,d)+Er(s,m)+o+14+3*ve+Er(W,X)+(2*W[16]+3*W[17]+7*W[18]);if(De<=Be&&De<=ae)return ba(e,p,i.subarray(a,a+c));if(mt(e,p,1+(ae<Be)),p+=2,ae<Be){Ge=Or(d,h,0),Y=d,ie=Or(m,k,0),ce=m;var Ee=Or(X,je,0);for(mt(e,p,O-257),mt(e,p+5,J-1),mt(e,p+10,ve-4),p+=14,P=0;P<ve;++P)mt(e,p+3*P,X[qc[P]]);p+=3*ve;for(var Ce=[y,z],ne=0;ne<2;++ne){var me=Ce[ne];for(P=0;P<me.length;++P){var Pe=31&me[P];mt(e,p,Ee[Pe]),p+=X[Pe],Pe>15&&(mt(e,p,me[P]>>>5&127),p+=me[P]>>>12)}}}else Ge=Ef,Y=pi,ie=Cf,ce=as;for(P=0;P<l;++P)if(r[P]>255){Pe=r[P]>>>18&31,Sr(e,p,Ge[Pe+257]),p+=Y[Pe+257],Pe>7&&(mt(e,p,r[P]>>>23&31),p+=tl[Pe]);var hi=31&r[P];Sr(e,p,ie[hi]),p+=ce[hi],hi>3&&(Sr(e,p,r[P]>>>5&8191),p+=il[hi])}else Sr(e,p,Ge[r[P]]),p+=Y[r[P]];return Sr(e,p,Ge[256]),p+Y[256]},$f=new Wi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Af=function(){for(var i=new Wi(256),e=0;e<256;++e){for(var t=e,r=9;--r;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),If=function(){var i=4294967295;return{p:function(e){for(var t=i,r=0;r<e.length;++r)t=Af[255&t^e[r]]^t>>>8;i=t},d:function(){return 4294967295^i}}},Tf=function(i,e,t,r,n){return function(s,o,l,a,c,p){var u=s.length,d=new Ze(a+u+5*(1+Math.floor(u/7e3))+c),h=d.subarray(a,d.length-c),g=0;if(!o||u<8)for(var m=0;m<=u;m+=65535){var k=m+65535;k<u?g=ba(h,g,s.subarray(m,k)):(h[m]=p,g=ba(h,g,s.subarray(m,u)))}else{for(var w=$f[o-1],y=w>>>13,O=8191&w,M=(1<<l)-1,z=new Fe(32768),J=new Fe(M+1),W=Math.ceil(l/3),P=2*W,q=function(As){return(s[As]^s[As+1]<<W^s[As+2]<<P)&M},X=new Wi(25e3),je=new Fe(288),ve=new Fe(32),Ge=0,Y=0,ie=(m=0,0),ce=0,De=0;m<u;++m){var Be=q(m),ae=32767&m,Ee=J[Be];if(z[ae]=Ee,J[Be]=ae,ce<=m){var Ce=u-m;if((Ge>7e3||ie>24576)&&Ce>423){g=Bc(s,h,0,X,je,ve,Y,ie,De,m-De,g),ie=Ge=Y=0,De=m;for(var ne=0;ne<286;++ne)je[ne]=0;for(ne=0;ne<30;++ne)ve[ne]=0}var me=2,Pe=0,hi=O,St=ae-Ee&32767;if(Ce>2&&Be==q(m-St))for(var yd=Math.min(y,Ce)-1,bd=Math.min(32767,m),wd=Math.min(258,Ce);St<=bd&&--hi&&ae!=Ee;){if(s[m+me]==s[m+me-St]){for(var Et=0;Et<wd&&s[m+Et]==s[m+Et-St];++Et);if(Et>me){if(me=Et,Pe=St,Et>yd)break;var xd=Math.min(St,Et-2),hl=0;for(ne=0;ne<xd;++ne){var $s=m-St+ne+32768&32767,fl=$s-z[$s]+32768&32767;fl>hl&&(hl=fl,Ee=$s)}}}St+=(ae=Ee)-(Ee=z[ae])+32768&32767}if(Pe){X[ie++]=268435456|ma[me]<<18|_a[Pe];var gl=31&ma[me],vl=31&_a[Pe];Y+=tl[gl]+il[vl],++je[257+gl],++ve[vl],ce=m+me,++Ge}else X[ie++]=s[m],++je[s[m]]}}g=Bc(s,h,p,X,je,ve,Y,ie,De,m-De,g)}return jp(d,0,a+qp(g)+c)}(i,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+e.mem,t,r,!n)},wa=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},Pf=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&wa(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var r=0;r<=t.length;++r)i[r+10]=t.charCodeAt(r)}},Rf=function(i){return 10+(i.filename&&i.filename.length+1||0)};function Bp(i,e){e===void 0&&(e={});var t=If(),r=i.length;t.p(i);var n=Tf(i,e,Rf(e),8),s=n.length;return Pf(n,e),wa(n,s-8,t.d()),wa(n,s-4,r),n}function Hp(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var r=new Ze(i.length+(i.length>>>1)),n=0,s=function(c){r[n++]=c},o=0;o<t;++o){if(n+5>r.length){var l=new Ze(n+8+(t-o<<1));l.set(r),r=l}var a=i.charCodeAt(o);a<128||e?s(a):a<2048?(s(192|a>>>6),s(128|63&a)):a>55295&&a<57344?(s(240|(a=65536+(1047552&a)|1023&i.charCodeAt(++o))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return jp(r,0,n)}var Of=3e5,Ff=[nt.MouseMove,nt.MouseInteraction,nt.Scroll,nt.ViewportResize,nt.Input,nt.TouchMove,nt.MediaInteraction,nt.Drag],Hc=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1}),ke="[SessionRecording]";function oi(i){return function(e,t){for(var r="",n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(Bp(Hp(JSON.stringify(i))),!0)}function zc(i){return i.type===yt.Custom&&i.data.tag==="sessionIdle"}function Wc(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}var xa=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return j==null||(e=j.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(ke+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return this.triggerStatus==="trigger_pending"?6e4:(e=(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:Of}get isSampled(){var e=this.instance.get_property(Ir);return ui(e)?e:null}get sessionDuration(){var e,t,r=(e=this.buffer)===null||e===void 0?void 0:e.data[((t=this.buffer)===null||t===void 0?void 0:t.data.length)-1],{sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(Ko),t=!this.instance.config.disable_session_recording;return v&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(wc),t=this.instance.config.enable_recording_console_log;return t??e}get canvasRecording(){var e,t,r,n,s,o,l=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(kc),c=(e=(t=l?.recordCanvas)!==null&&t!==void 0?t:a?.enabled)!==null&&e!==void 0&&e,p=(r=(n=l?.canvasFps)!==null&&n!==void 0?n:a?.fps)!==null&&r!==void 0?r:0,u=(s=(o=l?.canvasQuality)!==null&&o!==void 0?o:a?.quality)!==null&&s!==void 0?s:0;return{enabled:c,fps:xt(p,0,12,"canvas recording fps"),quality:xt(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(xc),n={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordBody},s=n?.recordHeaders||r?.recordHeaders,o=n?.recordBody||r?.recordBody,l=de(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(ui(l)?l:r?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(Sc);return We(e)?e:null}get minimumDuration(){var e=this.instance.get_property(Ec);return We(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?ee(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":this._urlBlocked?"paused":ui(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return this._urlTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(No))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return this._eventTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(Uo))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",t=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(C(this,"queuedRRWebEvents",[]),C(this,"isIdle",!1),C(this,"_linkedFlagSeen",!1),C(this,"_lastActivityTimestamp",Date.now()),C(this,"_linkedFlag",null),C(this,"_removePageViewCaptureHook",void 0),C(this,"_onSessionIdListener",void 0),C(this,"_persistDecideOnSessionListener",void 0),C(this,"_samplingSessionListener",void 0),C(this,"_urlTriggers",[]),C(this,"_urlBlocklist",[]),C(this,"_urlBlocked",!1),C(this,"_eventTriggers",[]),C(this,"_removeEventTriggerCaptureHook",void 0),C(this,"_forceAllowLocalhostNetworkCapture",!1),C(this,"_onBeforeUnload",()=>{this._flushBuffer()}),C(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),C(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),C(this,"_onVisibilityChange",()=>{if(I!=null&&I.visibilityState){var n="window "+I.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw _.error(ke+" started without valid sessionManager"),new Error(ke+" started without valid sessionManager. This is a bug.");var{sessionId:t,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&_.warn(ke+" session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),v?.addEventListener("beforeunload",this._onBeforeUnload),v?.addEventListener("offline",this._onOffline),v?.addEventListener("online",this._onOnline),v?.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),ee(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(t=>{try{if(t==="$pageview"){var r=v?this._maskUrl(v.location.href):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(n){_.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((t,r,n)=>{var s,o,l,a;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:t,windowId:r,changeReason:n}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(Uo),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(No))}))):this.stopRecording()}stopRecording(){var e,t,r,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,v?.removeEventListener("beforeunload",this._onBeforeUnload),v?.removeEventListener("offline",this._onOffline),v?.removeEventListener("online",this._onOnline),v?.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(e=this._removePageViewCaptureHook)===null||e===void 0||e.call(this),this._removePageViewCaptureHook=void 0,(t=this._removeEventTriggerCaptureHook)===null||t===void 0||t.call(this),this._removeEventTriggerCaptureHook=void 0,(r=this._onSessionIdListener)===null||r===void 0||r.call(this),this._onSessionIdListener=void 0,(n=this._samplingSessionListener)===null||n===void 0||n.call(this),this._samplingSessionListener=void 0,_.info(ke+" stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if(We(n)){var s,o=this.isSampled,l=r||!ui(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):_.warn(ke+" Sample rate (".concat(n,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:n,isSampled:s})),(t=this.instance.persistence)===null||t===void 0||t.register({[Ir]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[Ir]:null})}}afterDecideResponse(e){var t,r,n,s,o,l;if(this._persistDecideResponse(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(r=e.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(l=e.sessionRecording)===null||l===void 0?void 0:l.endpoint),this._setupSampling(),!ee(this._linkedFlag)&&!this._linkedFlagSeen){var a=Ie(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,c=Ie(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((p,u)=>{var d=de(u)&&a in u,h=c?u[a]===c:d;h&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:c}),this._linkedFlagSeen=h})}(n=e.sessionRecording)!==null&&n!==void 0&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),(s=e.sessionRecording)!==null&&s!==void 0&&s.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),(o=e.sessionRecording)!==null&&o!==void 0&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){We(this.sampleRate)&&ee(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistDecideResponse(e){if(this.instance.persistence){var t,r=this.instance.persistence,n=()=>{var s,o,l,a,c,p,u,d=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,h=ee(d)?null:parseFloat(d),g=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;r.register({[Ko]:!!e.sessionRecording,[wc]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[xc]:S({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[kc]:{enabled:(c=e.sessionRecording)===null||c===void 0?void 0:c.recordCanvas,fps:(p=e.sessionRecording)===null||p===void 0?void 0:p.canvasFps,quality:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasQuality},[Sc]:h,[Ec]:F(g)?null:g})};n(),(t=this._persistDecideOnSessionListener)===null||t===void 0||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(n)}}log(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!F(Object.assign)&&!F(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,r;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=j.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"recorder",n=>{if(n)return _.error(ke+" could not load recorder",n);this._onScriptLoaded()}),_.info(ke+" starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return e.type===3&&Ff.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)),!this.isIdle){var{windowId:n,sessionId:s}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==s,l=this.windowId!==n;this.windowId=n,this.sessionId=s,o||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):_.warn(ke+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Hc(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Hc(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var e,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording;for(var[n,s]of Object.entries(r||{}))n in t&&(n==="maskInputOptions"?t.maskInputOptions=S({password:!0},s):t[n]=s);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new va(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(l,a)=>{var c="Too many mutations on node '".concat(l,"'. Rate limiting. This could be due to SVG animations or something similar");_.info(c,{node:a}),this.log(ke+" "+c,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(S({emit:l=>{this.onRRwebEmit(l)},plugins:o},t)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:o.map(l=>l?.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else _.error(ke+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}}_gatherRRWebPlugins(){var e,t,r,n,s=[],o=(e=j.__PosthogExtensions__)===null||e===void 0||(t=e.rrwebPlugins)===null||t===void 0?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var l=(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ye(l)&&(!Qh.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(kf(this.instance.config,this.networkPayloadCapture))):_.info(ke+" NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&de(e)){if(e.type===yt.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(u){return u.type===yt.Custom&&u.data.tag==="recording paused"}(e)){e.type===yt.FullSnapshot&&this._scheduleFullSnapshot(),e.type===yt.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var s=function(u){var d=u;if(d&&de(d)&&d.type===6&&de(d.data)&&d.data.plugin==="rrweb/console@1"){d.data.payload.payload.length>10&&(d.data.payload.payload=d.data.payload.payload.slice(0,10),d.data.payload.payload.push("...[truncated]"));for(var h=[],g=0;g<d.data.payload.payload.length;g++)d.data.payload.payload[g]&&d.data.payload.payload[g].length>2e3?h.push(d.data.payload.payload[g].slice(0,2e3)+"...[truncated]"):h.push(d.data.payload.payload[g]);return d.data.payload.payload=h,u}return u}(n);if(this._updateWindowAndSessionIds(s),!this.isIdle||zc(s)){if(zc(s)){var o=s.data.payload;if(o){var l=o.lastActivityTimestamp,a=o.threshold;s.timestamp=l+a}}var c=(t=this.instance.config.session_recording.compress_events)===null||t===void 0||t?function(u){if(ns(u)<1024)return u;try{if(u.type===yt.FullSnapshot)return S(S({},u),{},{data:oi(u.data),cv:"2024-10"});if(u.type===yt.IncrementalSnapshot&&u.data.source===nt.Mutation)return S(S({},u),{},{cv:"2024-10",data:S(S({},u.data),{},{texts:oi(u.data.texts),attributes:oi(u.data.attributes),removes:oi(u.data.removes),adds:oi(u.data.adds)})});if(u.type===yt.IncrementalSnapshot&&u.data.source===nt.StyleSheetRule)return S(S({},u),{},{cv:"2024-10",data:S(S({},u.data),{},{adds:oi(u.data.adds),removes:oi(u.data.removes)})})}catch(d){_.error(ke+" could not compress event - will use uncompressed event",d)}return u}(s):s,p={$snapshot_bytes:ns(c),$snapshot_data:c,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(p):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&v){var e=this._maskUrl(v.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this._tryRRWebMethod(t)})}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var r,n={url:e};return(r=n=t.maskNetworkRequestFn(n))===null||r===void 0?void 0:r.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,r=We(t)&&t>=0,n=We(e)&&r&&t<e;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&pa(this.buffer).forEach(s=>{this._captureSnapshot({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(v!==void 0&&v.location.href){var e=v.location.href,t=this.status==="paused",r=Wc(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),Wc(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,r;this.triggerStatus==="trigger_pending"&&((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[e==="url"?No:Uo]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;this.status!=="paused"&&(this._urlBlocked=!0,I==null||(e=I.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout(()=>{this._flushBuffer()},100),_.info(ke+" recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;this.status==="paused"&&(this._urlBlocked=!1,I==null||(e=I.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.remove("ph-no-capture"),this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),_.info(ke+" recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&ee(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(t){_.error(ke+"Could not activate event trigger",t)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;(e=this.instance.persistence)===null||e===void 0||e.register({[Ir]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),_.info(ke+" "+e.replace("_"," "),t),H(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},ka=class{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){var e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ni),group_properties:this.instance.get_property(Ft),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:e,compression:this.instance.config.disable_compression?void 0:st.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:t=>this.parseDecideResponse(t.json)})}parseDecideResponse(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var r=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},r),r)_.error("Failed to fetch feature flags from PostHog.");else{if(!I||!I.body)return _.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var n=function(l,a){var c,p;j["__$$ph_site_app_".concat(l)]=t.instance,(c=j.__PosthogExtensions__)===null||c===void 0||(p=c.loadSiteApp)===null||p===void 0||p.call(c,t.instance,a,u=>{if(u)return _.error("Error while initializing PostHog app with config id ".concat(l),u)})};for(var{id:s,url:o}of e.siteApps)n(s,o)}else e.siteApps.length>0&&_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},bt,Mf=v!=null&&v.location?is(v.location.hash,"__posthog")||is(location.hash,"state"):null,Vc="_postHogToolbarParams";(function(i){i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED"})(bt||(bt={}));var Sa=class{constructor(e){this.instance=e}setToolbarState(e){j.ph_toolbar_state=e}getToolbarState(){var e;return(e=j.ph_toolbar_state)!==null&&e!==void 0?e:bt.UNINITIALIZED}maybeLoadToolbar(){var e,t,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!v||!I)return!1;r=(e=r)!==null&&e!==void 0?e:v.location,s=(t=s)!==null&&t!==void 0?t:v.history;try{if(!n){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}n=v?.localStorage}var o,l=Mf||is(r.hash,"__posthog")||is(r.hash,"state"),a=l?dc(()=>JSON.parse(atob(decodeURIComponent(l))))||dc(()=>JSON.parse(decodeURIComponent(l))):null;return a&&a.action==="ph_authorize"?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?r.hash=a.desiredHash:s?s.replaceState(s.state,"",r.pathname+r.search):r.hash="")):((o=JSON.parse(n.getItem(Vc)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){(j.ph_load_toolbar||j.ph_load_editor)(e,this.instance)}loadToolbar(e){var t=!(I==null||!I.getElementById(pp));if(!v||t)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=S(S({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(v.localStorage.setItem(Vc,JSON.stringify(S(S({},n),{},{source:void 0}))),this.getToolbarState()===bt.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===bt.UNINITIALIZED){var s,o;this.setToolbarState(bt.LOADING),(s=j.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return _.error("Failed to load toolbar",l),void this.setToolbarState(bt.UNINITIALIZED);this.setToolbarState(bt.LOADED),this._callLoadToolbar(n)}),wt(v,"turbolinks:load",()=>{this.setToolbarState(bt.UNINITIALIZED),this.loadToolbar(n)})}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,r)}},Ea=class{constructor(e){C(this,"isPaused",!0),C(this,"queue",[]),C(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},t=Object.values(e),r=[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)];r.map(n=>{this.sendRequest(S(S({},n),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),r=function(s){var o=t[s],l=new Date().getTime();o.data&&pe(o.data)&&K(o.data,a=>{a.offset=Math.abs(a.timestamp-l),delete a.timestamp}),e.sendRequest(o)};for(var n in t)r(n)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return K(this.queue,t=>{var r,n=t,s=(n?n.batchKey:null)||n.url;F(e[s])&&(e[s]=S(S({},n),{},{data:[]})),(r=e[s].data)===null||r===void 0||r.push(n.data)}),this.queue=[],e}},Df=!!Xo||!!Go,Gc="text/plain",ls=(i,e)=>{var[t,r]=i.split("?"),n=S({},e);r?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=ef(n);return s=s?(r?r+"&":"")+s:r,"".concat(t,"?").concat(s)},zo=i=>{var{data:e,compression:t}=i;if(e){if(t===st.GZipJS){var r=Bp(Hp(JSON.stringify(e)),{mtime:0}),n=new Blob([r],{type:Gc});return{contentType:Gc,body:n,estimatedSize:n.size}}if(t===st.Base64){var s=function(a){var c,p,u,d,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,k=0,w="",y=[];if(!a)return a;a=qh(a);do c=(h=a.charCodeAt(m++)<<16|a.charCodeAt(m++)<<8|a.charCodeAt(m++))>>18&63,p=h>>12&63,u=h>>6&63,d=63&h,y[k++]=g.charAt(c)+g.charAt(p)+g.charAt(u)+g.charAt(d);while(m<a.length);switch(w=y.join(""),a.length%3){case 1:w=w.slice(0,-2)+"==";break;case 2:w=w.slice(0,-1)+"="}return w}(JSON.stringify(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:JSON.stringify(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=JSON.stringify(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},Fr=[];Xo&&Fr.push({transport:"XHR",method:i=>{var e,t=new Xo;t.open(i.method||"GET",i.url,!0);var{contentType:r,body:n}=(e=zo(i))!==null&&e!==void 0?e:{};K(i.headers,function(s,o){t.setRequestHeader(o,s)}),r&&t.setRequestHeader("Content-Type",r),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var s,o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}(s=i.callback)===null||s===void 0||s.call(i,o)}},t.send(n)}}),Go&&Fr.push({transport:"fetch",method:i=>{var e,t,{contentType:r,body:n,estimatedSize:s}=(e=zo(i))!==null&&e!==void 0?e:{},o=new Headers;K(i.headers,function(p,u){o.append(u,p)}),r&&o.append("Content-Type",r);var l=i.url,a=null;if(pc){var c=new pc;a={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}Go(l,{method:i?.method||"GET",headers:o,keepalive:i.method==="POST"&&(s||0)<52428.8,body:n,signal:(t=a)===null||t===void 0?void 0:t.signal}).then(p=>p.text().then(u=>{var d,h={statusCode:p.status,text:u};if(p.status===200)try{h.json=JSON.parse(u)}catch(g){_.error(g)}(d=i.callback)===null||d===void 0||d.call(i,h)})).catch(p=>{var u;_.error(p),(u=i.callback)===null||u===void 0||u.call(i,{statusCode:0,text:p})}).finally(()=>a?clearTimeout(a.timeout):null)}}),Ve!=null&&Ve.sendBeacon&&Fr.push({transport:"sendBeacon",method:i=>{var e=ls(i.url,{beacon:"1"});try{var t,{contentType:r,body:n}=(t=zo(i))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:r}):n;Ve.sendBeacon(e,s)}catch{}}});var Lf=["retriesPerformedSoFar"],Ca=class{constructor(e){C(this,"isPolling",!1),C(this,"pollIntervalMs",3e3),C(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!F(v)&&"onLine"in v.navigator&&(this.areWeOnline=v.navigator.onLine,v.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),v.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){var{retriesPerformedSoFar:t}=e,r=Wh(e,Lf);We(t)&&t>0&&(r.url=ls(r.url,{retry_count:t})),this.instance._send_request(S(S({},r),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(S({retriesPerformedSoFar:t},r)):(s=r.callback)===null||s===void 0||s.call(r,n)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(o){var l=3e3*Math.pow(2,o),a=l/2,c=Math.min(18e5,l),p=(Math.random()-.5)*(c-a);return Math.ceil(c+p)}(t),n=Date.now()+r;this.queue.push({retryAt:n,requestOptions:e});var s="Enqueued failed request for retry in ".concat(r);navigator.onLine||(s+=" (Browser is offline)"),_.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var e=Date.now(),t=[],r=this.queue.filter(s=>s.retryAt<e||(t.push(s),!1));if(this.queue=t,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(S(S({},e),{},{transport:"sendBeacon"}))}catch(t){_.error(t)}this.queue=[]}},ci,$a=class{constructor(e,t,r,n){var s;C(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Dt,this._windowIdGenerator=n||Dt;var o=e.persistence_name||e.token,l=e.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*xt(l,60,1800,"session_idle_timeout_seconds"),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=Se.parse(this._window_id_storage_key),c=Se.parse(this._primary_window_exists_storage_key);a&&!c?this._windowId=a:Se.remove(this._window_id_storage_key),Se.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var p=(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.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),p)}catch(u){_.error("Invalid sessionID in bootstrap",u)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Se.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Se.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Se.parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[Zn]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Zn];return pe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){v?.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&Se.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),[r,n,s]=this._getSessionId(),o=this._getWindowId(),l=We(s)&&s>0&&Math.abs(t-s)>864e5,a=!1,c=!n,p=!e&&Math.abs(t-r)>this.sessionTimeoutMs;c||p||l?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),_.info("[SessionId] new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}}),s=t,a=!0):o||(o=this._windowIdGenerator(),a=!0);var u=r===0||!e||l?t:r,d=s===0?new Date().getTime():s;return this._setWindowId(o),this._setSessionId(n,u,d),a&&this._sessionIdChangedHandlers.forEach(h=>h(n,o,a?{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:a?{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}};(function(i){i.US="us",i.EU="eu",i.CUSTOM="custom"})(ci||(ci={}));var Xc="i.posthog.com",Aa=class{constructor(e){C(this,"_regionCache",{}),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 uiHost(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(Xc),".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=ci.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=ci.EU:this._regionCache[this.apiHost]=ci.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t&&(t=t[0]==="/"?t:"/".concat(t)),e==="ui")return this.uiHost+t;if(this.region===ci.CUSTOM)return this.apiHost+t;var r=Xc+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}},zp="posthog-js";function Wp(i){var{organization:e,projectId:t,prefix:r,severityAllowList:n=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=>{var o,l,a,c,p;if(!(n==="*"||n.includes(s.level))||!i.__loaded)return s;s.tags||(s.tags={});var u=i.requestRouter.endpointFor("ui","/project/".concat(i.config.token,"/person/").concat(i.get_distinct_id()));s.tags["PostHog Person URL"]=u,i.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var d=((o=s.exception)===null||o===void 0?void 0:o.values)||[];d.map(g=>{g.stacktrace&&(g.stacktrace.type="raw")});var h={$exception_message:((l=d[0])===null||l===void 0?void 0:l.value)||s.message,$exception_type:(a=d[0])===null||a===void 0?void 0:a.type,$exception_personURL:u,$exception_level:s.level,$exception_list:d,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((c=d[0])===null||c===void 0?void 0:c.value)||s.message,$sentry_exception_type:(p=d[0])===null||p===void 0?void 0:p.type,$sentry_tags:s.tags,$level:s.level};return e&&t&&(h.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+t+"&query="+s.event_id),i.exceptions.sendExceptionEvent(h),s}}var Ia=class{constructor(e,t,r,n,s){this.name=zp,this.setupOnce=function(o){o(Wp(e,{organization:t,projectId:r,prefix:n,severityAllowList:s}))}}},Jc,us,rt;function Nf(i,e){var t=i.config.segment;if(!t)return e();(function(r,n){var s=r.config.segment;if(!s)return n();var o=a=>{var c=()=>a.anonymousId()||Dt();r.config.get_device_id=c,a.id()&&(r.register({distinct_id:a.id(),$device_id:c()}),r.persistence.set_property(_t,"identified")),n()},l=s.user();"then"in l&&Ye(l.then)?l.then(a=>o(a)):o(l)})(i,()=>{t.register((r=>{Promise&&Promise.resolve||_.warn("This browser does not have Promise support, and can not use the segment integration");var n=(s,o)=>{var l;if(!o)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(_.info("Segment integration does not have a userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(_.info("Segment integration has a userId set, identifying with PostHog"),r.identify(s.event.userId));var a=r._calculate_event_properties(o,(l=s.event.properties)!==null&&l!==void 0?l:{},new Date);return s.event.properties=Object.assign({},a,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>n(s,s.event.event),page:s=>n(s,"$pageview"),identify:s=>n(s,"$identify"),screen:s=>n(s,"$screen")}})(i)).then(()=>{e()})})}var Ta=class{constructor(e){this._instance=e}doPageView(e){var t,r=this._previousPageViewProperties(e);return this._currentPath=(t=v?.location.pathname)!==null&&t!==void 0?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,r}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){var t=this._currentPath,r=this._prevPageviewTimestamp,n=this._instance.scrollManager.getContext();if(!r)return{};var s={};if(n){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:a,maxContentHeight:c,lastContentY:p,maxContentY:u}=n;F(o)||F(l)||F(a)||F(c)||F(p)||F(u)||(o=Math.ceil(o),l=Math.ceil(l),a=Math.ceil(a),c=Math.ceil(c),p=Math.ceil(p),u=Math.ceil(u),s={$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:o<=1?1:xt(l/o,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:o<=1?1:xt(a/o,0,1),$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:c<=1?1:xt(p/c,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:c<=1?1:xt(u/c,0,1)})}return t&&(s.$prev_pageview_pathname=t),r&&(s.$prev_pageview_duration=(e.getTime()-r.getTime())/1e3),s}};(function(i){i.Popover="popover",i.API="api",i.Widget="widget"})(Jc||(Jc={})),function(i){i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link"}(us||(us={})),function(i){i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question"}(rt||(rt={}));var cs=class{constructor(){C(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(r=>r!==t)}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var n of this.events["*"]||[])n(e,t)}},Pa=class i{constructor(e){C(this,"_debugEventEmitter",new cs),C(this,"checkStep",(t,r)=>this.checkStepEvent(t,r)&&this.checkStepUrl(t,r)&&this.checkStepElement(t,r)),C(this,"checkStepEvent",(t,r)=>r==null||!r.event||t?.event===r?.event),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!F((e=this.instance)===null||e===void 0?void 0:e._addCaptureHook)){var t;(t=this.instance)===null||t===void 0||t._addCaptureHook((r,n)=>{this.on(r,n)})}}register(e){var t,r;if(!F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(o=>{var l,a;(l=this.actionRegistry)===null||l===void 0||l.add(o),(a=o.steps)===null||a===void 0||a.forEach(c=>{var p;(p=this.actionEvents)===null||p===void 0||p.add(c?.event||"")})}),(r=this.instance)!==null&&r!==void 0&&r.autocapture)){var n,s=new Set;e.forEach(o=>{var l;(l=o.steps)===null||l===void 0||l.forEach(a=>{a!=null&&a.selector&&s.add(a?.selector)})}),(n=this.instance)===null||n===void 0||n.autocapture.setElementSelectors(s)}}on(e,t){var r;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((r=this.actionRegistry)===null||r===void 0?void 0:r.size)>0&&this.actionRegistry.forEach(n=>{this.checkAction(t,n)&&this._debugEventEmitter.emit("actionCaptured",n.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}checkAction(e,t){if(t?.steps==null)return!1;for(var r of t.steps)if(this.checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(t!=null&&t.url){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$current_url;if(!n||typeof n!="string"||!i.matchString(n,t?.url,t?.url_matching||"contains"))return!1}return!0}static matchString(e,t,r){switch(r){case"regex":return!!v&&Bi(e,t);case"exact":return t===e;case"contains":var n=i.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Bi(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.getElementsList(e).some(s=>!(t!=null&&t.href&&!i.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!i.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!i.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$element_selectors;if(!n||!n.includes(t?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},qr=class i{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.actions)&&((s=r.conditions)===null||s===void 0||(o=s.actions)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0});t.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new Pa(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(r=>{this.onAction(r)})),t.forEach(r=>{var n,s,o,l,a,c,p,u,d,h;r.conditions&&(n=r.conditions)!==null&&n!==void 0&&n.actions&&(s=r.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((l=r.conditions)===null||l===void 0||(a=l.actions)===null||a===void 0||(c=a.values)===null||c===void 0?void 0:c.length)>0&&((p=this.actionMatcher)===null||p===void 0||p.register(r.conditions.actions.values),(u=r.conditions)===null||u===void 0||(d=u.actions)===null||d===void 0||(h=d.values)===null||h===void 0||h.forEach(g=>{if(g&&g.name){var m=this.actionToSurveys.get(g.name);m&&m.push(r.id),this.actionToSurveys.set(g.name,m||[r.id])}}))}))}setupEventBasedSurveys(e){var t;e.filter(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.events)&&((s=r.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0}).length!==0&&((t=this.instance)===null||t===void 0||t._addCaptureHook((r,n)=>{this.onEvent(r,n)}),e.forEach(r=>{var n,s,o;(n=r.conditions)===null||n===void 0||(s=n.events)===null||s===void 0||(o=s.values)===null||o===void 0||o.forEach(l=>{if(l&&l.name){var a=this.eventToSurveys.get(l.name);a&&a.push(r.id),this.eventToSurveys.set(l.name,a||[r.id])}})}))}onEvent(e,t){var r,n,s=((r=this.instance)===null||r===void 0||(n=r.persistence)===null||n===void 0?void 0:n.props[Un])||[];if(i.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,l=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(l){var a=s.indexOf(l);a>=0&&(s.splice(a,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,r,n=((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0?void 0:r.props[Un])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,r;(t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[Un]:[...new Set(e)]})}getSurveys(){var e,t,r=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[Un];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};C(qr,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Vp,oe,Gp,li,Yc,Xp,Ra,Jp,Oa={},Yp=[],Uf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rl=Array.isArray;function Lt(i,e){for(var t in e)i[t]=e[t];return i}function Kp(i){var e=i.parentNode;e&&e.removeChild(i)}function Wo(i,e,t,r,n){var s={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++Gp,__i:-1,__u:0};return n==null&&oe.vnode!=null&&oe.vnode(s),s}function nl(i){return i.children}function Jn(i,e){this.props=i,this.context=e}function Vi(i,e){if(e==null)return i.__?Vi(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Vi(i):null}function Zp(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return Zp(i)}}function Fa(i){(!i.__d&&(i.__d=!0)&&li.push(i)&&!ps.__r++||Yc!==oe.debounceRendering)&&((Yc=oe.debounceRendering)||Xp)(ps)}function ps(){var i,e,t,r,n,s,o,l,a;for(li.sort(Ra);i=li.shift();)i.__d&&(e=li.length,r=void 0,s=(n=(t=i).__v).__e,l=[],a=[],(o=t.__P)&&((r=Lt({},n)).__v=n.__v+1,oe.vnode&&oe.vnode(r),td(o,r,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??Vi(n),!!(32&n.__u),a),r.__.__k[r.__i]=r,Bf(l,r,a),r.__e!=s&&Zp(r)),li.length>e&&li.sort(Ra));ps.__r=0}function Qp(i,e,t,r,n,s,o,l,a,c,p){var u,d,h,g,m,k=r&&r.__k||Yp,w=e.length;for(t.__d=a,qf(t,e,k),a=t.__d,u=0;u<w;u++)(h=t.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(d=h.__i===-1?Oa:k[h.__i]||Oa,h.__i=u,td(i,h,d,n,s,o,l,a,c,p),g=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&sl(d.ref,null,h),p.push(h.ref,h.__c||g,h)),m==null&&g!=null&&(m=g),65536&h.__u||d.__k===h.__k?a=ed(h,a,i):typeof h.type=="function"&&h.__d!==void 0?a=h.__d:g&&(a=g.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=a,t.__e=m}function qf(i,e,t){var r,n,s,o,l,a=e.length,c=t.length,p=c,u=0;for(i.__k=[],r=0;r<a;r++)(n=i.__k[r]=(n=e[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?Wo(null,n,null,null,n):rl(n)?Wo(nl,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?Wo(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=i,n.__b=i.__b+1,l=jf(n,t,o=r+u,p),n.__i=l,s=null,l!==-1&&(p--,(s=t[l])&&(s.__u|=131072)),s==null||s.__v===null?(l==-1&&u--,typeof n.type!="function"&&(n.__u|=65536)):l!==o&&(l===o+1?u++:l>o?p>a-o?u+=l-o:u--:u=l<o&&l==o-1?l-o:0,l!==r+u&&(n.__u|=65536))):(s=t[r])&&s.key==null&&s.__e&&(s.__e==i.__d&&(i.__d=Vi(s)),Ma(s,s,!1),t[r]=null,p--);if(p)for(r=0;r<c;r++)(s=t[r])!=null&&!(131072&s.__u)&&(s.__e==i.__d&&(i.__d=Vi(s)),Ma(s,s))}function ed(i,e,t){var r,n;if(typeof i.type=="function"){for(r=i.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=i,e=ed(r[n],e,t));return e}return i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e),e&&e.nextSibling}function jf(i,e,t,r){var n=i.key,s=i.type,o=t-1,l=t+1,a=e[t];if(a===null||a&&n==a.key&&s===a.type)return t;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;o>=0||l<e.length;){if(o>=0){if((a=e[o])&&!(131072&a.__u)&&n==a.key&&s===a.type)return o;o--}if(l<e.length){if((a=e[l])&&!(131072&a.__u)&&n==a.key&&s===a.type)return l;l++}}return-1}function Kc(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||Uf.test(e)?t:t+"px"}function Wn(i,e,t,r,n){var s;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||Kc(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||Kc(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in i?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+s]=t,t?r?t.u=r.u:(t.u=Date.now(),i.addEventListener(e,s?Qc:Zc,s)):i.removeEventListener(e,s?Qc:Zc,s);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,t))}}function Zc(i){var e=this.l[i.type+!1];if(i.t){if(i.t<=e.u)return}else i.t=Date.now();return e(oe.event?oe.event(i):i)}function Qc(i){return this.l[i.type+!0](oe.event?oe.event(i):i)}function td(i,e,t,r,n,s,o,l,a,c){var p,u,d,h,g,m,k,w,y,O,M,z,J,W,P,q=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),s=[l=e.__e=t.__e]),(p=oe.__b)&&p(e);e:if(typeof q=="function")try{if(w=e.props,y=(p=q.contextType)&&r[p.__c],O=p?y?y.props.value:p.__:r,t.__c?k=(u=e.__c=t.__c).__=u.__E:("prototype"in q&&q.prototype.render?e.__c=u=new q(w,O):(e.__c=u=new Jn(w,O),u.constructor=q,u.render=zf),y&&y.sub(u),u.props=w,u.state||(u.state={}),u.context=O,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),q.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Lt({},u.__s)),Lt(u.__s,q.getDerivedStateFromProps(w,u.__s))),h=u.props,g=u.state,u.__v=e,d)q.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(q.getDerivedStateFromProps==null&&w!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,O),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,O)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(u.props=w,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(X){X&&(X.__=e)}),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,O),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,m)})}if(u.context=O,u.props=w,u.__P=i,u.__e=!1,z=oe.__r,J=0,"prototype"in q&&q.prototype.render){for(u.state=u.__s,u.__d=!1,z&&z(e),p=u.render(u.props,u.state,u.context),W=0;W<u._sb.length;W++)u.__h.push(u._sb[W]);u._sb=[]}else do u.__d=!1,z&&z(e),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++J<25);u.state=u.__s,u.getChildContext!=null&&(r=Lt(Lt({},r),u.getChildContext())),d||u.getSnapshotBeforeUpdate==null||(m=u.getSnapshotBeforeUpdate(h,g)),Qp(i,rl(P=p!=null&&p.type===nl&&p.key==null?p.props.children:p)?P:[P],e,t,r,n,s,o,l,a,c),u.base=e.__e,e.__u&=-161,u.__h.length&&o.push(u),k&&(u.__E=u.__=null)}catch(X){e.__v=null,a||s!=null?(e.__e=l,e.__u|=a?160:32,s[s.indexOf(l)]=null):(e.__e=t.__e,e.__k=t.__k),oe.__e(X,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Hf(t.__e,e,t,r,n,s,o,a,c);(p=oe.diffed)&&p(e)}function Bf(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)sl(t[r],t[++r],t[++r]);oe.__c&&oe.__c(e,i),i.some(function(n){try{i=n.__h,n.__h=[],i.some(function(s){s.call(n)})}catch(s){oe.__e(s,n.__v)}})}function Hf(i,e,t,r,n,s,o,l,a){var c,p,u,d,h,g,m,k=t.props,w=e.props,y=e.type;if(y==="svg"&&(n=!0),s!=null){for(c=0;c<s.length;c++)if((h=s[c])&&"setAttribute"in h==!!y&&(y?h.localName===y:h.nodeType===3)){i=h,s[c]=null;break}}if(i==null){if(y===null)return document.createTextNode(w);i=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,w.is&&w),s=null,l=!1}if(y===null)k===w||l&&i.data===w||(i.data=w);else{if(s=s&&Vp.call(i.childNodes),k=t.props||Oa,!l&&s!=null)for(k={},c=0;c<i.attributes.length;c++)k[(h=i.attributes[c]).name]=h.value;for(c in k)h=k[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=h:c==="key"||c in w||Wn(i,c,null,h,n));for(c in w)h=w[c],c=="children"?d=h:c=="dangerouslySetInnerHTML"?p=h:c=="value"?g=h:c=="checked"?m=h:c==="key"||l&&typeof h!="function"||k[c]===h||Wn(i,c,h,k[c],n);if(p)l||u&&(p.__html===u.__html||p.__html===i.innerHTML)||(i.innerHTML=p.__html),e.__k=[];else if(u&&(i.innerHTML=""),Qp(i,rl(d)?d:[d],e,t,r,n&&y!=="foreignObject",s,o,s?s[0]:t.__k&&Vi(t,0),l,a),s!=null)for(c=s.length;c--;)s[c]!=null&&Kp(s[c]);l||(c="value",g!==void 0&&(g!==i[c]||y==="progress"&&!g||y==="option"&&g!==k[c])&&Wn(i,c,g,k[c],!1),c="checked",m!==void 0&&m!==i[c]&&Wn(i,c,m,k[c],!1))}return i}function sl(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){oe.__e(r,t)}}function Ma(i,e,t){var r,n;if(oe.unmount&&oe.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||sl(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){oe.__e(s,e)}r.base=r.__P=null,i.__c=void 0}if(r=i.__k)for(n=0;n<r.length;n++)r[n]&&Ma(r[n],e,t||typeof i.type!="function");t||i.__e==null||Kp(i.__e),i.__=i.__e=i.__d=void 0}function zf(i,e,t){return this.constructor(i,t)}Vp=Yp.slice,oe={__e:function(i,e,t,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(i)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,r||{}),o=n.__d),o)return n.__E=n}catch(l){i=l}throw i}},Gp=0,Jn.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Lt({},this.state),typeof i=="function"&&(i=i(Lt({},t),this.props)),i&&Lt(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Fa(this))},Jn.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Fa(this))},Jn.prototype.render=nl,li=[],Xp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ra=function(i,e){return i.__v.__b-e.__v.__b},ps.__r=0,Jp=0;(function(i,e){var t={__c:e="__cC"+Jp++,__:i,Consumer:function(r,n){return r.children(n)},Provider:function(r){var n,s;return this.getChildContext||(n=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&n.some(function(l){l.__e=!0,Fa(l)})},this.sub=function(o){n.push(o);var l=o.componentWillUnmount;o.componentWillUnmount=function(){n.splice(n.indexOf(o),1),l&&l.call(o)}}),r.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0});var Cr="[Surveys]",Wf={icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:i=>!!v&&Bi(v.location.href,i),not_regex:i=>!!v&&!Bi(v.location.href,i),exact:i=>v?.location.href===i,is_not:i=>v?.location.href!==i},Da=class{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var t=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);n!=null&&n.startsWith("seenSurvey_")&&t.push(n)}return t})();e.forEach(t=>localStorage.removeItem(t))}loadIfEnabled(){var e,t,r,n=j==null||(e=j.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new qr(this.instance)),(t=j.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"surveys",s=>{var o,l;if(s)return _.error(Cr,"Could not load surveys script",s);this._surveyManager=(o=j.__PosthogExtensions__)===null||o===void 0||(l=o.generateSurveys)===null||l===void 0?void 0:l.call(o,this.instance)}))}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new qr(this.instance));var r=this.instance.get_property(Qo);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:n=>{var s;if(n.statusCode!==200||!n.json)return e([]);var o,l=n.json.surveys||[],a=l.filter(c=>{var p,u,d,h,g,m,k,w,y,O,M,z;return((p=c.conditions)===null||p===void 0?void 0:p.events)&&((u=c.conditions)===null||u===void 0||(d=u.events)===null||d===void 0?void 0:d.values)&&((h=c.conditions)===null||h===void 0||(g=h.events)===null||g===void 0||(m=g.values)===null||m===void 0?void 0:m.length)>0||((k=c.conditions)===null||k===void 0?void 0:k.actions)&&((w=c.conditions)===null||w===void 0||(y=w.actions)===null||y===void 0?void 0:y.values)&&((O=c.conditions)===null||O===void 0||(M=O.actions)===null||M===void 0||(z=M.values)===null||z===void 0?void 0:z.length)>0});return a.length>0&&((o=this._surveyEventReceiver)===null||o===void 0||o.register(a)),(s=this.instance.persistence)===null||s===void 0||s.register({[Qo]:l}),e(l)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(r=>{var n,s=r.filter(a=>!(!a.start_date||a.end_date)).filter(a=>{var c,p,u,d;if(!a.conditions)return!0;var h=(c=a.conditions)===null||c===void 0||!c.url||Wf[(p=(u=a.conditions)===null||u===void 0?void 0:u.urlMatchType)!==null&&p!==void 0?p:"icontains"](a.conditions.url),g=(d=a.conditions)===null||d===void 0||!d.selector||I?.querySelector(a.conditions.selector);return h&&g}),o=(n=this._surveyEventReceiver)===null||n===void 0?void 0:n.getSurveys(),l=s.filter(a=>{var c,p,u,d,h,g,m,k,w,y;if(!a.linked_flag_key&&!a.targeting_flag_key&&!a.internal_targeting_flag_key)return!0;var O=!a.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),M=!a.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key),z=((c=a.conditions)===null||c===void 0?void 0:c.events)&&((p=a.conditions)===null||p===void 0||(u=p.events)===null||u===void 0?void 0:u.values)&&((d=a.conditions)===null||d===void 0||(h=d.events)===null||h===void 0?void 0:h.values.length)>0,J=((g=a.conditions)===null||g===void 0?void 0:g.actions)&&((m=a.conditions)===null||m===void 0||(k=m.actions)===null||k===void 0?void 0:k.values)&&((w=a.conditions)===null||w===void 0||(y=w.actions)===null||y===void 0?void 0:y.values.length)>0,W=!z&&!J||o?.includes(a.id),P=this._canActivateRepeatedly(a),q=!(a.internal_targeting_flag_key&&!P)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key);return O&&M&&q&&W});return e(l)},t)}getNextSurveyStep(e,t,r){var n,s=e.questions[t],o=t+1;if((n=s.branching)===null||n===void 0||!n.type)return t===e.questions.length-1?rt.End:o;if(s.branching.type===rt.End)return rt.End;if(s.branching.type===rt.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===rt.ResponseBased){if(s.type===us.SingleChoice){var l,a,c=s.choices.indexOf("".concat(r));if((l=s.branching)!==null&&l!==void 0&&(a=l.responseValues)!==null&&a!==void 0&&a.hasOwnProperty(c)){var p=s.branching.responseValues[c];return Number.isInteger(p)?p:p===rt.End?rt.End:o}}else if(s.type===us.Rating){var u,d;if(typeof r!="number"||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(m,k){if(k===3){if(m<1||m>3)throw new Error("The response must be in range 1-3");return m===1?"negative":m===2?"neutral":"positive"}if(k===5){if(m<1||m>5)throw new Error("The response must be in range 1-5");return m<=2?"negative":m===3?"neutral":"positive"}if(k===7){if(m<1||m>7)throw new Error("The response must be in range 1-7");return m<=3?"negative":m===4?"neutral":"positive"}if(k===10){if(m<0||m>10)throw new Error("The response must be in range 0-10");return m<=6?"detractors":m<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,s.scale);if((u=s.branching)!==null&&u!==void 0&&(d=u.responseValues)!==null&&d!==void 0&&d.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===rt.End?rt.End:o}}return o}return _.warn(Cr,"Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return ee((t=j.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(_.warn(Cr,"canActivateRepeatedly is not defined, must init before calling"),!1):j.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){ee(this._surveyManager)?_.warn(Cr,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(t=>{var r=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(r)})}renderSurvey(e,t){ee(this._surveyManager)?_.warn(Cr,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(r=>{var n=r.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,I?.querySelector(t))})}},La=class{constructor(e){var t,r;C(this,"serverLimits",{}),C(this,"lastEventRateLimited",!1),C(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{_.info("[RateLimiter] ".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void _.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(o?.message,'"'),{text:s})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,r,n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(ta))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var l=o.tokens<1;return l||n||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||n||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(r=this.instance.persistence)===null||r===void 0||r.set_property(ta,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},Vf=()=>S({initialPathName:Ue?.pathname||"",referringDomain:ue.referringDomain()},ue.campaignParams()),Na=class{constructor(e,t,r){C(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[ea]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=r||Vf,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[ea]}getSessionProps(){var e,t=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}},Gf=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],ep=function(i,e){if(!i)return!1;var t=i.toLowerCase();return Gf.concat(e||[]).some(r=>{var n=r.toLowerCase();return t.indexOf(n)!==-1})},id=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&ep(t,e))return!0;try{var r=i?.userAgentData;if(r!=null&&r.brands&&r.brands.some(n=>ep(n?.brand,e)))return!0}catch{}return!!i.webdriver},ds=class{constructor(){this.clicks=[]}isRageClick(e,t,r){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&r-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}},Vn="[Dead Clicks]",Xf=()=>!0,Jf=i=>{var e,t=!((e=i.instance.persistence)===null||e===void 0||!e.get_property(cp)),r=i.instance.config.capture_dead_clicks;return ui(r)?r:t},hs=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}afterDecideResponse(e){this.instance.persistence&&this.instance.persistence.register({[cp]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,r,n;(t=j.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"dead-clicks-autocapture",s=>{s?_.error(Vn+" failed to load script",s):e()})}start(){var e;if(I){if(!this._lazyLoadedDeadClicksAutocapture&&(e=j.__PosthogExtensions__)!==null&&e!==void 0&&e.initDeadClicksAutocapture){var t=de(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=j.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(I),_.info("".concat(Vn," starting..."))}}else _.error(Vn+" `document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,_.info("".concat(Vn," stopping...")))}},Ua=class{constructor(e){var t;C(this,"rageclicks",new ds),C(this,"_enabledServerSide",!1),C(this,"_initialized",!1),C(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Yo]),v?.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return de(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 F(this.instance.config.capture_heatmaps)?F(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;_.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this._flushInterval)!==null&&e!==void 0?e:void 0),(t=this.deadClicksCapture)===null||t===void 0||t.stop(),this.getAndClearBuffer()}}afterDecideResponse(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Yo]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){v&&I&&(wt(I,"click",e=>this._onClick(e||v?.event),!1,!0),wt(I,"mousemove",e=>this._onMouseMove(e||v?.event),!1,!0),this.deadClicksCapture=new hs(this.instance,Xf,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,a,c){for(var p=l;p&&ms(p)&&!Ut(p,"body");){if(p===c)return!1;if(H(a,v?.getComputedStyle(p).position))return!0;p=Rp(p)}return!1}(Pp(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:t}}_onClick(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!Mc(e.target)){var n=this._getProperties(e,r);(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(S(S({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){Mc(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(v){var t=v.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!Di(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},qa=class{constructor(e){C(this,"_updateScrollData",()=>{var t,r,n,s;this.context||(this.context={});var o=this.scrollElement(),l=this.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=l+(o?.clientHeight||0),p=o?.scrollHeight||0;this.context.lastScrollY=Math.ceil(l),this.context.maxScrollY=Math.max(l,(t=this.context.maxScrollY)!==null&&t!==void 0?t:0),this.context.maxScrollHeight=Math.max(a,(r=this.context.maxScrollHeight)!==null&&r!==void 0?r:0),this.context.lastContentY=c,this.context.maxContentY=Math.max(c,(n=this.context.maxContentY)!==null&&n!==void 0?n:0),this.context.maxContentHeight=Math.max(p,(s=this.context.maxContentHeight)!==null&&s!==void 0?s:0)}),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){v?.addEventListener("scroll",this._updateScrollData,!0),v?.addEventListener("scrollend",this._updateScrollData,!0),v?.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return v?.document.documentElement;var e=pe(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var r=v?.document.querySelector(t);if(r)return r}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return v&&(v.scrollY||v.pageYOffset||v.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return v&&(v.scrollX||v.pageXOffset||v.document.documentElement.scrollLeft)||0}};function Vo(i,e){return e.length>i?e.slice(0,i)+"...":e}function Yf(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!ms(e));return e}function Kf(i,e,t,r){var n=i.tagName.toLowerCase(),s={tag_name:n};da.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=Vo(1024,Dp(i)):s.$el_text=Vo(1024,_s(i)));var o=ss(i);o.length>0&&(s.classes=o.filter(function(p){return p!==""})),K(i.attributes,function(p){var u;if((!Op(i)||["name","id","class","aria-label"].indexOf(p.name)!==-1)&&(r==null||!r.includes(p.name))&&!e&&zi(p.value)&&(u=p.name,!Ie(u)||u.substring(0,10)!=="_ngcontent"&&u.substring(0,7)!=="_nghost")){var d=p.value;p.name==="class"&&(d=el(d).join(" ")),s["attr__"+p.name]=Vo(1024,d)}});for(var l=1,a=1,c=i;c=Yf(c);)l++,c.tagName===i.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function Zf(i,e){for(var t,r,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,c=[i],p=i;p.parentNode&&!Ut(p,"body");)Ip(p.parentNode)?(c.push(p.parentNode.host),p=p.parentNode.host):(c.push(p.parentNode),p=p.parentNode);var u,d=[],h={},g=!1,m=!1;if(K(c,M=>{var z=ha(M);M.tagName.toLowerCase()==="a"&&(g=M.getAttribute("href"),g=z&&g&&zi(g)&&g),H(ss(M),"ph-no-capture")&&(m=!0),d.push(Kf(M,s,o,l));var J=function(W){if(!ha(W))return{};var P={};return K(W.attributes,function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var X=q.name.replace("data-ph-capture-attribute-",""),je=q.value;X&&je&&zi(je)&&(P[X]=je)}}),P}(M);Oe(h,J)}),m)return{props:{},explicitNoCapture:m};if(o||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?d[0].$el_text=Dp(i):d[0].$el_text=_s(i)),g){var k,w;d[0].attr__href=g;var y=(k=Pr(g))===null||k===void 0?void 0:k.host,O=v==null||(w=v.location)===null||w===void 0?void 0:w.host;y&&O&&y!==O&&(u=g)}return{props:Oe({$event_type:n.type,$ce_version:1},a?{$elements_chain:_f(d)}:{$elements:d},(t=d[0])!==null&&t!==void 0&&t.$el_text?{$el_text:(r=d[0])===null||r===void 0?void 0:r.$el_text}:{},u&&n.type==="click"?{$external_click_url:u}:{},h)}}var ja=class{constructor(e){C(this,"_initialized",!1),C(this,"_isDisabledServerSide",null),C(this,"rageclicks",new ds),C(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=de(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),r.url_ignorelist=(t=r.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(v&&I){var e=r=>{r=r||v?.event;try{this._captureEvent(r)}catch(n){_.error("Failed to capture event",n)}},t=r=>{r=r||v?.event,this._captureEvent(r,Lo)};wt(I,"submit",e,!1,!0),wt(I,"change",e,!1,!0),wt(I,"click",e,!1,!0),this.config.capture_copied_text&&(wt(I,"copy",t,!1,!0),wt(I,"cut",t,!1,!0))}}else _.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[mc]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(n=>{var s=I?.querySelectorAll(n);s?.forEach(o=>{e===o&&r.push(n)})}),r}get isEnabled(){var e,t,r=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[mc],n=this._isDisabledServerSide;if(qt(n)&&!ui(r)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!r;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,n=Pp(e);Ap(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=t===Lo;if(n&&hf(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=Zf(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(l)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(o.$element_selectors=a),t===Lo){var c,p=Tp(v==null||(c=v.getSelection())===null||c===void 0?void 0:c.toString()),u=e.type||"clipboard";if(!p)return!1;o.$selected_content=p,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Ye(I?.querySelectorAll)}},Ba=class{constructor(e){C(this,"_restoreXHRPatch",void 0),C(this,"_restoreFetchPatch",void 0),C(this,"_startCapturing",()=>{var t,r,n,s;F(this._restoreXHRPatch)&&((t=j.__PosthogExtensions__)===null||t===void 0||(r=t.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),F(this._restoreFetchPatch)&&((n=j.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,r,n;(t=j.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"tracing-headers",s=>{if(s)return _.error("[TRACING-HEADERS] failed to load script",s);e()})}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)===null||e===void 0||e.call(this),(t=this._restoreFetchPatch)===null||t===void 0||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}},Mt;(function(i){i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED"})(Mt||(Mt={}));var Ha=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Mt.DENIED:this.storedConsent}isOptedOut(){return this.consent===Mt.DENIED||this.consent===Mt.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return e==="1"?Mt.GRANTED:e==="0"?Mt.DENIED:Mt.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?ge:kt;var t=e==="localStorage"?kt:ge;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)==="1"),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!op([Ve?.doNotTrack,Ve?.msDoNotTrack,j.doNotTrack],e=>H([!0,1,"1","yes"],e))}},Gn="[Exception Autocapture]",za=class{constructor(e){var t;C(this,"originalOnUnhandledRejectionHandler",void 0),C(this,"startCapturing",()=>{var r,n,s,o;if(v&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=j.__PosthogExtensions__)===null||s===void 0||(o=s.errorWrappingFunctions)===null||o===void 0?void 0:o.wrapUnhandledRejection;if(l&&a)try{this.unwrapOnError=l(this.captureException.bind(this)),this.unwrapUnhandledRejection=a(this.captureException.bind(this))}catch(c){_.error(Gn+" failed to start",c),this.stopCapturing()}else _.error(Gn+" failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[_c]),this.startIfEnabled()}get isEnabled(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}get isCapturing(){var e;return!(v==null||(e=v.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(_.info(Gn+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,r;this.hasHandlers&&e(),(t=j.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"exception-autocapture",n=>{if(n)return _.error(Gn+" failed to load script",n);e()})}stopCapturing(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}afterDecideResponse(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[_c]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}},tp=9e5,ai="[Web Vitals]",Wa=class{constructor(e){var t;C(this,"_enabledServerSide",!1),C(this,"_initialized",!1),C(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),C(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((r,n)=>S(S({},r),{},{["$web_vitals_".concat(n.name,"_event")]:S({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),C(this,"_addToBuffer",r=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(F(s))_.error(ai+"Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this._currentURL();F(o)||(ee(r?.name)||ee(r?.value)?_.error(ai+"Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?_.error(ai+"Ignoring metric with value >= "+this._maxAllowedValue,r):(this.buffer.url!==o&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),F(this.buffer.url)&&(this.buffer.url=o),this.buffer.firstMetricTimestamp=F(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(S(S({},r),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),C(this,"_startCapturing",()=>{var r,n,s,o,l=j.__PosthogExtensions__;F(l)||F(l.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),r&&n&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this._addToBuffer.bind(this)),this._initialized=!0):_.error(ai+"web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[yc]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=de(this.instance.config.capture_performance)?(e=this.instance.config.capture_performance)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return F(r)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[bc])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(de(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=de(this.instance.config.capture_performance)&&We(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:tp;return 0<e&&e<=6e4?tp:e}get isEnabled(){var e=de(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return ui(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(_.info(ai+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){var t=de(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=de(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[yc]:t}),this.instance.persistence.register({[bc]:r})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,r,n;(t=j.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(r=j.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"web-vitals",s=>{s?_.error(ai+" failed to load script",s):e()})}_currentURL(){var e=v?v.location.href:void 0;return e||_.error(ai+"Could not determine current URL"),e}},Qf={icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!v&&Bi(e.href,i),not_regex:(i,e)=>!!v&&!Bi(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i},Va=class i{constructor(e){var t=this;C(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.getWebExperiments(n=>{i.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,n.forEach(s=>{if(s.feature_flag_key&&t._featureFlags&&t._featureFlags[s.feature_flag_key]){var o;t._flagToExperiments&&(i.logInfo("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=t._flagToExperiments)===null||o===void 0||o.set(s.feature_flag_key,s));var l=t._featureFlags[s.feature_flag_key];l&&s.variants[l]&&t.applyTransforms(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var a in s.variants){var c=s.variants[a];i.matchesTestVariant(c)&&t.applyTransforms(s.name,a,c.transforms)}})},r)}),this.instance=e,this.instance.onFeatureFlags&&this.instance.onFeatureFlags(r=>{this.applyFeatureFlagChanges(r)}),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){ee(this._flagToExperiments)||this.instance.config.disable_web_experiments||(i.logInfo("applying feature flags",e),e.forEach(t=>{var r;if(this._flagToExperiments&&(r=this._flagToExperiments)!==null&&r!==void 0&&r.has(t)){var n,s=this.instance.getFeatureFlag(t),o=(n=this._flagToExperiments)===null||n===void 0?void 0:n.get(t);s&&o!=null&&o.variants[s]&&this.applyTransforms(o.name,s,o.variants[s].transforms)}}))}afterDecideResponse(e){this._is_bot()?i.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){var e=i.getWindowLocation();if(e!=null&&e.search){var t=ts(e?.search,"__experiment_id"),r=ts(e?.search,"__experiment_variant");t&&r&&(i.logInfo("previewing web experiments ".concat(t," && ").concat(r)),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(t),r,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.instance.config.disable_web_experiments&&!r)return e([]);var n=this.instance.get_property("$web_experiments");if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var o=s.json.experiments||[];return e(o)}})}showPreviewWebExperiment(e,t,r){var n=r.filter(s=>s.id===e);n&&n.length>0&&(i.logInfo("Previewing web experiment [".concat(n[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(n[0].name,t,n[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!ee(e.conditions)&&i.matchUrlConditions(e)&&i.matchUTMConditions(e)}static matchUrlConditions(e){var t;if(ee(e.conditions)||ee((t=e.conditions)===null||t===void 0?void 0:t.url))return!0;var r,n,s,o=i.getWindowLocation();return!!o&&((r=e.conditions)===null||r===void 0||!r.url||Qf[(n=(s=e.conditions)===null||s===void 0?void 0:s.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,o))}static getWindowLocation(){return v?.location}static matchUTMConditions(e){var t;if(ee(e.conditions)||ee((t=e.conditions)===null||t===void 0?void 0:t.utm))return!0;var r=ue.campaignParams();if(r.utm_source){var n,s,o,l,a,c,p,u,d,h,g,m,k,w,y,O,M=(n=e.conditions)===null||n===void 0||(s=n.utm)===null||s===void 0||!s.utm_campaign||((o=e.conditions)===null||o===void 0||(l=o.utm)===null||l===void 0?void 0:l.utm_campaign)==r.utm_campaign,z=(a=e.conditions)===null||a===void 0||(c=a.utm)===null||c===void 0||!c.utm_source||((p=e.conditions)===null||p===void 0||(u=p.utm)===null||u===void 0?void 0:u.utm_source)==r.utm_source,J=(d=e.conditions)===null||d===void 0||(h=d.utm)===null||h===void 0||!h.utm_medium||((g=e.conditions)===null||g===void 0||(m=g.utm)===null||m===void 0?void 0:m.utm_medium)==r.utm_medium,W=(k=e.conditions)===null||k===void 0||(w=k.utm)===null||w===void 0||!w.utm_term||((y=e.conditions)===null||y===void 0||(O=y.utm)===null||O===void 0?void 0:O.utm_term)==r.utm_term;return M&&J&&W&&z}return!1}static logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];_.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r,n){var s;this._is_bot()?i.logInfo("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?r.forEach(o=>{if(o.selector){var l;i.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),o);var a,c=0,p=(l=document)===null||l===void 0?void 0:l.querySelectorAll(o.selector);p?.forEach(u=>{var d=u;c+=1,o.attributes&&o.attributes.forEach(h=>{switch(h.name){case"text":d.innerText=h.value;break;case"html":d.innerHTML=h.value;break;case"cssClass":d.className=h.value;break;default:d.setAttribute(h.name,h.value)}}),o.text&&(d.innerText=o.text),o.html&&(d.parentElement?d.parentElement.innerHTML=o.html:d.innerHTML=o.html),o.css&&d.setAttribute("style",o.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:n,$web_experiment_document_url:(a=i.getWindowLocation())===null||a===void 0?void 0:a.href,$web_experiment_elements_modified:c})}}):(i.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:n,$web_experiment_variant:t,$web_experiment_document_url:(s=i.getWindowLocation())===null||s===void 0?void 0:s.href,$web_experiment_elements_modified:0}))}_is_bot(){return Ve&&this.instance?id(Ve,this.instance.config.custom_blocked_useragents):void 0}},Ga=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},Mr={},Xa=()=>{},Mi="posthog",rd=!Df&&we?.indexOf("MSIE")===-1&&we?.indexOf("Mozilla")===-1,ip=()=>{var i,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=I?.location,t=e?.hostname,!!Ie(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Xa,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Ue&&Ie(Ue?.search)&&Ue.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(i=v.location)===null||i===void 0?void 0:i.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:r=>{var n="Bad HTTP status: "+r.statusCode+" "+r.text;_.error(n)},get_device_id:r=>r,_onCapture:Xa,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},rp=i=>{var e={};F(i.process_person)||(e.person_profiles=i.process_person),F(i.xhr_headers)||(e.request_headers=i.xhr_headers),F(i.cookie_name)||(e.persistence_name=i.cookie_name),F(i.disable_cookie)||(e.disable_persistence=i.disable_cookie);var t=Oe({},e,i);return pe(i.property_blacklist)&&(F(i.property_denylist)?t.property_denylist=i.property_blacklist:pe(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:_.error("Invalid value for property_denylist config: "+i.property_denylist)),t},Ja=class{constructor(){C(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){_.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},fs=class i{constructor(){C(this,"webPerformance",new Ja),C(this,"version",Ot.LIB_VERSION),C(this,"_internalEventEmitter",new cs),this.config=ip(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ia,this.sentryIntegration=e=>function(t,r){var n=Wp(t,r);return{name:zp,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new na(this),this.toolbar=new Sa(this),this.scrollManager=new qa(this),this.pageViewManager=new Ta(this),this.surveys=new Da(this),this.experiments=new Va(this),this.exceptions=new Ga(this),this.rateLimiter=new La(this),this.requestRouter=new Aa(this),this.consent=new Ha(this),this.people={set:(e,t,r)=>{var n=Ie(e)?{[e]:t}:e;this.setPersonProperties(n),r?.({})},set_once:(e,t,r)=>{var n=Ie(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",e=>_.info('send "'.concat(e?.event,'"'),e))}init(e,t,r){if(r&&r!==Mi){var n,s=(n=Mr[r])!==null&&n!==void 0?n:new i;return s._init(e,t,r),Mr[r]=s,Mr[Mi][r]=s,s}return this._init(e,t,r)}_init(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(F(e)||hc(e))return _.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 _.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],n.person_profiles&&(this._initialPersonProfilesConfig=n.person_profiles),this.set_config(Oe({},ip(),rp(n),{name:s,token:e})),this.config.on_xhr_error&&_.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:st.GZipJS,this.persistence=new Rr(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rr(S(S({},this.config),{},{persistence:"sessionStorage"}));var o=S({},this.persistence.props),l=S({},this.sessionPersistence.props);if(this._requestQueue=new Ea(w=>this._send_retriable_request(w)),this._retryQueue=new Ca(this),this.__request_queue=[],this.sessionManager=new $a(this.config,this.persistence),this.sessionPropsManager=new Na(this.sessionManager,this.persistence),new Ba(this).startIfEnabledOrStop(),this.sessionRecording=new xa(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new ja(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Ua(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Wa(this),this.exceptionObserver=new za(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new hs(this,Jf),this.deadClicksAutocapture.startIfEnabled(),Ot.DEBUG=Ot.DEBUG||this.config.debug,Ot.DEBUG&&_.info("Starting in debug mode",{this:this,config:n,thisC:S({},this.config),p:o,s:l}),this._sync_opt_out_with_persistence(),((t=n.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,c,p=this.config.get_device_id(Dt()),u=(a=n.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?p:n.bootstrap.distinctID;this.persistence.set_property(_t,(c=n.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:u})}if(this._hasBootstrappedFeatureFlags()){var d,h,g=Object.keys(((d=n.bootstrap)===null||d===void 0?void 0:d.featureFlags)||{}).filter(w=>{var y,O;return!((y=n.bootstrap)===null||y===void 0||(O=y.featureFlags)===null||O===void 0||!O[w])}).reduce((w,y)=>{var O,M;return w[y]=((O=n.bootstrap)===null||O===void 0||(M=O.featureFlags)===null||M===void 0?void 0:M[y])||!1,w},{}),m=Object.keys(((h=n.bootstrap)===null||h===void 0?void 0:h.featureFlagPayloads)||{}).filter(w=>g[w]).reduce((w,y)=>{var O,M,z,J;return(O=n.bootstrap)!==null&&O!==void 0&&(M=O.featureFlagPayloads)!==null&&M!==void 0&&M[y]&&(w[y]=(z=n.bootstrap)===null||z===void 0||(J=z.featureFlagPayloads)===null||J===void 0?void 0:J[y]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:m})}if(!this.get_distinct_id()){var k=this.config.get_device_id(Dt());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(_t,"anonymous")}return v==null||(r=v.addEventListener)===null||r===void 0||r.call(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),n.segment?Nf(this,()=>this._loaded()):this._loaded(),Ye(this.config._onCapture)&&this.config._onCapture!==Xa&&(_.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",w=>this.config._onCapture(w.event,w))),this}_afterDecideResponse(e){var t,r,n,s,o,l,a,c,p;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=H(e.supportedCompression,st.GZipJS)?st.GZipJS:H(e.supportedCompression,st.Base64)?st.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),(r=this.sessionRecording)===null||r===void 0||r.afterDecideResponse(e),(n=this.autocapture)===null||n===void 0||n.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.experiments)===null||o===void 0||o.afterDecideResponse(e),(l=this.surveys)===null||l===void 0||l.afterDecideResponse(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.afterDecideResponse(e),(c=this.exceptionObserver)===null||c===void 0||c.afterDecideResponse(e),(p=this.deadClicksAutocapture)===null||p===void 0||p.afterDecideResponse(e)}_loaded(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(t){_.critical("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),e||(new ka(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Ui(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(t=this._retryQueue)===null||t===void 0||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(rd?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ls(e.url,{ip:this.config.ip?1:0}),e.headers=S({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(t=>{var r,n,s,o=S({},t);o.timeout=o.timeout||6e4,o.url=ls(o.url,{_:new Date().getTime().toString(),ver:Ot.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"XHR",a=(n=(s=op(Fr,c=>c.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:Fr[0].method;if(!a)throw new Error("No available transport method");a(o)})(S(S({},e),{},{callback:t=>{var r,n,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(s=this.config).on_request_error)===null||n===void 0||n.call(s,t)),(r=e.callback)===null||r===void 0||r.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],n=[],s=[];Ui(e,l=>{l&&(t=l[0],pe(t)?s.push(l):Ye(l)?l.call(this):pe(l)&&t==="alias"?r.push(l):pe(l)&&t.indexOf("capture")!==-1&&Ye(this[t])?s.push(l):n.push(l))});var o=function(l,a){Ui(l,function(c){if(pe(c[0])){var p=a;K(c,function(u){p=p[u[0]].apply(p,u.slice(1))})}else this[c[0]].apply(this,c.slice(1))},a)};o(r,this),o(n,this),o(s,this)}_hasBootstrappedFeatureFlags(){var e,t;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!F(e)&&Ie(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=r?.timestamp||o,a={uuid:Dt(),event:e,properties:this._calculate_event_properties(e,t||{},l)};s&&(a.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(a.$set=r?.$set);var c=this._calculate_set_once_properties(r?.$set_once);c&&(a.$set_once=c),(a=Uh(a,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,F(r?.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=o);var p=S(S({},a.properties.$set),a.$set);if(Di(p)||this.setPersonPropertiesForFlags(p),!ee(this.config.before_send)){var u=this._runBeforeSend(a);if(!u)return;a=u}this._internalEventEmitter.emit("eventCaptured",a);var d={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),a}_.critical("This capture call is ignored due to client rate limiting.")}}else _.error("No event name provided to posthog.capture")}else _.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,r){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),s=S({},t);if(s.token=this.config.token,e==="$snapshot"){var o=S(S({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ie(s.distinct_id)&&!We(s.distinct_id)||hc(s.distinct_id))&&_.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l=ue.properties();if(this.sessionManager){var{sessionId:a,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=a,s.$window_id=c}if(this.requestRouter.region===ci.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var p=this.sessionPropsManager.getSessionProps();s=Oe(s,p)}if(!this.config.disable_scroll_properties){var u={};e==="$pageview"?u=this.pageViewManager.doPageView(r):e==="$pageleave"&&(u=this.pageViewManager.doPageLeave(r)),s=Oe(s,u)}if(e==="$pageview"&&I&&(s.title=I.title),!F(n)){var d=r.getTime()-n;s.$duration=parseFloat((d/1e3).toFixed(3))}we&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Oe({},l,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),pe(this.config.property_denylist)?K(this.config.property_denylist,function(m){delete s[m]}):_.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;h&&(s=h(s,e));var g=this._hasPersonProcessing();return s.$process_person_profile=g,g&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Oe({},this.persistence.get_initial_props(),e||{}),r=this.config.sanitize_properties;return r&&(t=r(t,"$set_once")),Di(t)?void 0:t}register(e,t){var r;(r=this.persistence)===null||r===void 0||r.register(e,t)}register_once(e,t,r){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,t,r)}register_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}unregister(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}_register_single(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){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,r;return(t=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,r){return this.surveys.getNextSurveyStep(e,t,r)}identify(e,t,r){if(!this.__loaded||!this.persistence)return _.uninitializedWarning("posthog.identify");if(We(e)&&(e=e.toString(),_.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()))_.critical('The string "'.concat(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(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property($r)&&(this.unregister($r),this.register({distinct_id:e}));var o=(this.persistence.get_property(_t)||"anonymous")==="anonymous";e!==n&&o?(this.persistence.set_property(_t,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:r||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||r)&&this.setPersonProperties(t,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Qn))}}else _.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,r){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:S(S({},n),{},{[e]:t})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===t||r||this.reloadFeatureFlags()}}else _.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,n,s,o;if(_.info("reset"),!this.__loaded)return _.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(r=this.sessionPersistence)===null||r===void 0||r.clear(),(n=this.surveys)===null||n===void 0||n.reset(),(s=this.persistence)===null||s===void 0||s.set_property(_t,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId();var a=this.config.get_device_id(Dt());this.register_once({distinct_id:a,$device_id:e?a:l},"")}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||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(e!=null&&e.withTimestamp&&r){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return n;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0);n+="?t=".concat(l)}return n}alias(e,t){return e===this.get_property(up)?(_.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single($r,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(_.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,r,n,s,o=S({},this.config);de(e)&&(Oe(this.config,rp(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rr(S(S({},this.config),{},{persistence:"sessionStorage"})),ge.is_supported()&&ge.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Ot.DEBUG=!0,_.info("set_config",{config:e,oldConfig:o,newConfig:S({},this.config)})),(r=this.sessionRecording)===null||r===void 0||r.startIfEnabledOrStop(),(n=this.autocapture)===null||n===void 0||n.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=e===!0,r={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(r).some(Boolean)){var n,s,o,l,a;(n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((a=this.sessionRecording)===null||a===void 0||a.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===void 0||!e.started)}captureException(e,t){var r,n=new Error("PostHog syntheticException"),s=Ye((r=j.__PosthogExtensions__)===null||r===void 0?void 0:r.parseErrorAsProperties)?j.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):S({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},t);this.exceptions.sendExceptionEvent(s)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Mi;return t!==Mi&&(t=Mi+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(_t))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(_t))==="identified"}_hasPersonProcessing(){var e,t,r,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Di(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[$r])&&((r=this.persistence)===null||r===void 0||(n=r.props)===null||n===void 0||!n[es]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return this.config.person_profiles==="never"?(_.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(es,!0),!0)}_sync_opt_out_with_persistence(){var e,t,r,n,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,l=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==l&&((r=this.persistence)===null||r===void 0||r.set_disabled(l)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==l&&((n=this.sessionPersistence)===null||n===void 0||n.set_disabled(l))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Ve?id(Ve,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){I&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:I.title},{send_instantly:!0}))}debug(e){e===!1?(v?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(v?.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(e){if(ee(this.config.before_send))return e;var t=pe(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),ee(r)){var s="Event '".concat(e.event,"' was rejected in beforeSend function");return zh(e.event)?_.warn("".concat(s,". This can cause unexpected behavior.")):_.info(s),null}r.properties&&!Di(r.properties)||_.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return r}};(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=Nh(i.prototype[e[t]])})(fs,["identify"]);var np,nd=(np=Mr[Mi]=new fs,function(){function i(){i.done||(i.done=!0,rd=!1,K(Mr,function(e){e._dom_loaded()}))}I!=null&&I.addEventListener&&(I.readyState==="complete"?i():I.addEventListener("DOMContentLoaded",i,!1)),v&&wt(v,"load",i,!0)}(),np);var sd=nd.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,advanced_disable_decide:!0},"MolinShopAI");function Me(i,e){if(!sd)throw new Error("Failed to initialize PostHog");sd.capture(i,e)}var bs,Hr,ws,jt,ad,ys,jr=class jr extends G(B){constructor(){super();b(this,jt);b(this,bs,new Pt(this,{onError:console.error}));b(this,Hr);b(this,ws,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Me("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>Me("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>Me("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>Me("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>Me("ShopAssistant: user clicked link",t),onUserSentInput:t=>Me("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData="",this.xPromptExt=""}get config(){return f(this,Hr)||f(this,bs).data}render(){return this.config?L`
399
+ `)).length,n=0;n<r;n++){var o=i.charCodeAt(n),l=null;o<128?t++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Ht(l)||(t>e&&(s+=i.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=i.substring(e,i.length)),s},St=function(){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation),e}return i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},function(e,t,r,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(t,r,!!s);else{var o="on"+t,l=e[o];e[o]=function(a,c,d){return function(u){if(u=u||i(v?.event)){var p,h=!0;Ze(d)&&(p=d(u));var g=c.call(a,u);return p!==!1&&g!==!1||(h=!1),h}}}(e,r,l)}else _.error("No valid element provided to register_event")}}();function wd(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}var at,Vo="$copy_autocapture",tf=["$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(i){i.GZipJS="gzip-js",i.Base64="base64"})(at||(at={}));var rf=Array.isArray,xd=Object.prototype,kd=xd.hasOwnProperty,Ss=xd.toString,he=rf||function(i){return Ss.call(i)==="[object Array]"},Ze=i=>typeof i=="function",fe=i=>i===Object(i)&&!he(i),ji=i=>{if(fe(i)){for(var e in i)if(kd.call(i,e))return!1;return!0}return!1},F=i=>i===void 0,Pe=i=>Ss.call(i)=="[object String]",Ac=i=>Pe(i)&&i.trim().length===0,Ht=i=>i===null,ee=i=>F(i)||Ht(i),Ge=i=>Ss.call(i)=="[object Number]",pi=i=>Ss.call(i)==="[object Boolean]",nf=i=>i instanceof FormData,sf=i=>H(tf,i),Ic="[PostHog.js]",_={_log:function(i){if(v&&(Mt.DEBUG||q.POSTHOG_DEBUG)&&!F(v.console)&&v.console){for(var e=("__rrweb_original__"in v.console[i])?v.console[i].__rrweb_original__:v.console[i],t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];e(Ic,...r)}},info:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];_._log("log",...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];_._log("warn",...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];_._log("error",...e)},critical:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];console.error(Ic,...e)},uninitializedWarning:i=>{_.error("You must initialize PostHog before calling ".concat(i))}},Tc=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return _.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var r=()=>{if(!T)return t("document not found");var n=T.createElement("script");n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=l=>t(void 0,l),n.onerror=l=>t(l);var s,o=T.querySelectorAll("body > script");o.length>0?(s=o[0].parentNode)===null||s===void 0||s.insertBefore(n,o[0]):T.body.appendChild(n)};T!=null&&T.body?r():T?.addEventListener("DOMContentLoaded",r)};function Pc(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function S(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pc(Object(t),!0).forEach(function(r){$(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Pc(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function $(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function of(i,e){if(i==null)return{};var t,r,n=function(o,l){if(o==null)return{};var a,c,d={},u=Object.keys(o);for(c=0;c<u.length;c++)a=u[c],l.indexOf(a)>=0||(d[a]=o[a]);return d}(i,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}q.__PosthogExtensions__=q.__PosthogExtensions__||{},q.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{var r="/static/".concat(e,".js")+"?v=".concat(i.version);if(e==="toolbar"){var n=3e5,s=Math.floor(Date.now()/n)*n;r="".concat(r,"&t=").concat(s)}var o=i.requestRouter.endpointFor("assets",r);Tc(i,o,t)},q.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var r=i.requestRouter.endpointFor("api",e);Tc(i,r,t)};var Sd="$people_distinct_id",Rr="__alias",Or="__timers",Rc="$autocapture_disabled_server_side",sa="$heatmaps_enabled_server_side",Oc="$exception_capture_enabled_server_side",Fc="$web_vitals_enabled_server_side",Ed="$dead_clicks_enabled_server_side",Dc="$web_vitals_allowed_metrics",oa="$session_recording_enabled_server_side",Mc="$console_log_recording_enabled_server_side",Lc="$session_recording_network_payload_capture",Nc="$session_recording_canvas_recording",Uc="$replay_sample_rate",jc="$replay_minimum_duration",os="$sesid",Fr="$session_is_sampled",Go="$session_recording_url_trigger_activated_session",Jo="$session_recording_event_trigger_activated_session",qi="$enabled_feature_flags",aa="$early_access_features",Bi="$stored_person_properties",Lt="$stored_group_properties",la="$surveys",Gn="$surveys_activated",as="$flag_call_reported",wt="$user_state",ua="$client_session_props",ca="$capture_rate_limit",da="$initial_campaign_params",pa="$initial_referrer_info",qc="$initial_person_info",ls="$epp",Cd="__POSTHOG_TOOLBAR__",af=[Sd,Rr,"__cmpns",Or,oa,sa,os,qi,wt,aa,Lt,Bi,la,as,ua,ca,da,pa,ls],Xo="$active_feature_flags",Jn="$override_feature_flags",Bc="$feature_flag_payloads",Hc=i=>{var e={};for(var[t,r]of is(i||{}))r&&(e[t]=r);return e},ha=class{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(qi),t=this.instance.get_property(Jn);if(!t)return e||{};for(var r=De({},e),n=Object.keys(t),s=0;s<n.length;s++)r[n[s]]=t[n[s]];return this._override_warning||(_.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){return this.instance.get_property(Bc)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())},5)}_reloadFeatureFlagsRequest(){if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var e=this.instance.config.token,t=this.instance.get_property(Bi),r=this.instance.get_property(Lt),n={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:n,compression:this.instance.config.disable_compression?void 0:at.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:s=>{var o;this.setReloadingPaused(!1);var l=!0;s.statusCode===200&&(this.$anon_distinct_id=void 0,l=!1),this.receivedFeatureFlags((o=s.json)!==null&&o!==void 0?o:{},l),this._startReloadTimer()}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r,n=this.getFlagVariants()[e],s="".concat(n),o=this.instance.get_property(as)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(he(o[e])?o[e].push(s):o[e]=[s],(r=this.instance.persistence)===null||r===void 0||r.register({[as]:o}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}_.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);_.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.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads();(function(s,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s.featureFlags,d=s.featureFlagPayloads;if(c)if(he(c)){var u={};if(c)for(var p=0;p<c.length;p++)u[c[p]]=!0;o&&o.register({[Xo]:c,[qi]:u})}else{var h=c,g=d;s.errorsWhileComputingFlags&&(h=S(S({},l),h),g=S(S({},a),g)),o&&o.register({[Xo]:Object.keys(Hc(h)),[qi]:h||{},[Bc]:g||{}})}})(e,this.instance.persistence,r,n),this._fireFeatureFlagsCallbacks(t)}}override(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return _.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(Jn);else if(he(e)){for(var r={},n=0;n<e.length;n++)r[e[n]]=!0;this.instance.persistence.register({[Jn]:r})}else this.instance.persistence.register({[Jn]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var r,n={["$feature_enrollment/".concat(e)]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:n}),this.setPersonPropertiesForFlags(n,!1);var s=S(S({},this.getFlagVariants()),{},{[e]:t});(r=this.instance.persistence)===null||r===void 0||r.register({[Xo]:Object.keys(Hc(s)),[qi]:s}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(aa);if(r&&!t)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:n=>{var s;if(n.json){var o=n.json.earlyAccessFeatures;return(s=this.instance.persistence)===null||s===void 0||s.register({[aa]:o}),e(o)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(r=>t[r]),flagVariants:Object.keys(t).filter(r=>t[r]).reduce((r,n)=>(r[n]=t[n],r),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(n=>n(t,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Bi)||{};this.instance.register({[Bi]:S(S({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Bi)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Lt)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(n=>{r[n]=S(S({},r[n]),e[n]),delete e[n]}),this.instance.register({[Lt]:S(S({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(Lt)||{};this.instance.register({[Lt]:S(S({},t),{},{[e]:{}})})}else this.instance.unregister(Lt)}};Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return Ge(i)&&isFinite(i)&&Math.floor(i)===i});var zc="0123456789abcdef",fa=class i{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new i(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+zc.charAt(this.bytes[t]>>>4)+zc.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 i(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(r!==0)return Math.sign(r)}return 0}},ga=class{constructor(){$(this,"timestamp",0),$(this,"counter",0),$(this,"random",new va)}generate(){var e=this.generateOrAbort();if(F(e)){this.timestamp=0;var t=this.generateOrAbort();if(F(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return fa.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}},Wc,$d=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<i.length;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};v&&!F(v.crypto)&&crypto.getRandomValues&&($d=i=>crypto.getRandomValues(i));var va=class{constructor(){$(this,"buffer",new Uint32Array(8)),$(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&($d(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},Ut=()=>lf().toString(),lf=()=>(Wc||(Wc=new ga)).generate(),uf="Thu, 01 Jan 1970 00:00:00 GMT",Ar="",cf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function df(i,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T;if(Ar)return Ar;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var o=n.split("."),l=Math.min(o.length,8),a="dmn_chk_"+Ut(),c=new RegExp("(^|;)\\s*"+a+"=1");!Ar&&l--;){var d=o.slice(l).join("."),u=a+"=1;domain=."+d;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+uf,Ar=d)}return Ar}(i);if(!t){var r=(n=>{var s=n.match(cf);return s?s[0]:""})(i);r!==t&&_.info("Warning: cookie subdomain discovery mismatch",r,t),t=r}return t?"; domain=."+t:""}return""}var Ct={is_supported:()=>!!T,error:function(i){_.error("cookieStore error: "+i)},get:function(i){if(T){try{for(var e=i+"=",t=T.cookie.split(";").filter(s=>s.length),r=0;r<t.length;r++){for(var n=t[r];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},parse:function(i){var e;try{e=JSON.parse(Ct.get(i))||{}}catch{}return e},set:function(i,e,t,r,n){if(T)try{var s="",o="",l=df(T.location.hostname,r);if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),s="; expires="+a.toUTCString()}n&&(o="; secure");var c=i+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&_.warn("cookieStore warning: large cookie, len="+c.length),T.cookie=c,c}catch{return}},remove:function(i,e){try{Ct.set(i,"",-1,e)}catch{return}}},Yo=null,me={is_supported:function(){if(!Ht(Yo))return Yo;var i=!0;if(F(v))i=!1;else try{var e="__mplssupport__";me.set(e,"xyz"),me.get(e)!=='"xyz"'&&(i=!1),me.remove(e)}catch{i=!1}return i||_.error("localStorage unsupported; falling back to cookie store"),Yo=i,i},error:function(i){_.error("localStorage error: "+i)},get:function(i){try{return v?.localStorage.getItem(i)}catch(e){me.error(e)}return null},parse:function(i){try{return JSON.parse(me.get(i))||{}}catch{}return null},set:function(i,e){try{v?.localStorage.setItem(i,JSON.stringify(e))}catch(t){me.error(t)}},remove:function(i){try{v?.localStorage.removeItem(i)}catch(e){me.error(e)}}},pf=["distinct_id",os,Fr,ls],Xn=S(S({},me),{},{parse:function(i){try{var e={};try{e=Ct.parse(i)||{}}catch{}var t=De(e,JSON.parse(me.get(i)||"{}"));return me.set(i,t),t}catch{}return null},set:function(i,e,t,r,n,s){try{me.set(i,e,void 0,void 0,s);var o={};pf.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&Ct.set(i,o,t,r,n,s)}catch(l){me.error(l)}},remove:function(i,e){try{v?.localStorage.removeItem(i),Ct.remove(i,e)}catch(t){me.error(t)}}}),Yn={},hf={is_supported:function(){return!0},error:function(i){_.error("memoryStorage error: "+i)},get:function(i){return Yn[i]||null},parse:function(i){return Yn[i]||null},set:function(i,e){Yn[i]=e},remove:function(i){delete Yn[i]}},li=null,Ce={is_supported:function(){if(!Ht(li))return li;if(li=!0,F(v))li=!1;else try{var i="__support__";Ce.set(i,"xyz"),Ce.get(i)!=='"xyz"'&&(li=!1),Ce.remove(i)}catch{li=!1}return li},error:function(i){_.error("sessionStorage error: ",i)},get:function(i){try{return v?.sessionStorage.getItem(i)}catch(e){Ce.error(e)}return null},parse:function(i){try{return JSON.parse(Ce.get(i))||null}catch{}return null},set:function(i,e){try{v?.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){Ce.error(t)}},remove:function(i){try{v?.sessionStorage.removeItem(i)}catch(e){Ce.error(e)}}},ff=["localhost","127.0.0.1"],Mr=i=>{var e=T?.createElement("a");return F(e)?null:(e.href=i,e)},Vi=function(i,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(i)},gf=function(i){var e,t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",n=[];return K(i,function(s,o){F(s)||F(o)||o==="undefined"||(e=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),t=encodeURIComponent(o),n[n.length]=t+"="+e)}),n.join(r)},us=function(i,e){for(var t,r=((i.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<r.length;n++){var s=r[n].split("=");if(s[0]===e){t=s;break}}if(!he(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{_.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},cs=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Qe="Mobile",ds="iOS",dt="Android",qr="Tablet",Ad=dt+" "+qr,Id="iPad",Td="Apple",Pd=Td+" Watch",Br="Safari",Gi="BlackBerry",Rd="Samsung",Od=Rd+"Browser",Fd=Rd+" Internet",qt="Chrome",vf=qt+" OS",Dd=qt+" "+ds,sl="Internet Explorer",Md=sl+" "+Qe,ol="Opera",mf=ol+" Mini",al="Edge",Ld="Microsoft "+al,zi="Firefox",Nd=zi+" "+ds,Hr="Nintendo",zr="PlayStation",Wi="Xbox",Ud=dt+" "+Qe,jd=Qe+" "+Br,Dr="Windows",ma=Dr+" Phone",Vc="Nokia",_a="Ouya",qd="Generic",_f=qd+" "+Qe.toLowerCase(),Bd=qd+" "+qr.toLowerCase(),ya="Konqueror",Fe="(\\d+(\\.\\d+)?)",Ko=new RegExp("Version/"+Fe),yf=new RegExp(Wi,"i"),bf=new RegExp(zr+" \\w+","i"),wf=new RegExp(Hr+" \\w+","i"),ll=new RegExp(Gi+"|PlayBook|BB10","i"),xf={"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"},kf=(i,e)=>e&&H(e,Td)||function(t){return H(t,Br)&&!H(t,qt)&&!H(t,dt)}(i),Gc=function(i,e){return e=e||"",H(i," OPR/")&&H(i,"Mini")?mf:H(i," OPR/")?ol:ll.test(i)?Gi:H(i,"IE"+Qe)||H(i,"WPDesktop")?Md:H(i,Od)?Fd:H(i,al)||H(i,"Edg/")?Ld:H(i,"FBIOS")?"Facebook "+Qe:H(i,"UCWEB")||H(i,"UCBrowser")?"UC Browser":H(i,"CriOS")?Dd:H(i,"CrMo")?qt:H(i,dt)&&H(i,Br)?Ud:H(i,qt)?qt:H(i,"FxiOS")?Nd:H(i.toLowerCase(),ya.toLowerCase())?ya:kf(i,e)?H(i,Qe)?jd:Br:H(i,zi)?zi:H(i,"MSIE")||H(i,"Trident/")?sl:H(i,"Gecko")?zi:""},Sf={[Md]:[new RegExp("rv:"+Fe)],[Ld]:[new RegExp(al+"?\\/"+Fe)],[qt]:[new RegExp("("+qt+"|CrMo)\\/"+Fe)],[Dd]:[new RegExp("CriOS\\/"+Fe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Fe)],[Br]:[Ko],[jd]:[Ko],[ol]:[new RegExp("(Opera|OPR)\\/"+Fe)],[zi]:[new RegExp(zi+"\\/"+Fe)],[Nd]:[new RegExp("FxiOS\\/"+Fe)],[ya]:[new RegExp("Konqueror[:/]?"+Fe,"i")],[Gi]:[new RegExp(Gi+" "+Fe),Ko],[Ud]:[new RegExp("android\\s"+Fe,"i")],[Fd]:[new RegExp(Od+"\\/"+Fe)],[sl]:[new RegExp("(rv:|MSIE )"+Fe)],Mozilla:[new RegExp("rv:"+Fe)]},Jc=[[new RegExp(Wi+"; "+Wi+" (.*?)[);]","i"),i=>[Wi,i&&i[1]||""]],[new RegExp(Hr,"i"),[Hr,""]],[new RegExp(zr,"i"),[zr,""]],[ll,[Gi,""]],[new RegExp(Dr,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ma,""];if(new RegExp(Qe).test(e)&&!/IEMobile\b/.test(e))return[Dr+" "+Qe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=t[1],n=xf[r]||"";return/arm/i.test(e)&&(n="RT"),[Dr,n]}return[Dr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[ds,e.join(".")]}return[ds,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=F(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+dt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+dt+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[dt,e.join(".")]}return[dt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[vf,""]],[/Linux|debian/i,["Linux",""]]],Xc=function(i){return wf.test(i)?Hr:bf.test(i)?zr:yf.test(i)?Wi:new RegExp(_a,"i").test(i)?_a:new RegExp("("+ma+"|WPDesktop)","i").test(i)?ma:/iPad/.test(i)?Id:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?Pd:ll.test(i)?Gi:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(Vc,"i").test(i)?Vc:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(Qe).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?dt:Ad:dt:new RegExp("(pda|"+Qe+")","i").test(i)?_f:new RegExp(qr,"i").test(i)&&!new RegExp(qr+" pc","i").test(i)?Bd:""},Kn="https?://(.*)",Ef=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],ue={campaignParams:function(i){return T?this._campaignParamsFromUrl(T.URL,i):{}},_campaignParamsFromUrl:function(i,e){var t=Ef.concat(e||[]),r={};return K(t,function(n){var s=us(i,n);r[n]=s||null}),r},_searchEngine:function(i){return i?i.search(Kn+"google.([^/?]*)")===0?"google":i.search(Kn+"bing.com")===0?"bing":i.search(Kn+"yahoo.com")===0?"yahoo":i.search(Kn+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(i){var e=ue._searchEngine(i),t=e!="yahoo"?"q":"p",r={};if(!Ht(e)){r.$search_engine=e;var n=T?us(T.referrer,t):"";n.length&&(r.ph_keyword=n)}return r},searchInfo:function(){var i=T?.referrer;return i?this._searchInfoFromReferrer(i):{}},browser:Gc,browserVersion:function(i,e){var t=Gc(i,e),r=Sf[t];if(F(r))return null;for(var n=0;n<r.length;n++){var s=r[n],o=i.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(i){for(var e=0;e<Jc.length;e++){var[t,r]=Jc[e],n=t.exec(i),s=n&&(Ze(r)?r(n,i):r);if(s)return s}return["",""]},device:Xc,deviceType:function(i){var e=Xc(i);return e===Id||e===Ad||e==="Kobo"||e==="Kindle Fire"||e===Bd?qr:e===Hr||e===Wi||e===zr||e===_a?"Console":e===Pd?"Wearable":e?Qe:"Desktop"},referrer:function(){return T?.referrer||"$direct"},referringDomain:function(){var i;return T!=null&&T.referrer&&((i=Mr(T.referrer))===null||i===void 0?void 0:i.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:qe?.href}},initialPersonPropsFromInfo:function(i){var e,{r:t,u:r}=i,n={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Mr(t))===null||e===void 0?void 0:e.host};if(r){n.$initial_current_url=r;var s=Mr(r);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,K(this._campaignParamsFromUrl(r),function(o,l){n["$initial_"+na(l)]=o})}return t&&K(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+na(l)]=o}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},properties:function(){if(!ke)return{};var[i,e]=ue.os(ke);return De(ss({$os:i,$os_version:e,$browser:ue.browser(ke,navigator.vendor),$device:ue.device(ke),$device_type:ue.deviceType(ke),$timezone:ue.timezone()}),{$current_url:qe?.href,$host:qe?.host,$pathname:qe?.pathname,$raw_user_agent:ke.length>1e3?ke.substring(0,997)+"...":ke,$browser_version:ue.browserVersion(ke,navigator.vendor),$browser_language:ue.browserLanguage(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:Mt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!ke)return{};var[i,e]=ue.os(ke);return De(ss({$os:i,$os_version:e,$browser:ue.browser(ke,navigator.vendor)}),{$browser_version:ue.browserVersion(ke,navigator.vendor)})}},Cf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Lr=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t=>{var r="";return t.token&&(r=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+r+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&_.info("Persistence loaded",e.persistence,S({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){Cf.indexOf(e.persistence.toLowerCase())===-1&&(_.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&me.is_supported()?me:t==="localstorage+cookie"&&Xn.is_supported()?Xn:t==="sessionstorage"&&Ce.is_supported()?Ce:t==="memory"?hf:t==="cookie"?Ct:Xn.is_supported()?Xn:Ct}properties(){var e={};return K(this.props,function(t,r){if(r===qi&&fe(t))for(var n=Object.keys(t),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=t[n[s]];else l=r,a=!1,(Ht(o=af)?a:Ec&&o.indexOf===Ec?o.indexOf(l)!=-1:(K(o,function(c){if(a||(a=c===l))return ns}),a))||(e[r]=t);var o,l,a}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=De({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(fe(e)){F(t)&&(t="None"),this.expire_days=F(r)?this.default_expiry:r;var n=!1;if(K(e,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==t||(this.props[o]=s,n=!0)}),n)return this.save(),!0}return!1}register(e,t){if(fe(e)){this.expire_days=F(t)?this.default_expiry:t;var r=!1;if(K(e,(n,s)=>{e.hasOwnProperty(s)&&this.props[s]!==n&&(this.props[s]=n,r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=ue.campaignParams(this.config.custom_campaign_params);ji(ss(e))||this.register(ue.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0}}update_search_keyword(){this.register(ue.searchInfo())}update_referrer_info(){this.register_once(ue.referrerInfo(),void 0)}set_initial_person_info(){this.props[da]||this.props[pa]||this.register_once({[qc]:ue.initialPersonInfo()},void 0)}get_referrer_info(){return ss({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};K([pa,da],n=>{var s=this.props[n];s&&K(s,function(o,l){e["$initial_"+na(l)]=o})});var t=this.props[qc];if(t){var r=ue.initialPersonPropsFromInfo(t);De(e,r)}return e}safe_merge(e){return K(this.props,function(t,r){r in e||(e[r]=t)}),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.buildStorage(e),n=this.props;this.clear(),this.storage=r,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Or]||{};r[e]=t,this.props[Or]=r,this.save()}remove_event_timer(e){var t=(this.props[Or]||{})[e];return F(t)||(delete this.props[Or][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function ps(i){var e,t;return((e=JSON.stringify(i,(t=[],function(r,n){if(fe(n)){for(;t.length>0&&t.at(-1)!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n})))===null||e===void 0?void 0:e.length)||0}function ba(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(i.size>=e&&i.data.length>1){var t=Math.floor(i.data.length/2),r=i.data.slice(0,t),n=i.data.slice(t);return[ba({size:ps(r),data:r,sessionId:i.sessionId,windowId:i.windowId}),ba({size:ps(n),data:n,sessionId:i.sessionId,windowId:i.windowId})].flatMap(s=>s)}return[i]}var xt=(i=>(i[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i))(xt||{}),ot=(i=>(i[i.Mutation=0]="Mutation",i[i.MouseMove=1]="MouseMove",i[i.MouseInteraction=2]="MouseInteraction",i[i.Scroll=3]="Scroll",i[i.ViewportResize=4]="ViewportResize",i[i.Input=5]="Input",i[i.TouchMove=6]="TouchMove",i[i.MediaInteraction=7]="MediaInteraction",i[i.StyleSheetRule=8]="StyleSheetRule",i[i.CanvasMutation=9]="CanvasMutation",i[i.Font=10]="Font",i[i.Log=11]="Log",i[i.Drag=12]="Drag",i[i.StyleDeclaration=13]="StyleDeclaration",i[i.Selection=14]="Selection",i[i.AdoptedStyleSheet=15]="AdoptedStyleSheet",i[i.CustomElement=16]="CustomElement",i))(ot||{});function Yc(i){var e;return i.id===Cd||!((e=i.closest)===null||e===void 0||!e.call(i,".toolbar-global-fade-container"))}function Es(i){return!!i&&i.nodeType===1}function Bt(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function Hd(i){return!!i&&i.nodeType===3}function zd(i){return!!i&&i.nodeType===11}function ul(i){return i?ks(i).split(/\s+/):[]}function Kc(i){var e=v?.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function hs(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return ul(e)}function Wd(i){return ee(i)?null:ks(i).split(/(\s+)/).filter(e=>Ji(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Cs(i){var e="";return xa(i)&&!Jd(i)&&i.childNodes&&i.childNodes.length&&K(i.childNodes,function(t){var r;Hd(t)&&t.textContent&&(e+=(r=Wd(t.textContent))!==null&&r!==void 0?r:"")}),ks(e)}function Vd(i){return F(i.target)?i.srcElement||null:(e=i.target)!==null&&e!==void 0&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var wa=["a","button","form","input","select","textarea","label"];function Gd(i){var e=i.parentNode;return!(!e||!Es(e))&&e}function $f(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!v||!i||Bt(i,"html")||!Es(i)||t!=null&&t.url_allowlist&&!Kc(t.url_allowlist)||t!=null&&t.url_ignorelist&&Kc(t.url_ignorelist))return!1;if(t!=null&&t.dom_event_allowlist){var s=t.dom_event_allowlist;if(s&&!s.some(h=>e.type===h))return!1}for(var o=!1,l=[i],a=!0,c=i;c.parentNode&&!Bt(c,"body");)if(zd(c.parentNode))l.push(c.parentNode.host),c=c.parentNode.host;else{if(!(a=Gd(c)))break;if(r||wa.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{var d=v.getComputedStyle(a);d&&d.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(a),c=a}if(!function(h,g){var m=g?.element_allowlist;if(F(m))return!0;var k=function(O){if(m.some(D=>O.tagName.toLowerCase()===D))return{v:!0}};for(var w of h){var b=k(w);if(typeof b=="object")return b.v}return!1}(l,t)||!function(h,g){var m=g?.css_selector_allowlist;if(F(m))return!0;var k=function(O){if(m.some(D=>O.matches(D)))return{v:!0}};for(var w of h){var b=k(w);if(typeof b=="object")return b.v}return!1}(l,t))return!1;var u=v.getComputedStyle(i);if(u&&u.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=i.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return o?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(wa.indexOf(p)>-1||i.getAttribute("contenteditable")==="true")}}function xa(i){for(var e=i;e.parentNode&&!Bt(e,"body");e=e.parentNode){var t=hs(e);if(H(t,"ph-sensitive")||H(t,"ph-no-capture"))return!1}if(H(hs(i),"ph-include"))return!0;var r=i.type||"";if(Pe(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=i.name||i.id||"";return!(Pe(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function Jd(i){return!!(Bt(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Bt(i,"select")||Bt(i,"textarea")||i.getAttribute("contenteditable")==="true")}var Xd="(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})",Af=new RegExp("^(?:".concat(Xd,")$")),If=new RegExp(Xd),Yd="\\d{3}-?\\d{2}-?\\d{4}",Tf=new RegExp("^(".concat(Yd,")$")),Pf=new RegExp("(".concat(Yd,")"));function Ji(i){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(ee(i)||Pe(i)&&(i=ks(i),(e?Af:If).test((i||"").replace(/[- ]/g,""))||(e?Tf:Pf).test(i)))}function Kd(i){var e=Cs(i);return Ji(e="".concat(e," ").concat(Zd(i)).trim())?e:""}function Zd(i){var e="";return i&&i.childNodes&&i.childNodes.length&&K(i.childNodes,function(t){var r;if(t&&((r=t.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var n=Cs(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(Zd(t)).trim())}catch(s){_.error(s)}}),e}function Rf(i){return function(e){var t=e.map(r=>{var n,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))o+=".".concat(l.replace(/"/g,""));var a=S(S(S(S({},r.text?{text:r.text}:{}),{},{"nth-child":(n=r.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),c={};return is(a).sort((d,u)=>{var[p]=d,[h]=u;return p.localeCompare(h)}).forEach(d=>{var[u,p]=d;return c[Zc(u.toString())]=Zc(p.toString())}),o+=":",o+=is(a).map(d=>{var[u,p]=d;return"".concat(u,'="').concat(p,'"')}).join("")});return t.join(";")}(function(e){return e.map(t=>{var r,n,s={text:(r=t.$el_text)===null||r===void 0?void 0:r.slice(0,400),tag_name:t.tag_name,href:(n=t.attr__href)===null||n===void 0?void 0:n.slice(0,2048),attr_class:Of(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return is(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,a]=o;return s.attributes[l]=a}),s})}(i))}function Zc(i){return i.replace(/"|\\"/g,'\\"')}function Of(i){var e=i.attr__class;return e?he(e)?e:ul(e):void 0}var ka="[SessionRecording]",Sa="redacted",Zn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:i=>i,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},Ff=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Df=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Mf=["/s/","/e/","/i/"];function Qc(i,e,t,r){if(ee(i))return i;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(i);return Pe(n)&&(n=parseInt(n)),n>t?ka+" ".concat(r," body too large to record (").concat(n," bytes)"):i}function ed(i,e){if(ee(i))return i;var t=i;return Ji(t,!1)||(t=ka+" "+e+" body "+Sa),K(Df,r=>{var n,s;(n=t)!==null&&n!==void 0&&n.length&&((s=t)===null||s===void 0?void 0:s.indexOf(r))!==-1&&(t=ka+" "+e+" body "+Sa+" as might contain: "+r)}),t}var Lf=(i,e)=>{var t,r,n,s={payloadSizeLimitBytes:Zn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Zn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Zn.payloadHostDenyList]},o=i.session_recording.recordHeaders!==!1&&e.recordHeaders,l=i.session_recording.recordBody!==!1&&e.recordBody,a=i.capture_performance!==!1&&e.recordPerformance,c=(t=s,n=Math.min(1e6,(r=t.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),p=>(p!=null&&p.requestBody&&(p.requestBody=Qc(p.requestBody,p.requestHeaders,n,"Request")),p!=null&&p.responseBody&&(p.responseBody=Qc(p.responseBody,p.responseHeaders,n,"Response")),p)),d=p=>{return c((m=>{var k=Mr(m.name);if(!(k&&k.pathname&&Mf.some(w=>k.pathname.indexOf(w)===0)))return m})((g=(h=p).requestHeaders,ee(g)||K(Object.keys(g??{}),m=>{Ff.includes(m.toLowerCase())&&(g[m]=Sa)}),h)));var h,g},u=Ze(i.session_recording.maskNetworkRequestFn);return u&&Ze(i.session_recording.maskCapturedNetworkRequestFn)&&_.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(i.session_recording.maskCapturedNetworkRequestFn=p=>{var h=i.session_recording.maskNetworkRequestFn({url:p.name});return S(S({},p),{},{name:h?.url})}),s.maskRequestFn=Ze(i.session_recording.maskCapturedNetworkRequestFn)?p=>{var h,g,m,k=d(p);return k&&(h=(g=(m=i.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,k))!==null&&h!==void 0?h:void 0}:p=>function(h){if(!F(h))return h.requestBody=ed(h.requestBody,"Request"),h.responseBody=ed(h.responseBody,"Response"),h}(d(p)),S(S(S({},Zn),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function Et(i,e,t,r){return e>t&&(_.warn("min cannot be greater than max."),e=t),Ge(i)?i>t?(r&&_.warn(r+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(r&&_.warn(r+" cannot be less than min: "+e+". Using min value instead."),e):i:(r&&_.warn(r+" must be a number. Defaulting to max value:"+t),t)}var Ea=class{constructor(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$(this,"bucketSize",100),$(this,"refillRate",10),$(this,"mutationBuckets",{}),$(this,"loggedTracker",{}),$(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(s=>{this.mutationBuckets[s]=this.mutationBuckets[s]+this.refillRate,this.mutationBuckets[s]>=this.bucketSize&&delete this.mutationBuckets[s]})}),$(this,"getNodeOrRelevantParent",s=>{var o=this.rrweb.mirror.getNode(s);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[this.rrweb.mirror.getId(l),l]}return[s,o]}),$(this,"numberOfChanges",s=>{var o,l,a,c,d,u,p,h;return((o=(l=s.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((a=(c=s.attributes)===null||c===void 0?void 0:c.length)!==null&&a!==void 0?a:0)+((d=(u=s.texts)===null||u===void 0?void 0:u.length)!==null&&d!==void 0?d:0)+((p=(h=s.adds)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)}),$(this,"throttleMutations",s=>{if(s.type!==3||s.data.source!==0)return s;var o=s.data,l=this.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(c=>{var d,u,p,[h,g]=this.getNodeOrRelevantParent(c.id);return this.mutationBuckets[h]===0?!1:(this.mutationBuckets[h]=(d=this.mutationBuckets[h])!==null&&d!==void 0?d:this.bucketSize,this.mutationBuckets[h]=Math.max(this.mutationBuckets[h]-1,0),this.mutationBuckets[h]===0&&(this.loggedTracker[h]||(this.loggedTracker[h]=!0,(u=(p=this.options).onBlockedNode)===null||u===void 0||u.call(p,h,g))),c)}));var a=this.numberOfChanges(o);return a!==0||l===a?s:void 0}),this.rrweb=e,this.options=n,this.refillRate=Et((t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Et((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},et=Uint8Array,Me=Uint16Array,Xi=Uint32Array,cl=new et([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]),dl=new et([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]),td=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qd=function(i,e){for(var t=new Me(31),r=0;r<31;++r)t[r]=e+=1<<i[r-1];var n=new Xi(t[30]);for(r=1;r<30;++r)for(var s=t[r];s<t[r+1];++s)n[s]=s-t[r]<<5|r;return[t,n]},ep=Qd(cl,2),Nf=ep[0],Ca=ep[1];Nf[28]=258,Ca[258]=28;for($a=Qd(dl,0)[1],fs=new Me(32768),te=0;te<32768;++te)Dt=(43690&te)>>>1|(21845&te)<<1,Dt=(61680&(Dt=(52428&Dt)>>>2|(13107&Dt)<<2))>>>4|(3855&Dt)<<4,fs[te]=((65280&Dt)>>>8|(255&Dt)<<8)>>>1;var Dt,$a,fs,te,Nr=function(i,e,t){for(var r=i.length,n=0,s=new Me(e);n<r;++n)++s[i[n]-1];var o,l=new Me(e);for(n=0;n<e;++n)l[n]=l[n-1]+s[n-1]<<1;if(t){o=new Me(1<<e);var a=15-e;for(n=0;n<r;++n)if(i[n])for(var c=n<<4|i[n],d=e-i[n],u=l[i[n]-1]++<<d,p=u|(1<<d)-1;u<=p;++u)o[fs[u]>>>a]=c}else for(o=new Me(r),n=0;n<r;++n)o[n]=fs[l[i[n]-1]++]>>>15-i[n];return o},fi=new et(288);for(te=0;te<144;++te)fi[te]=8;for(te=144;te<256;++te)fi[te]=9;for(te=256;te<280;++te)fi[te]=7;for(te=280;te<288;++te)fi[te]=8;var gs=new et(32);for(te=0;te<32;++te)gs[te]=5;var Uf=Nr(fi,9,0),jf=Nr(gs,5,0),tp=function(i){return(i/8>>0)+(7&i&&1)},ip=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var r=new(i instanceof Me?Me:i instanceof Xi?Xi:et)(t-e);return r.set(i.subarray(e,t)),r},bt=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8},Ir=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8,i[r+2]|=t>>>16},Zo=function(i,e){for(var t=[],r=0;r<i.length;++r)i[r]&&t.push({s:r,f:i[r]});var n=t.length,s=t.slice();if(!n)return[new et(0),0];if(n==1){var o=new et(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(z,X){return z.f-X.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],c=0,d=1,u=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};d!=n-1;)l=t[t[c].f<t[u].f?c++:u++],a=t[c!=d&&t[c].f<t[u].f?c++:u++],t[d++]={s:-1,f:l.f+a.f,l,r:a};var p=s[0].s;for(r=1;r<n;++r)s[r].s>p&&(p=s[r].s);var h=new Me(p+1),g=Aa(t[d-1],h,0);if(g>e){r=0;var m=0,k=g-e,w=1<<k;for(s.sort(function(z,X){return h[X.s]-h[z.s]||z.f-X.f});r<n;++r){var b=s[r].s;if(!(h[b]>e))break;m+=w-(1<<g-h[b]),h[b]=e}for(m>>>=k;m>0;){var O=s[r].s;h[O]<e?m-=1<<e-h[O]++-1:++r}for(;r>=0&&m;--r){var D=s[r].s;h[D]==e&&(--h[D],++m)}g=e}return[new et(h),g]},Aa=function(i,e,t){return i.s==-1?Math.max(Aa(i.l,e,t+1),Aa(i.r,e,t+1)):e[i.s]=t},id=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Me(++e),r=0,n=i[0],s=1,o=function(a){t[r++]=a},l=1;l<=e;++l)if(i[l]==n&&l!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=i[l]}return[t.subarray(0,r),e]},Tr=function(i,e){for(var t=0,r=0;r<e.length;++r)t+=i[r]*e[r];return t},Ia=function(i,e,t){var r=t.length,n=tp(e+2);i[n]=255&r,i[n+1]=r>>>8,i[n+2]=255^i[n],i[n+3]=255^i[n+1];for(var s=0;s<r;++s)i[n+s+4]=t[s];return 8*(n+4+r)},rd=function(i,e,t,r,n,s,o,l,a,c,d){bt(e,d++,t),++n[256];for(var u=Zo(n,15),p=u[0],h=u[1],g=Zo(s,15),m=g[0],k=g[1],w=id(p),b=w[0],O=w[1],D=id(m),z=D[0],X=D[1],W=new Me(19),R=0;R<b.length;++R)W[31&b[R]]++;for(R=0;R<z.length;++R)W[31&z[R]]++;for(var j=Zo(W,7),J=j[0],He=j[1],_e=19;_e>4&&!J[td[_e-1]];--_e);var Xe,Y,ie,de,Ne=c+5<<3,ze=Tr(n,fi)+Tr(s,gs)+o,ae=Tr(n,p)+Tr(s,m)+o+14+3*_e+Tr(W,J)+(2*W[16]+3*W[17]+7*W[18]);if(Ne<=ze&&Ne<=ae)return Ia(e,d,i.subarray(a,a+c));if(bt(e,d,1+(ae<ze)),d+=2,ae<ze){Xe=Nr(p,h,0),Y=p,ie=Nr(m,k,0),de=m;var $e=Nr(J,He,0);for(bt(e,d,O-257),bt(e,d+5,X-1),bt(e,d+10,_e-4),d+=14,R=0;R<_e;++R)bt(e,d+3*R,J[td[R]]);d+=3*_e;for(var Ae=[b,z],se=0;se<2;++se){var ye=Ae[se];for(R=0;R<ye.length;++R){var Re=31&ye[R];bt(e,d,$e[Re]),d+=J[Re],Re>15&&(bt(e,d,ye[R]>>>5&127),d+=ye[R]>>>12)}}}else Xe=Uf,Y=fi,ie=jf,de=gs;for(R=0;R<l;++R)if(r[R]>255){Re=r[R]>>>18&31,Ir(e,d,Xe[Re+257]),d+=Y[Re+257],Re>7&&(bt(e,d,r[R]>>>23&31),d+=cl[Re]);var vi=31&r[R];Ir(e,d,ie[vi]),d+=de[vi],vi>3&&(Ir(e,d,r[R]>>>5&8191),d+=dl[vi])}else Ir(e,d,Xe[r[R]]),d+=Y[r[R]];return Ir(e,d,Xe[256]),d+Y[256]},qf=new Xi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Bf=function(){for(var i=new Xi(256),e=0;e<256;++e){for(var t=e,r=9;--r;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),Hf=function(){var i=4294967295;return{p:function(e){for(var t=i,r=0;r<e.length;++r)t=Bf[255&t^e[r]]^t>>>8;i=t},d:function(){return 4294967295^i}}},zf=function(i,e,t,r,n){return function(s,o,l,a,c,d){var u=s.length,p=new et(a+u+5*(1+Math.floor(u/7e3))+c),h=p.subarray(a,p.length-c),g=0;if(!o||u<8)for(var m=0;m<=u;m+=65535){var k=m+65535;k<u?g=Ia(h,g,s.subarray(m,k)):(h[m]=d,g=Ia(h,g,s.subarray(m,u)))}else{for(var w=qf[o-1],b=w>>>13,O=8191&w,D=(1<<l)-1,z=new Me(32768),X=new Me(D+1),W=Math.ceil(l/3),R=2*W,j=function(Ds){return(s[Ds]^s[Ds+1]<<W^s[Ds+2]<<R)&D},J=new Xi(25e3),He=new Me(288),_e=new Me(32),Xe=0,Y=0,ie=(m=0,0),de=0,Ne=0;m<u;++m){var ze=j(m),ae=32767&m,$e=X[ze];if(z[ae]=$e,X[ze]=ae,de<=m){var Ae=u-m;if((Xe>7e3||ie>24576)&&Ae>423){g=rd(s,h,0,J,He,_e,Y,ie,Ne,m-Ne,g),ie=Xe=Y=0,Ne=m;for(var se=0;se<286;++se)He[se]=0;for(se=0;se<30;++se)_e[se]=0}var ye=2,Re=0,vi=O,$t=ae-$e&32767;if(Ae>2&&ze==j(m-$t))for(var Op=Math.min(b,Ae)-1,Fp=Math.min(32767,m),Dp=Math.min(258,Ae);$t<=Fp&&--vi&&ae!=$e;){if(s[m+ye]==s[m+ye-$t]){for(var At=0;At<Dp&&s[m+At]==s[m+At-$t];++At);if(At>ye){if(ye=At,Re=$t,At>Op)break;var Mp=Math.min($t,At-2),Sl=0;for(se=0;se<Mp;++se){var Fs=m-$t+se+32768&32767,El=Fs-z[Fs]+32768&32767;El>Sl&&(Sl=El,$e=Fs)}}}$t+=(ae=$e)-($e=z[ae])+32768&32767}if(Re){J[ie++]=268435456|Ca[ye]<<18|$a[Re];var Cl=31&Ca[ye],$l=31&$a[Re];Y+=cl[Cl]+dl[$l],++He[257+Cl],++_e[$l],de=m+ye,++Xe}else J[ie++]=s[m],++He[s[m]]}}g=rd(s,h,d,J,He,_e,Y,ie,Ne,m-Ne,g)}return ip(p,0,a+tp(g)+c)}(i,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+e.mem,t,r,!n)},Ta=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},Wf=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&Ta(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var r=0;r<=t.length;++r)i[r+10]=t.charCodeAt(r)}},Vf=function(i){return 10+(i.filename&&i.filename.length+1||0)};function rp(i,e){e===void 0&&(e={});var t=Hf(),r=i.length;t.p(i);var n=zf(i,e,Vf(e),8),s=n.length;return Wf(n,e),Ta(n,s-8,t.d()),Ta(n,s-4,r),n}function np(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var r=new et(i.length+(i.length>>>1)),n=0,s=function(c){r[n++]=c},o=0;o<t;++o){if(n+5>r.length){var l=new et(n+8+(t-o<<1));l.set(r),r=l}var a=i.charCodeAt(o);a<128||e?s(a):a<2048?(s(192|a>>>6),s(128|63&a)):a>55295&&a<57344?(s(240|(a=65536+(1047552&a)|1023&i.charCodeAt(++o))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return ip(r,0,n)}var Gf=3e5,Jf=[ot.MouseMove,ot.MouseInteraction,ot.Scroll,ot.ViewportResize,ot.Input,ot.TouchMove,ot.MediaInteraction,ot.Drag],nd=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1}),Ee="[SessionRecording]";function ui(i){return function(e,t){for(var r="",n=0;n<e.length;){var s=e[n++];s<128||t?r+=String.fromCharCode(s):s<224?r+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?r+=String.fromCharCode((15&s)<<12|(63&e[n++])<<6|63&e[n++]):(s=((15&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|s>>10,56320|1023&s))}return r}(rp(np(JSON.stringify(i))),!0)}function sd(i){return i.type===xt.Custom&&i.data.tag==="sessionIdle"}function od(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}var Pa=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return q==null||(e=q.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(Ee+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return this.triggerStatus==="trigger_pending"?6e4:(e=(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:Gf}get isSampled(){var e=this.instance.get_property(Fr);return pi(e)?e:null}get sessionDuration(){var e,t,r=(e=this.buffer)===null||e===void 0?void 0:e.data[((t=this.buffer)===null||t===void 0?void 0:t.data.length)-1],{sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(oa),t=!this.instance.config.disable_session_recording;return v&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(Mc),t=this.instance.config.enable_recording_console_log;return t??e}get canvasRecording(){var e,t,r,n,s,o,l=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(Nc),c=(e=(t=l?.recordCanvas)!==null&&t!==void 0?t:a?.enabled)!==null&&e!==void 0&&e,d=(r=(n=l?.canvasFps)!==null&&n!==void 0?n:a?.fps)!==null&&r!==void 0?r:0,u=(s=(o=l?.canvasQuality)!==null&&o!==void 0?o:a?.quality)!==null&&s!==void 0?s:0;return{enabled:c,fps:Et(d,0,12,"canvas recording fps"),quality:Et(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(Lc),n={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordBody},s=n?.recordHeaders||r?.recordHeaders,o=n?.recordBody||r?.recordBody,l=fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(pi(l)?l:r?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(Uc);return Ge(e)?e:null}get minimumDuration(){var e=this.instance.get_property(jc);return Ge(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?ee(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":this._urlBlocked?"paused":pi(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return this._urlTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(Go))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return this._eventTriggers.length===0?"trigger_disabled":((e=this.instance)===null||e===void 0?void 0:e.get_property(Jo))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",t=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if($(this,"queuedRRWebEvents",[]),$(this,"isIdle",!1),$(this,"_linkedFlagSeen",!1),$(this,"_lastActivityTimestamp",Date.now()),$(this,"_linkedFlag",null),$(this,"_removePageViewCaptureHook",void 0),$(this,"_onSessionIdListener",void 0),$(this,"_persistDecideOnSessionListener",void 0),$(this,"_samplingSessionListener",void 0),$(this,"_urlTriggers",[]),$(this,"_urlBlocklist",[]),$(this,"_urlBlocked",!1),$(this,"_eventTriggers",[]),$(this,"_removeEventTriggerCaptureHook",void 0),$(this,"_forceAllowLocalhostNetworkCapture",!1),$(this,"_onBeforeUnload",()=>{this._flushBuffer()}),$(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),$(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),$(this,"_onVisibilityChange",()=>{if(T!=null&&T.visibilityState){var n="window "+T.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw _.error(Ee+" started without valid sessionManager"),new Error(Ee+" started without valid sessionManager. This is a bug.");var{sessionId:t,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&_.warn(Ee+" session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),v?.addEventListener("beforeunload",this._onBeforeUnload),v?.addEventListener("offline",this._onOffline),v?.addEventListener("online",this._onOnline),v?.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),ee(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(t=>{try{if(t==="$pageview"){var r=v?this._maskUrl(v.location.href):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(n){_.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((t,r,n)=>{var s,o,l,a;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:t,windowId:r,changeReason:n}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(Jo),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(Go))}))):this.stopRecording()}stopRecording(){var e,t,r,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,v?.removeEventListener("beforeunload",this._onBeforeUnload),v?.removeEventListener("offline",this._onOffline),v?.removeEventListener("online",this._onOnline),v?.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(e=this._removePageViewCaptureHook)===null||e===void 0||e.call(this),this._removePageViewCaptureHook=void 0,(t=this._removeEventTriggerCaptureHook)===null||t===void 0||t.call(this),this._removeEventTriggerCaptureHook=void 0,(r=this._onSessionIdListener)===null||r===void 0||r.call(this),this._onSessionIdListener=void 0,(n=this._samplingSessionListener)===null||n===void 0||n.call(this),this._samplingSessionListener=void 0,_.info(Ee+" stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if(Ge(n)){var s,o=this.isSampled,l=r||!pi(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):_.warn(Ee+" Sample rate (".concat(n,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:n,isSampled:s})),(t=this.instance.persistence)===null||t===void 0||t.register({[Fr]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[Fr]:null})}}afterDecideResponse(e){var t,r,n,s,o,l;if(this._persistDecideResponse(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(r=e.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(l=e.sessionRecording)===null||l===void 0?void 0:l.endpoint),this._setupSampling(),!ee(this._linkedFlag)&&!this._linkedFlagSeen){var a=Pe(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,c=Pe(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((d,u)=>{var p=fe(u)&&a in u,h=c?u[a]===c:p;h&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:c}),this._linkedFlagSeen=h})}(n=e.sessionRecording)!==null&&n!==void 0&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),(s=e.sessionRecording)!==null&&s!==void 0&&s.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),(o=e.sessionRecording)!==null&&o!==void 0&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Ge(this.sampleRate)&&ee(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistDecideResponse(e){if(this.instance.persistence){var t,r=this.instance.persistence,n=()=>{var s,o,l,a,c,d,u,p=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,h=ee(p)?null:parseFloat(p),g=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;r.register({[oa]:!!e.sessionRecording,[Mc]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[Lc]:S({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[Nc]:{enabled:(c=e.sessionRecording)===null||c===void 0?void 0:c.recordCanvas,fps:(d=e.sessionRecording)===null||d===void 0?void 0:d.canvasFps,quality:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasQuality},[Uc]:h,[jc]:F(g)?null:g})};n(),(t=this._persistDecideOnSessionListener)===null||t===void 0||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(n)}}log(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!F(Object.assign)&&!F(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,r;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=q.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"recorder",n=>{if(n)return _.error(Ee+" could not load recorder",n);this._onScriptLoaded()}),_.info(Ee+" starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return e.type===3&&Jf.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)),!this.isIdle){var{windowId:n,sessionId:s}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==s,l=this.windowId!==n;this.windowId=n,this.sessionId=s,o||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):_.warn(Ee+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(nd(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(nd(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var e,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording;for(var[n,s]of Object.entries(r||{}))n in t&&(n==="maskInputOptions"?t.maskInputOptions=S({password:!0},s):t[n]=s);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new Ea(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(l,a)=>{var c="Too many mutations on node '".concat(l,"'. Rate limiting. This could be due to SVG animations or something similar");_.info(c,{node:a}),this.log(Ee+" "+c,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(S({emit:l=>{this.onRRwebEmit(l)},plugins:o},t)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:o.map(l=>l?.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else _.error(Ee+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}}_gatherRRWebPlugins(){var e,t,r,n,s=[],o=(e=q.__PosthogExtensions__)===null||e===void 0||(t=e.rrwebPlugins)===null||t===void 0?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var l=(r=q.__PosthogExtensions__)===null||r===void 0||(n=r.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ze(l)&&(!ff.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(Lf(this.instance.config,this.networkPayloadCapture))):_.info(Ee+" NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&fe(e)){if(e.type===xt.Meta){var r=this._maskUrl(e.data.href);if(this._lastHref=r,!r)return;e.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(u){return u.type===xt.Custom&&u.data.tag==="recording paused"}(e)){e.type===xt.FullSnapshot&&this._scheduleFullSnapshot(),e.type===xt.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var s=function(u){var p=u;if(p&&fe(p)&&p.type===6&&fe(p.data)&&p.data.plugin==="rrweb/console@1"){p.data.payload.payload.length>10&&(p.data.payload.payload=p.data.payload.payload.slice(0,10),p.data.payload.payload.push("...[truncated]"));for(var h=[],g=0;g<p.data.payload.payload.length;g++)p.data.payload.payload[g]&&p.data.payload.payload[g].length>2e3?h.push(p.data.payload.payload[g].slice(0,2e3)+"...[truncated]"):h.push(p.data.payload.payload[g]);return p.data.payload.payload=h,u}return u}(n);if(this._updateWindowAndSessionIds(s),!this.isIdle||sd(s)){if(sd(s)){var o=s.data.payload;if(o){var l=o.lastActivityTimestamp,a=o.threshold;s.timestamp=l+a}}var c=(t=this.instance.config.session_recording.compress_events)===null||t===void 0||t?function(u){if(ps(u)<1024)return u;try{if(u.type===xt.FullSnapshot)return S(S({},u),{},{data:ui(u.data),cv:"2024-10"});if(u.type===xt.IncrementalSnapshot&&u.data.source===ot.Mutation)return S(S({},u),{},{cv:"2024-10",data:S(S({},u.data),{},{texts:ui(u.data.texts),attributes:ui(u.data.attributes),removes:ui(u.data.removes),adds:ui(u.data.adds)})});if(u.type===xt.IncrementalSnapshot&&u.data.source===ot.StyleSheetRule)return S(S({},u),{},{cv:"2024-10",data:S(S({},u.data),{},{adds:ui(u.data.adds),removes:ui(u.data.removes)})})}catch(p){_.error(Ee+" could not compress event - will use uncompressed event",p)}return u}(s):s,d={$snapshot_bytes:ps(c),$snapshot_data:c,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(d):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&v){var e=this._maskUrl(v.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this._tryRRWebMethod(t)})}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var r,n={url:e};return(r=n=t.maskNetworkRequestFn(n))===null||r===void 0?void 0:r.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,r=Ge(t)&&t>=0,n=Ge(e)&&r&&t<e;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&ba(this.buffer).forEach(s=>{this._captureSnapshot({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(v!==void 0&&v.location.href){var e=v.location.href,t=this.status==="paused",r=od(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),od(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,r;this.triggerStatus==="trigger_pending"&&((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[e==="url"?Go:Jo]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;this.status!=="paused"&&(this._urlBlocked=!0,T==null||(e=T.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout(()=>{this._flushBuffer()},100),_.info(Ee+" recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;this.status==="paused"&&(this._urlBlocked=!1,T==null||(e=T.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.remove("ph-no-capture"),this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),_.info(Ee+" recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&ee(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(t){_.error(Ee+"Could not activate event trigger",t)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;(e=this.instance.persistence)===null||e===void 0||e.register({[Fr]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),_.info(Ee+" "+e.replace("_"," "),t),H(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},Ra=class{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){var e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Bi),group_properties:this.instance.get_property(Lt),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:e,compression:this.instance.config.disable_compression?void 0:at.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:t=>this.parseDecideResponse(t.json)})}parseDecideResponse(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var r=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},r),r)_.error("Failed to fetch feature flags from PostHog.");else{if(!T||!T.body)return _.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var n=function(l,a){var c,d;q["__$$ph_site_app_".concat(l)]=t.instance,(c=q.__PosthogExtensions__)===null||c===void 0||(d=c.loadSiteApp)===null||d===void 0||d.call(c,t.instance,a,u=>{if(u)return _.error("Error while initializing PostHog app with config id ".concat(l),u)})};for(var{id:s,url:o}of e.siteApps)n(s,o)}else e.siteApps.length>0&&_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},kt,Xf=v!=null&&v.location?cs(v.location.hash,"__posthog")||cs(location.hash,"state"):null,ad="_postHogToolbarParams";(function(i){i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED"})(kt||(kt={}));var Oa=class{constructor(e){this.instance=e}setToolbarState(e){q.ph_toolbar_state=e}getToolbarState(){var e;return(e=q.ph_toolbar_state)!==null&&e!==void 0?e:kt.UNINITIALIZED}maybeLoadToolbar(){var e,t,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!v||!T)return!1;r=(e=r)!==null&&e!==void 0?e:v.location,s=(t=s)!==null&&t!==void 0?t:v.history;try{if(!n){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}n=v?.localStorage}var o,l=Xf||cs(r.hash,"__posthog")||cs(r.hash,"state"),a=l?$c(()=>JSON.parse(atob(decodeURIComponent(l))))||$c(()=>JSON.parse(decodeURIComponent(l))):null;return a&&a.action==="ph_authorize"?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?r.hash=a.desiredHash:s?s.replaceState(s.state,"",r.pathname+r.search):r.hash="")):((o=JSON.parse(n.getItem(ad)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){(q.ph_load_toolbar||q.ph_load_editor)(e,this.instance)}loadToolbar(e){var t=!(T==null||!T.getElementById(Cd));if(!v||t)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=S(S({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(v.localStorage.setItem(ad,JSON.stringify(S(S({},n),{},{source:void 0}))),this.getToolbarState()===kt.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===kt.UNINITIALIZED){var s,o;this.setToolbarState(kt.LOADING),(s=q.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return _.error("Failed to load toolbar",l),void this.setToolbarState(kt.UNINITIALIZED);this.setToolbarState(kt.LOADED),this._callLoadToolbar(n)}),St(v,"turbolinks:load",()=>{this.setToolbarState(kt.UNINITIALIZED),this.loadToolbar(n)})}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,r)}},Fa=class{constructor(e){$(this,"isPaused",!0),$(this,"queue",[]),$(this,"flushTimeoutMs",3e3),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},t=Object.values(e),r=[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)];r.map(n=>{this.sendRequest(S(S({},n),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),r=function(s){var o=t[s],l=new Date().getTime();o.data&&he(o.data)&&K(o.data,a=>{a.offset=Math.abs(a.timestamp-l),delete a.timestamp}),e.sendRequest(o)};for(var n in t)r(n)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return K(this.queue,t=>{var r,n=t,s=(n?n.batchKey:null)||n.url;F(e[s])&&(e[s]=S(S({},n),{},{data:[]})),(r=e[s].data)===null||r===void 0||r.push(n.data)}),this.queue=[],e}},Yf=!!ra||!!ia,ld="text/plain",vs=(i,e)=>{var[t,r]=i.split("?"),n=S({},e);r?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=gf(n);return s=s?(r?r+"&":"")+s:r,"".concat(t,"?").concat(s)},Qo=i=>{var{data:e,compression:t}=i;if(e){if(t===at.GZipJS){var r=rp(np(JSON.stringify(e)),{mtime:0}),n=new Blob([r],{type:ld});return{contentType:ld,body:n,estimatedSize:n.size}}if(t===at.Base64){var s=function(a){var c,d,u,p,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,k=0,w="",b=[];if(!a)return a;a=ef(a);do c=(h=a.charCodeAt(m++)<<16|a.charCodeAt(m++)<<8|a.charCodeAt(m++))>>18&63,d=h>>12&63,u=h>>6&63,p=63&h,b[k++]=g.charAt(c)+g.charAt(d)+g.charAt(u)+g.charAt(p);while(m<a.length);switch(w=b.join(""),a.length%3){case 1:w=w.slice(0,-2)+"==";break;case 2:w=w.slice(0,-1)+"="}return w}(JSON.stringify(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:JSON.stringify(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=JSON.stringify(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},Ur=[];ra&&Ur.push({transport:"XHR",method:i=>{var e,t=new ra;t.open(i.method||"GET",i.url,!0);var{contentType:r,body:n}=(e=Qo(i))!==null&&e!==void 0?e:{};K(i.headers,function(s,o){t.setRequestHeader(o,s)}),r&&t.setRequestHeader("Content-Type",r),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var s,o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}(s=i.callback)===null||s===void 0||s.call(i,o)}},t.send(n)}}),ia&&Ur.push({transport:"fetch",method:i=>{var e,t,{contentType:r,body:n,estimatedSize:s}=(e=Qo(i))!==null&&e!==void 0?e:{},o=new Headers;K(i.headers,function(d,u){o.append(u,d)}),r&&o.append("Content-Type",r);var l=i.url,a=null;if(Cc){var c=new Cc;a={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}ia(l,{method:i?.method||"GET",headers:o,keepalive:i.method==="POST"&&(s||0)<52428.8,body:n,signal:(t=a)===null||t===void 0?void 0:t.signal}).then(d=>d.text().then(u=>{var p,h={statusCode:d.status,text:u};if(d.status===200)try{h.json=JSON.parse(u)}catch(g){_.error(g)}(p=i.callback)===null||p===void 0||p.call(i,h)})).catch(d=>{var u;_.error(d),(u=i.callback)===null||u===void 0||u.call(i,{statusCode:0,text:d})}).finally(()=>a?clearTimeout(a.timeout):null)}}),Je!=null&&Je.sendBeacon&&Ur.push({transport:"sendBeacon",method:i=>{var e=vs(i.url,{beacon:"1"});try{var t,{contentType:r,body:n}=(t=Qo(i))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:r}):n;Je.sendBeacon(e,s)}catch{}}});var Kf=["retriesPerformedSoFar"],Da=class{constructor(e){$(this,"isPolling",!1),$(this,"pollIntervalMs",3e3),$(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!F(v)&&"onLine"in v.navigator&&(this.areWeOnline=v.navigator.onLine,v.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),v.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){var{retriesPerformedSoFar:t}=e,r=of(e,Kf);Ge(t)&&t>0&&(r.url=vs(r.url,{retry_count:t})),this.instance._send_request(S(S({},r),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(S({retriesPerformedSoFar:t},r)):(s=r.callback)===null||s===void 0||s.call(r,n)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(o){var l=3e3*Math.pow(2,o),a=l/2,c=Math.min(18e5,l),d=(Math.random()-.5)*(c-a);return Math.ceil(c+d)}(t),n=Date.now()+r;this.queue.push({retryAt:n,requestOptions:e});var s="Enqueued failed request for retry in ".concat(r);navigator.onLine||(s+=" (Browser is offline)"),_.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var e=Date.now(),t=[],r=this.queue.filter(s=>s.retryAt<e||(t.push(s),!1));if(this.queue=t,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(S(S({},e),{},{transport:"sendBeacon"}))}catch(t){_.error(t)}this.queue=[]}},hi,Ma=class{constructor(e,t,r,n){var s;$(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Ut,this._windowIdGenerator=n||Ut;var o=e.persistence_name||e.token,l=e.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Et(l,60,1800,"session_idle_timeout_seconds"),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=Ce.parse(this._window_id_storage_key),c=Ce.parse(this._primary_window_exists_storage_key);a&&!c?this._windowId=a:Ce.remove(this._window_id_storage_key),Ce.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var d=(u=>{var p=u.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),d)}catch(u){_.error("Invalid sessionID in bootstrap",u)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ce.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ce.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ce.parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[os]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[os];return he(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){v?.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&Ce.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),[r,n,s]=this._getSessionId(),o=this._getWindowId(),l=Ge(s)&&s>0&&Math.abs(t-s)>864e5,a=!1,c=!n,d=!e&&Math.abs(t-r)>this.sessionTimeoutMs;c||d||l?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),_.info("[SessionId] new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}}),s=t,a=!0):o||(o=this._windowIdGenerator(),a=!0);var u=r===0||!e||l?t:r,p=s===0?new Date().getTime():s;return this._setWindowId(o),this._setSessionId(n,u,p),a&&this._sessionIdChangedHandlers.forEach(h=>h(n,o,a?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:a?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}};(function(i){i.US="us",i.EU="eu",i.CUSTOM="custom"})(hi||(hi={}));var ud="i.posthog.com",La=class{constructor(e){$(this,"_regionCache",{}),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 uiHost(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(ud),".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=hi.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=hi.EU:this._regionCache[this.apiHost]=hi.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t&&(t=t[0]==="/"?t:"/".concat(t)),e==="ui")return this.uiHost+t;if(this.region===hi.CUSTOM)return this.apiHost+t;var r=ud+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}},sp="posthog-js";function op(i){var{organization:e,projectId:t,prefix:r,severityAllowList:n=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=>{var o,l,a,c,d;if(!(n==="*"||n.includes(s.level))||!i.__loaded)return s;s.tags||(s.tags={});var u=i.requestRouter.endpointFor("ui","/project/".concat(i.config.token,"/person/").concat(i.get_distinct_id()));s.tags["PostHog Person URL"]=u,i.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var p=((o=s.exception)===null||o===void 0?void 0:o.values)||[];p.map(g=>{g.stacktrace&&(g.stacktrace.type="raw")});var h={$exception_message:((l=p[0])===null||l===void 0?void 0:l.value)||s.message,$exception_type:(a=p[0])===null||a===void 0?void 0:a.type,$exception_personURL:u,$exception_level:s.level,$exception_list:p,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((c=p[0])===null||c===void 0?void 0:c.value)||s.message,$sentry_exception_type:(d=p[0])===null||d===void 0?void 0:d.type,$sentry_tags:s.tags,$level:s.level};return e&&t&&(h.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+t+"&query="+s.event_id),i.exceptions.sendExceptionEvent(h),s}}var Na=class{constructor(e,t,r,n,s){this.name=sp,this.setupOnce=function(o){o(op(e,{organization:t,projectId:r,prefix:n,severityAllowList:s}))}}},cd,ms,st;function Zf(i,e){var t=i.config.segment;if(!t)return e();(function(r,n){var s=r.config.segment;if(!s)return n();var o=a=>{var c=()=>a.anonymousId()||Ut();r.config.get_device_id=c,a.id()&&(r.register({distinct_id:a.id(),$device_id:c()}),r.persistence.set_property(wt,"identified")),n()},l=s.user();"then"in l&&Ze(l.then)?l.then(a=>o(a)):o(l)})(i,()=>{t.register((r=>{Promise&&Promise.resolve||_.warn("This browser does not have Promise support, and can not use the segment integration");var n=(s,o)=>{var l;if(!o)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(_.info("Segment integration does not have a userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(_.info("Segment integration has a userId set, identifying with PostHog"),r.identify(s.event.userId));var a=r._calculate_event_properties(o,(l=s.event.properties)!==null&&l!==void 0?l:{},new Date);return s.event.properties=Object.assign({},a,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>n(s,s.event.event),page:s=>n(s,"$pageview"),identify:s=>n(s,"$identify"),screen:s=>n(s,"$screen")}})(i)).then(()=>{e()})})}var Ua=class{constructor(e){this._instance=e}doPageView(e){var t,r=this._previousPageViewProperties(e);return this._currentPath=(t=v?.location.pathname)!==null&&t!==void 0?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,r}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){var t=this._currentPath,r=this._prevPageviewTimestamp,n=this._instance.scrollManager.getContext();if(!r)return{};var s={};if(n){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:a,maxContentHeight:c,lastContentY:d,maxContentY:u}=n;F(o)||F(l)||F(a)||F(c)||F(d)||F(u)||(o=Math.ceil(o),l=Math.ceil(l),a=Math.ceil(a),c=Math.ceil(c),d=Math.ceil(d),u=Math.ceil(u),s={$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:o<=1?1:Et(l/o,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:o<=1?1:Et(a/o,0,1),$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:c<=1?1:Et(d/c,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:c<=1?1:Et(u/c,0,1)})}return t&&(s.$prev_pageview_pathname=t),r&&(s.$prev_pageview_duration=(e.getTime()-r.getTime())/1e3),s}};(function(i){i.Popover="popover",i.API="api",i.Widget="widget"})(cd||(cd={})),function(i){i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link"}(ms||(ms={})),function(i){i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question"}(st||(st={}));var _s=class{constructor(){$(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(r=>r!==t)}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var n of this.events["*"]||[])n(e,t)}},ja=class i{constructor(e){$(this,"_debugEventEmitter",new _s),$(this,"checkStep",(t,r)=>this.checkStepEvent(t,r)&&this.checkStepUrl(t,r)&&this.checkStepElement(t,r)),$(this,"checkStepEvent",(t,r)=>r==null||!r.event||t?.event===r?.event),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!F((e=this.instance)===null||e===void 0?void 0:e._addCaptureHook)){var t;(t=this.instance)===null||t===void 0||t._addCaptureHook((r,n)=>{this.on(r,n)})}}register(e){var t,r;if(!F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)&&(e.forEach(o=>{var l,a;(l=this.actionRegistry)===null||l===void 0||l.add(o),(a=o.steps)===null||a===void 0||a.forEach(c=>{var d;(d=this.actionEvents)===null||d===void 0||d.add(c?.event||"")})}),(r=this.instance)!==null&&r!==void 0&&r.autocapture)){var n,s=new Set;e.forEach(o=>{var l;(l=o.steps)===null||l===void 0||l.forEach(a=>{a!=null&&a.selector&&s.add(a?.selector)})}),(n=this.instance)===null||n===void 0||n.autocapture.setElementSelectors(s)}}on(e,t){var r;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((r=this.actionRegistry)===null||r===void 0?void 0:r.size)>0&&this.actionRegistry.forEach(n=>{this.checkAction(t,n)&&this._debugEventEmitter.emit("actionCaptured",n.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}checkAction(e,t){if(t?.steps==null)return!1;for(var r of t.steps)if(this.checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(t!=null&&t.url){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$current_url;if(!n||typeof n!="string"||!i.matchString(n,t?.url,t?.url_matching||"contains"))return!1}return!0}static matchString(e,t,r){switch(r){case"regex":return!!v&&Vi(e,t);case"exact":return t===e;case"contains":var n=i.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Vi(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.getElementsList(e).some(s=>!(t!=null&&t.href&&!i.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!i.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!i.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var r,n=e==null||(r=e.properties)===null||r===void 0?void 0:r.$element_selectors;if(!n||!n.includes(t?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},Wr=class i{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;F((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.actions)&&((s=r.conditions)===null||s===void 0||(o=s.actions)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0});t.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new ja(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(r=>{this.onAction(r)})),t.forEach(r=>{var n,s,o,l,a,c,d,u,p,h;r.conditions&&(n=r.conditions)!==null&&n!==void 0&&n.actions&&(s=r.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((l=r.conditions)===null||l===void 0||(a=l.actions)===null||a===void 0||(c=a.values)===null||c===void 0?void 0:c.length)>0&&((d=this.actionMatcher)===null||d===void 0||d.register(r.conditions.actions.values),(u=r.conditions)===null||u===void 0||(p=u.actions)===null||p===void 0||(h=p.values)===null||h===void 0||h.forEach(g=>{if(g&&g.name){var m=this.actionToSurveys.get(g.name);m&&m.push(r.id),this.actionToSurveys.set(g.name,m||[r.id])}}))}))}setupEventBasedSurveys(e){var t;e.filter(r=>{var n,s,o,l;return((n=r.conditions)===null||n===void 0?void 0:n.events)&&((s=r.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(l=o.values)===null||l===void 0?void 0:l.length)>0}).length!==0&&((t=this.instance)===null||t===void 0||t._addCaptureHook((r,n)=>{this.onEvent(r,n)}),e.forEach(r=>{var n,s,o;(n=r.conditions)===null||n===void 0||(s=n.events)===null||s===void 0||(o=s.values)===null||o===void 0||o.forEach(l=>{if(l&&l.name){var a=this.eventToSurveys.get(l.name);a&&a.push(r.id),this.eventToSurveys.set(l.name,a||[r.id])}})}))}onEvent(e,t){var r,n,s=((r=this.instance)===null||r===void 0||(n=r.persistence)===null||n===void 0?void 0:n.props[Gn])||[];if(i.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,l=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(l){var a=s.indexOf(l);a>=0&&(s.splice(a,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,r,n=((t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0?void 0:r.props[Gn])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,r;(t=this.instance)===null||t===void 0||(r=t.persistence)===null||r===void 0||r.register({[Gn]:[...new Set(e)]})}getSurveys(){var e,t,r=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[Gn];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};$(Wr,"SURVEY_SHOWN_EVENT_NAME","survey shown");var ap,oe,lp,di,dd,up,qa,cp,Ba={},dp=[],Qf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pl=Array.isArray;function jt(i,e){for(var t in e)i[t]=e[t];return i}function pp(i){var e=i.parentNode;e&&e.removeChild(i)}function ea(i,e,t,r,n){var s={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++lp,__i:-1,__u:0};return n==null&&oe.vnode!=null&&oe.vnode(s),s}function hl(i){return i.children}function rs(i,e){this.props=i,this.context=e}function Yi(i,e){if(e==null)return i.__?Yi(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Yi(i):null}function hp(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return hp(i)}}function Ha(i){(!i.__d&&(i.__d=!0)&&di.push(i)&&!ys.__r++||dd!==oe.debounceRendering)&&((dd=oe.debounceRendering)||up)(ys)}function ys(){var i,e,t,r,n,s,o,l,a;for(di.sort(qa);i=di.shift();)i.__d&&(e=di.length,r=void 0,s=(n=(t=i).__v).__e,l=[],a=[],(o=t.__P)&&((r=jt({},n)).__v=n.__v+1,oe.vnode&&oe.vnode(r),vp(o,r,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??Yi(n),!!(32&n.__u),a),r.__.__k[r.__i]=r,ig(l,r,a),r.__e!=s&&hp(r)),di.length>e&&di.sort(qa));ys.__r=0}function fp(i,e,t,r,n,s,o,l,a,c,d){var u,p,h,g,m,k=r&&r.__k||dp,w=e.length;for(t.__d=a,eg(t,e,k),a=t.__d,u=0;u<w;u++)(h=t.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(p=h.__i===-1?Ba:k[h.__i]||Ba,h.__i=u,vp(i,h,p,n,s,o,l,a,c,d),g=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&fl(p.ref,null,h),d.push(h.ref,h.__c||g,h)),m==null&&g!=null&&(m=g),65536&h.__u||p.__k===h.__k?a=gp(h,a,i):typeof h.type=="function"&&h.__d!==void 0?a=h.__d:g&&(a=g.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=a,t.__e=m}function eg(i,e,t){var r,n,s,o,l,a=e.length,c=t.length,d=c,u=0;for(i.__k=[],r=0;r<a;r++)(n=i.__k[r]=(n=e[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?ea(null,n,null,null,n):pl(n)?ea(hl,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?ea(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=i,n.__b=i.__b+1,l=tg(n,t,o=r+u,d),n.__i=l,s=null,l!==-1&&(d--,(s=t[l])&&(s.__u|=131072)),s==null||s.__v===null?(l==-1&&u--,typeof n.type!="function"&&(n.__u|=65536)):l!==o&&(l===o+1?u++:l>o?d>a-o?u+=l-o:u--:u=l<o&&l==o-1?l-o:0,l!==r+u&&(n.__u|=65536))):(s=t[r])&&s.key==null&&s.__e&&(s.__e==i.__d&&(i.__d=Yi(s)),za(s,s,!1),t[r]=null,d--);if(d)for(r=0;r<c;r++)(s=t[r])!=null&&!(131072&s.__u)&&(s.__e==i.__d&&(i.__d=Yi(s)),za(s,s))}function gp(i,e,t){var r,n;if(typeof i.type=="function"){for(r=i.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=i,e=gp(r[n],e,t));return e}return i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e),e&&e.nextSibling}function tg(i,e,t,r){var n=i.key,s=i.type,o=t-1,l=t+1,a=e[t];if(a===null||a&&n==a.key&&s===a.type)return t;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;o>=0||l<e.length;){if(o>=0){if((a=e[o])&&!(131072&a.__u)&&n==a.key&&s===a.type)return o;o--}if(l<e.length){if((a=e[l])&&!(131072&a.__u)&&n==a.key&&s===a.type)return l;l++}}return-1}function pd(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||Qf.test(e)?t:t+"px"}function Qn(i,e,t,r,n){var s;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||pd(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||pd(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in i?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+s]=t,t?r?t.u=r.u:(t.u=Date.now(),i.addEventListener(e,s?fd:hd,s)):i.removeEventListener(e,s?fd:hd,s);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,t))}}function hd(i){var e=this.l[i.type+!1];if(i.t){if(i.t<=e.u)return}else i.t=Date.now();return e(oe.event?oe.event(i):i)}function fd(i){return this.l[i.type+!0](oe.event?oe.event(i):i)}function vp(i,e,t,r,n,s,o,l,a,c){var d,u,p,h,g,m,k,w,b,O,D,z,X,W,R,j=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),s=[l=e.__e=t.__e]),(d=oe.__b)&&d(e);e:if(typeof j=="function")try{if(w=e.props,b=(d=j.contextType)&&r[d.__c],O=d?b?b.props.value:d.__:r,t.__c?k=(u=e.__c=t.__c).__=u.__E:("prototype"in j&&j.prototype.render?e.__c=u=new j(w,O):(e.__c=u=new rs(w,O),u.constructor=j,u.render=ng),b&&b.sub(u),u.props=w,u.state||(u.state={}),u.context=O,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),j.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=jt({},u.__s)),jt(u.__s,j.getDerivedStateFromProps(w,u.__s))),h=u.props,g=u.state,u.__v=e,p)j.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(j.getDerivedStateFromProps==null&&w!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,O),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,O)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(u.props=w,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(J){J&&(J.__=e)}),D=0;D<u._sb.length;D++)u.__h.push(u._sb[D]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,O),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,m)})}if(u.context=O,u.props=w,u.__P=i,u.__e=!1,z=oe.__r,X=0,"prototype"in j&&j.prototype.render){for(u.state=u.__s,u.__d=!1,z&&z(e),d=u.render(u.props,u.state,u.context),W=0;W<u._sb.length;W++)u.__h.push(u._sb[W]);u._sb=[]}else do u.__d=!1,z&&z(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++X<25);u.state=u.__s,u.getChildContext!=null&&(r=jt(jt({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(m=u.getSnapshotBeforeUpdate(h,g)),fp(i,pl(R=d!=null&&d.type===hl&&d.key==null?d.props.children:d)?R:[R],e,t,r,n,s,o,l,a,c),u.base=e.__e,e.__u&=-161,u.__h.length&&o.push(u),k&&(u.__E=u.__=null)}catch(J){e.__v=null,a||s!=null?(e.__e=l,e.__u|=a?160:32,s[s.indexOf(l)]=null):(e.__e=t.__e,e.__k=t.__k),oe.__e(J,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=rg(t.__e,e,t,r,n,s,o,a,c);(d=oe.diffed)&&d(e)}function ig(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)fl(t[r],t[++r],t[++r]);oe.__c&&oe.__c(e,i),i.some(function(n){try{i=n.__h,n.__h=[],i.some(function(s){s.call(n)})}catch(s){oe.__e(s,n.__v)}})}function rg(i,e,t,r,n,s,o,l,a){var c,d,u,p,h,g,m,k=t.props,w=e.props,b=e.type;if(b==="svg"&&(n=!0),s!=null){for(c=0;c<s.length;c++)if((h=s[c])&&"setAttribute"in h==!!b&&(b?h.localName===b:h.nodeType===3)){i=h,s[c]=null;break}}if(i==null){if(b===null)return document.createTextNode(w);i=n?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,w.is&&w),s=null,l=!1}if(b===null)k===w||l&&i.data===w||(i.data=w);else{if(s=s&&ap.call(i.childNodes),k=t.props||Ba,!l&&s!=null)for(k={},c=0;c<i.attributes.length;c++)k[(h=i.attributes[c]).name]=h.value;for(c in k)h=k[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=h:c==="key"||c in w||Qn(i,c,null,h,n));for(c in w)h=w[c],c=="children"?p=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?g=h:c=="checked"?m=h:c==="key"||l&&typeof h!="function"||k[c]===h||Qn(i,c,h,k[c],n);if(d)l||u&&(d.__html===u.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(u&&(i.innerHTML=""),fp(i,pl(p)?p:[p],e,t,r,n&&b!=="foreignObject",s,o,s?s[0]:t.__k&&Yi(t,0),l,a),s!=null)for(c=s.length;c--;)s[c]!=null&&pp(s[c]);l||(c="value",g!==void 0&&(g!==i[c]||b==="progress"&&!g||b==="option"&&g!==k[c])&&Qn(i,c,g,k[c],!1),c="checked",m!==void 0&&m!==i[c]&&Qn(i,c,m,k[c],!1))}return i}function fl(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){oe.__e(r,t)}}function za(i,e,t){var r,n;if(oe.unmount&&oe.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||fl(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){oe.__e(s,e)}r.base=r.__P=null,i.__c=void 0}if(r=i.__k)for(n=0;n<r.length;n++)r[n]&&za(r[n],e,t||typeof i.type!="function");t||i.__e==null||pp(i.__e),i.__=i.__e=i.__d=void 0}function ng(i,e,t){return this.constructor(i,t)}ap=dp.slice,oe={__e:function(i,e,t,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(i)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,r||{}),o=n.__d),o)return n.__E=n}catch(l){i=l}throw i}},lp=0,rs.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=jt({},this.state),typeof i=="function"&&(i=i(jt({},t),this.props)),i&&jt(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Ha(this))},rs.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Ha(this))},rs.prototype.render=hl,di=[],up=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qa=function(i,e){return i.__v.__b-e.__v.__b},ys.__r=0,cp=0;(function(i,e){var t={__c:e="__cC"+cp++,__:i,Consumer:function(r,n){return r.children(n)},Provider:function(r){var n,s;return this.getChildContext||(n=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&n.some(function(l){l.__e=!0,Ha(l)})},this.sub=function(o){n.push(o);var l=o.componentWillUnmount;o.componentWillUnmount=function(){n.splice(n.indexOf(o),1),l&&l.call(o)}}),r.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0});var Pr="[Surveys]",sg={icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:i=>!!v&&v.location.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:i=>!!v&&Vi(v.location.href,i),not_regex:i=>!!v&&!Vi(v.location.href,i),exact:i=>v?.location.href===i,is_not:i=>v?.location.href!==i},Wa=class{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var t=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);n!=null&&n.startsWith("seenSurvey_")&&t.push(n)}return t})();e.forEach(t=>localStorage.removeItem(t))}loadIfEnabled(){var e,t,r,n=q==null||(e=q.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Wr(this.instance)),(t=q.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"surveys",s=>{var o,l;if(s)return _.error(Pr,"Could not load surveys script",s);this._surveyManager=(o=q.__PosthogExtensions__)===null||o===void 0||(l=o.generateSurveys)===null||l===void 0?void 0:l.call(o,this.instance)}))}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Wr(this.instance));var r=this.instance.get_property(la);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:n=>{var s;if(n.statusCode!==200||!n.json)return e([]);var o,l=n.json.surveys||[],a=l.filter(c=>{var d,u,p,h,g,m,k,w,b,O,D,z;return((d=c.conditions)===null||d===void 0?void 0:d.events)&&((u=c.conditions)===null||u===void 0||(p=u.events)===null||p===void 0?void 0:p.values)&&((h=c.conditions)===null||h===void 0||(g=h.events)===null||g===void 0||(m=g.values)===null||m===void 0?void 0:m.length)>0||((k=c.conditions)===null||k===void 0?void 0:k.actions)&&((w=c.conditions)===null||w===void 0||(b=w.actions)===null||b===void 0?void 0:b.values)&&((O=c.conditions)===null||O===void 0||(D=O.actions)===null||D===void 0||(z=D.values)===null||z===void 0?void 0:z.length)>0});return a.length>0&&((o=this._surveyEventReceiver)===null||o===void 0||o.register(a)),(s=this.instance.persistence)===null||s===void 0||s.register({[la]:l}),e(l)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(r=>{var n,s=r.filter(a=>!(!a.start_date||a.end_date)).filter(a=>{var c,d,u,p;if(!a.conditions)return!0;var h=(c=a.conditions)===null||c===void 0||!c.url||sg[(d=(u=a.conditions)===null||u===void 0?void 0:u.urlMatchType)!==null&&d!==void 0?d:"icontains"](a.conditions.url),g=(p=a.conditions)===null||p===void 0||!p.selector||T?.querySelector(a.conditions.selector);return h&&g}),o=(n=this._surveyEventReceiver)===null||n===void 0?void 0:n.getSurveys(),l=s.filter(a=>{var c,d,u,p,h,g,m,k,w,b;if(!a.linked_flag_key&&!a.targeting_flag_key&&!a.internal_targeting_flag_key)return!0;var O=!a.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),D=!a.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key),z=((c=a.conditions)===null||c===void 0?void 0:c.events)&&((d=a.conditions)===null||d===void 0||(u=d.events)===null||u===void 0?void 0:u.values)&&((p=a.conditions)===null||p===void 0||(h=p.events)===null||h===void 0?void 0:h.values.length)>0,X=((g=a.conditions)===null||g===void 0?void 0:g.actions)&&((m=a.conditions)===null||m===void 0||(k=m.actions)===null||k===void 0?void 0:k.values)&&((w=a.conditions)===null||w===void 0||(b=w.actions)===null||b===void 0?void 0:b.values.length)>0,W=!z&&!X||o?.includes(a.id),R=this._canActivateRepeatedly(a),j=!(a.internal_targeting_flag_key&&!R)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key);return O&&D&&j&&W});return e(l)},t)}getNextSurveyStep(e,t,r){var n,s=e.questions[t],o=t+1;if((n=s.branching)===null||n===void 0||!n.type)return t===e.questions.length-1?st.End:o;if(s.branching.type===st.End)return st.End;if(s.branching.type===st.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===st.ResponseBased){if(s.type===ms.SingleChoice){var l,a,c=s.choices.indexOf("".concat(r));if((l=s.branching)!==null&&l!==void 0&&(a=l.responseValues)!==null&&a!==void 0&&a.hasOwnProperty(c)){var d=s.branching.responseValues[c];return Number.isInteger(d)?d:d===st.End?st.End:o}}else if(s.type===ms.Rating){var u,p;if(typeof r!="number"||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(m,k){if(k===3){if(m<1||m>3)throw new Error("The response must be in range 1-3");return m===1?"negative":m===2?"neutral":"positive"}if(k===5){if(m<1||m>5)throw new Error("The response must be in range 1-5");return m<=2?"negative":m===3?"neutral":"positive"}if(k===7){if(m<1||m>7)throw new Error("The response must be in range 1-7");return m<=3?"negative":m===4?"neutral":"positive"}if(k===10){if(m<0||m>10)throw new Error("The response must be in range 0-10");return m<=6?"detractors":m<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,s.scale);if((u=s.branching)!==null&&u!==void 0&&(p=u.responseValues)!==null&&p!==void 0&&p.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===st.End?st.End:o}}return o}return _.warn(Pr,"Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return ee((t=q.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(_.warn(Pr,"canActivateRepeatedly is not defined, must init before calling"),!1):q.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){ee(this._surveyManager)?_.warn(Pr,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(t=>{var r=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(r)})}renderSurvey(e,t){ee(this._surveyManager)?_.warn(Pr,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(r=>{var n=r.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,T?.querySelector(t))})}},Va=class{constructor(e){var t,r;$(this,"serverLimits",{}),$(this,"lastEventRateLimited",!1),$(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{_.info("[RateLimiter] ".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void _.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(o?.message,'"'),{text:s})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,r,n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(ca))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var l=o.tokens<1;return l||n||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||n||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(r=this.instance.persistence)===null||r===void 0||r.set_property(ca,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},og=()=>S({initialPathName:qe?.pathname||"",referringDomain:ue.referringDomain()},ue.campaignParams()),Ga=class{constructor(e,t,r){$(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[ua]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=r||og,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[ua]}getSessionProps(){var e,t=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}},ag=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],gd=function(i,e){if(!i)return!1;var t=i.toLowerCase();return ag.concat(e||[]).some(r=>{var n=r.toLowerCase();return t.indexOf(n)!==-1})},mp=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&gd(t,e))return!0;try{var r=i?.userAgentData;if(r!=null&&r.brands&&r.brands.some(n=>gd(n?.brand,e)))return!0}catch{}return!!i.webdriver},bs=class{constructor(){this.clicks=[]}isRageClick(e,t,r){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&r-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}},es="[Dead Clicks]",lg=()=>!0,ug=i=>{var e,t=!((e=i.instance.persistence)===null||e===void 0||!e.get_property(Ed)),r=i.instance.config.capture_dead_clicks;return pi(r)?r:t},ws=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}afterDecideResponse(e){this.instance.persistence&&this.instance.persistence.register({[Ed]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,r,n;(t=q.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(r=q.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"dead-clicks-autocapture",s=>{s?_.error(es+" failed to load script",s):e()})}start(){var e;if(T){if(!this._lazyLoadedDeadClicksAutocapture&&(e=q.__PosthogExtensions__)!==null&&e!==void 0&&e.initDeadClicksAutocapture){var t=fe(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=q.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(T),_.info("".concat(es," starting..."))}}else _.error(es+" `document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,_.info("".concat(es," stopping...")))}},Ja=class{constructor(e){var t;$(this,"rageclicks",new bs),$(this,"_enabledServerSide",!1),$(this,"_initialized",!1),$(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[sa]),v?.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return fe(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 F(this.instance.config.capture_heatmaps)?F(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;_.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this._flushInterval)!==null&&e!==void 0?e:void 0),(t=this.deadClicksCapture)===null||t===void 0||t.stop(),this.getAndClearBuffer()}}afterDecideResponse(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[sa]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){v&&T&&(St(T,"click",e=>this._onClick(e||v?.event),!1,!0),St(T,"mousemove",e=>this._onMouseMove(e||v?.event),!1,!0),this.deadClicksCapture=new ws(this.instance,lg,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,a,c){for(var d=l;d&&Es(d)&&!Bt(d,"body");){if(d===c)return!1;if(H(a,v?.getComputedStyle(d).position))return!0;d=Gd(d)}return!1}(Vd(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:t}}_onClick(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!Yc(e.target)){var n=this._getProperties(e,r);(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(S(S({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){Yc(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(v){var t=v.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!ji(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},Xa=class{constructor(e){$(this,"_updateScrollData",()=>{var t,r,n,s;this.context||(this.context={});var o=this.scrollElement(),l=this.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=l+(o?.clientHeight||0),d=o?.scrollHeight||0;this.context.lastScrollY=Math.ceil(l),this.context.maxScrollY=Math.max(l,(t=this.context.maxScrollY)!==null&&t!==void 0?t:0),this.context.maxScrollHeight=Math.max(a,(r=this.context.maxScrollHeight)!==null&&r!==void 0?r:0),this.context.lastContentY=c,this.context.maxContentY=Math.max(c,(n=this.context.maxContentY)!==null&&n!==void 0?n:0),this.context.maxContentHeight=Math.max(d,(s=this.context.maxContentHeight)!==null&&s!==void 0?s:0)}),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){v?.addEventListener("scroll",this._updateScrollData,!0),v?.addEventListener("scrollend",this._updateScrollData,!0),v?.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return v?.document.documentElement;var e=he(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var r=v?.document.querySelector(t);if(r)return r}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return v&&(v.scrollY||v.pageYOffset||v.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return v&&(v.scrollX||v.pageXOffset||v.document.documentElement.scrollLeft)||0}};function ta(i,e){return e.length>i?e.slice(0,i)+"...":e}function cg(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!Es(e));return e}function dg(i,e,t,r){var n=i.tagName.toLowerCase(),s={tag_name:n};wa.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=ta(1024,Kd(i)):s.$el_text=ta(1024,Cs(i)));var o=hs(i);o.length>0&&(s.classes=o.filter(function(d){return d!==""})),K(i.attributes,function(d){var u;if((!Jd(i)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!e&&Ji(d.value)&&(u=d.name,!Pe(u)||u.substring(0,10)!=="_ngcontent"&&u.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=ul(p).join(" ")),s["attr__"+d.name]=ta(1024,p)}});for(var l=1,a=1,c=i;c=cg(c);)l++,c.tagName===i.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function pg(i,e){for(var t,r,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,c=[i],d=i;d.parentNode&&!Bt(d,"body");)zd(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var u,p=[],h={},g=!1,m=!1;if(K(c,D=>{var z=xa(D);D.tagName.toLowerCase()==="a"&&(g=D.getAttribute("href"),g=z&&g&&Ji(g)&&g),H(hs(D),"ph-no-capture")&&(m=!0),p.push(dg(D,s,o,l));var X=function(W){if(!xa(W))return{};var R={};return K(W.attributes,function(j){if(j.name&&j.name.indexOf("data-ph-capture-attribute")===0){var J=j.name.replace("data-ph-capture-attribute-",""),He=j.value;J&&He&&Ji(He)&&(R[J]=He)}}),R}(D);De(h,X)}),m)return{props:{},explicitNoCapture:m};if(o||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?p[0].$el_text=Kd(i):p[0].$el_text=Cs(i)),g){var k,w;p[0].attr__href=g;var b=(k=Mr(g))===null||k===void 0?void 0:k.host,O=v==null||(w=v.location)===null||w===void 0?void 0:w.host;b&&O&&b!==O&&(u=g)}return{props:De({$event_type:n.type,$ce_version:1},a?{$elements_chain:Rf(p)}:{$elements:p},(t=p[0])!==null&&t!==void 0&&t.$el_text?{$el_text:(r=p[0])===null||r===void 0?void 0:r.$el_text}:{},u&&n.type==="click"?{$external_click_url:u}:{},h)}}var Ya=class{constructor(e){$(this,"_initialized",!1),$(this,"_isDisabledServerSide",null),$(this,"rageclicks",new bs),$(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=fe(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),r.url_ignorelist=(t=r.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(v&&T){var e=r=>{r=r||v?.event;try{this._captureEvent(r)}catch(n){_.error("Failed to capture event",n)}},t=r=>{r=r||v?.event,this._captureEvent(r,Vo)};St(T,"submit",e,!1,!0),St(T,"change",e,!1,!0),St(T,"click",e,!1,!0),this.config.capture_copied_text&&(St(T,"copy",t,!1,!0),St(T,"cut",t,!1,!0))}}else _.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Rc]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(n=>{var s=T?.querySelectorAll(n);s?.forEach(o=>{e===o&&r.push(n)})}),r}get isEnabled(){var e,t,r=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Rc],n=this._isDisabledServerSide;if(Ht(n)&&!pi(r)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!r;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,n=Vd(e);Hd(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=t===Vo;if(n&&$f(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=pg(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(l)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(o.$element_selectors=a),t===Vo){var c,d=Wd(v==null||(c=v.getSelection())===null||c===void 0?void 0:c.toString()),u=e.type||"clipboard";if(!d)return!1;o.$selected_content=d,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Ze(T?.querySelectorAll)}},Ka=class{constructor(e){$(this,"_restoreXHRPatch",void 0),$(this,"_restoreFetchPatch",void 0),$(this,"_startCapturing",()=>{var t,r,n,s;F(this._restoreXHRPatch)&&((t=q.__PosthogExtensions__)===null||t===void 0||(r=t.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),F(this._restoreFetchPatch)&&((n=q.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,r,n;(t=q.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(r=q.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"tracing-headers",s=>{if(s)return _.error("[TRACING-HEADERS] failed to load script",s);e()})}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)===null||e===void 0||e.call(this),(t=this._restoreFetchPatch)===null||t===void 0||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}},Nt;(function(i){i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED"})(Nt||(Nt={}));var Za=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Nt.DENIED:this.storedConsent}isOptedOut(){return this.consent===Nt.DENIED||this.consent===Nt.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return e==="1"?Nt.GRANTED:e==="0"?Nt.DENIED:Nt.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?me:Ct;var t=e==="localStorage"?Ct:me;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)==="1"),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!wd([Je?.doNotTrack,Je?.msDoNotTrack,q.doNotTrack],e=>H([!0,1,"1","yes"],e))}},ts="[Exception Autocapture]",Qa=class{constructor(e){var t;$(this,"originalOnUnhandledRejectionHandler",void 0),$(this,"startCapturing",()=>{var r,n,s,o;if(v&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(r=q.__PosthogExtensions__)===null||r===void 0||(n=r.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=q.__PosthogExtensions__)===null||s===void 0||(o=s.errorWrappingFunctions)===null||o===void 0?void 0:o.wrapUnhandledRejection;if(l&&a)try{this.unwrapOnError=l(this.captureException.bind(this)),this.unwrapUnhandledRejection=a(this.captureException.bind(this))}catch(c){_.error(ts+" failed to start",c),this.stopCapturing()}else _.error(ts+" failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[Oc]),this.startIfEnabled()}get isEnabled(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}get isCapturing(){var e;return!(v==null||(e=v.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(_.info(ts+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,r;this.hasHandlers&&e(),(t=q.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"exception-autocapture",n=>{if(n)return _.error(ts+" failed to load script",n);e()})}stopCapturing(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}afterDecideResponse(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[Oc]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}},vd=9e5,ci="[Web Vitals]",el=class{constructor(e){var t;$(this,"_enabledServerSide",!1),$(this,"_initialized",!1),$(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),$(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((r,n)=>S(S({},r),{},{["$web_vitals_".concat(n.name,"_event")]:S({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),$(this,"_addToBuffer",r=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(F(s))_.error(ci+"Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this._currentURL();F(o)||(ee(r?.name)||ee(r?.value)?_.error(ci+"Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?_.error(ci+"Ignoring metric with value >= "+this._maxAllowedValue,r):(this.buffer.url!==o&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),F(this.buffer.url)&&(this.buffer.url=o),this.buffer.firstMetricTimestamp=F(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(S(S({},r),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),$(this,"_startCapturing",()=>{var r,n,s,o,l=q.__PosthogExtensions__;F(l)||F(l.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),r&&n&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this._addToBuffer.bind(this)),this._initialized=!0):_.error(ci+"web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Fc]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=fe(this.instance.config.capture_performance)?(e=this.instance.config.capture_performance)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return F(r)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[Dc])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=fe(this.instance.config.capture_performance)&&Ge(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:vd;return 0<e&&e<=6e4?vd:e}get isEnabled(){var e=fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return pi(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(_.info(ci+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){var t=fe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=fe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Fc]:t}),this.instance.persistence.register({[Dc]:r})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,r,n;(t=q.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(r=q.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"web-vitals",s=>{s?_.error(ci+" failed to load script",s):e()})}_currentURL(){var e=v?v.location.href:void 0;return e||_.error(ci+"Could not determine current URL"),e}},hg={icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!v&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!v&&Vi(e.href,i),not_regex:(i,e)=>!!v&&!Vi(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i},tl=class i{constructor(e){var t=this;$(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.getWebExperiments(n=>{i.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,n.forEach(s=>{if(s.feature_flag_key&&t._featureFlags&&t._featureFlags[s.feature_flag_key]){var o;t._flagToExperiments&&(i.logInfo("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=t._flagToExperiments)===null||o===void 0||o.set(s.feature_flag_key,s));var l=t._featureFlags[s.feature_flag_key];l&&s.variants[l]&&t.applyTransforms(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var a in s.variants){var c=s.variants[a];i.matchesTestVariant(c)&&t.applyTransforms(s.name,a,c.transforms)}})},r)}),this.instance=e,this.instance.onFeatureFlags&&this.instance.onFeatureFlags(r=>{this.applyFeatureFlagChanges(r)}),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){ee(this._flagToExperiments)||this.instance.config.disable_web_experiments||(i.logInfo("applying feature flags",e),e.forEach(t=>{var r;if(this._flagToExperiments&&(r=this._flagToExperiments)!==null&&r!==void 0&&r.has(t)){var n,s=this.instance.getFeatureFlag(t),o=(n=this._flagToExperiments)===null||n===void 0?void 0:n.get(t);s&&o!=null&&o.variants[s]&&this.applyTransforms(o.name,s,o.variants[s].transforms)}}))}afterDecideResponse(e){this._is_bot()?i.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){var e=i.getWindowLocation();if(e!=null&&e.search){var t=us(e?.search,"__experiment_id"),r=us(e?.search,"__experiment_variant");t&&r&&(i.logInfo("previewing web experiments ".concat(t," && ").concat(r)),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(t),r,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.instance.config.disable_web_experiments&&!r)return e([]);var n=this.instance.get_property("$web_experiments");if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var o=s.json.experiments||[];return e(o)}})}showPreviewWebExperiment(e,t,r){var n=r.filter(s=>s.id===e);n&&n.length>0&&(i.logInfo("Previewing web experiment [".concat(n[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(n[0].name,t,n[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!ee(e.conditions)&&i.matchUrlConditions(e)&&i.matchUTMConditions(e)}static matchUrlConditions(e){var t;if(ee(e.conditions)||ee((t=e.conditions)===null||t===void 0?void 0:t.url))return!0;var r,n,s,o=i.getWindowLocation();return!!o&&((r=e.conditions)===null||r===void 0||!r.url||hg[(n=(s=e.conditions)===null||s===void 0?void 0:s.urlMatchType)!==null&&n!==void 0?n:"icontains"](e.conditions.url,o))}static getWindowLocation(){return v?.location}static matchUTMConditions(e){var t;if(ee(e.conditions)||ee((t=e.conditions)===null||t===void 0?void 0:t.utm))return!0;var r=ue.campaignParams();if(r.utm_source){var n,s,o,l,a,c,d,u,p,h,g,m,k,w,b,O,D=(n=e.conditions)===null||n===void 0||(s=n.utm)===null||s===void 0||!s.utm_campaign||((o=e.conditions)===null||o===void 0||(l=o.utm)===null||l===void 0?void 0:l.utm_campaign)==r.utm_campaign,z=(a=e.conditions)===null||a===void 0||(c=a.utm)===null||c===void 0||!c.utm_source||((d=e.conditions)===null||d===void 0||(u=d.utm)===null||u===void 0?void 0:u.utm_source)==r.utm_source,X=(p=e.conditions)===null||p===void 0||(h=p.utm)===null||h===void 0||!h.utm_medium||((g=e.conditions)===null||g===void 0||(m=g.utm)===null||m===void 0?void 0:m.utm_medium)==r.utm_medium,W=(k=e.conditions)===null||k===void 0||(w=k.utm)===null||w===void 0||!w.utm_term||((b=e.conditions)===null||b===void 0||(O=b.utm)===null||O===void 0?void 0:O.utm_term)==r.utm_term;return D&&X&&W&&z}return!1}static logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];_.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r,n){var s;this._is_bot()?i.logInfo("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?r.forEach(o=>{if(o.selector){var l;i.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),o);var a,c=0,d=(l=document)===null||l===void 0?void 0:l.querySelectorAll(o.selector);d?.forEach(u=>{var p=u;c+=1,o.attributes&&o.attributes.forEach(h=>{switch(h.name){case"text":p.innerText=h.value;break;case"html":p.innerHTML=h.value;break;case"cssClass":p.className=h.value;break;default:p.setAttribute(h.name,h.value)}}),o.text&&(p.innerText=o.text),o.html&&(p.parentElement?p.parentElement.innerHTML=o.html:p.innerHTML=o.html),o.css&&p.setAttribute("style",o.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:n,$web_experiment_document_url:(a=i.getWindowLocation())===null||a===void 0?void 0:a.href,$web_experiment_elements_modified:c})}}):(i.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:n,$web_experiment_variant:t,$web_experiment_document_url:(s=i.getWindowLocation())===null||s===void 0?void 0:s.href,$web_experiment_elements_modified:0}))}_is_bot(){return Je&&this.instance?mp(Je,this.instance.config.custom_blocked_useragents):void 0}},il=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},jr={},rl=()=>{},Ui="posthog",_p=!Yf&&ke?.indexOf("MSIE")===-1&&ke?.indexOf("Mozilla")===-1,md=()=>{var i,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=T?.location,t=e?.hostname,!!Pe(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:rl,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:qe&&Pe(qe?.search)&&qe.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(i=v.location)===null||i===void 0?void 0:i.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:r=>{var n="Bad HTTP status: "+r.statusCode+" "+r.text;_.error(n)},get_device_id:r=>r,_onCapture:rl,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},_d=i=>{var e={};F(i.process_person)||(e.person_profiles=i.process_person),F(i.xhr_headers)||(e.request_headers=i.xhr_headers),F(i.cookie_name)||(e.persistence_name=i.cookie_name),F(i.disable_cookie)||(e.disable_persistence=i.disable_cookie);var t=De({},e,i);return he(i.property_blacklist)&&(F(i.property_denylist)?t.property_denylist=i.property_blacklist:he(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:_.error("Invalid value for property_denylist config: "+i.property_denylist)),t},nl=class{constructor(){$(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){_.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},xs=class i{constructor(){$(this,"webPerformance",new nl),$(this,"version",Mt.LIB_VERSION),$(this,"_internalEventEmitter",new _s),this.config=md(),this.decideEndpointWasHit=!1,this.SentryIntegration=Na,this.sentryIntegration=e=>function(t,r){var n=op(t,r);return{name:sp,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new ha(this),this.toolbar=new Oa(this),this.scrollManager=new Xa(this),this.pageViewManager=new Ua(this),this.surveys=new Wa(this),this.experiments=new tl(this),this.exceptions=new il(this),this.rateLimiter=new Va(this),this.requestRouter=new La(this),this.consent=new Za(this),this.people={set:(e,t,r)=>{var n=Pe(e)?{[e]:t}:e;this.setPersonProperties(n),r?.({})},set_once:(e,t,r)=>{var n=Pe(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",e=>_.info('send "'.concat(e?.event,'"'),e))}init(e,t,r){if(r&&r!==Ui){var n,s=(n=jr[r])!==null&&n!==void 0?n:new i;return s._init(e,t,r),jr[r]=s,jr[Ui][r]=s,s}return this._init(e,t,r)}_init(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(F(e)||Ac(e))return _.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 _.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],n.person_profiles&&(this._initialPersonProfilesConfig=n.person_profiles),this.set_config(De({},md(),_d(n),{name:s,token:e})),this.config.on_xhr_error&&_.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:at.GZipJS,this.persistence=new Lr(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Lr(S(S({},this.config),{},{persistence:"sessionStorage"}));var o=S({},this.persistence.props),l=S({},this.sessionPersistence.props);if(this._requestQueue=new Fa(w=>this._send_retriable_request(w)),this._retryQueue=new Da(this),this.__request_queue=[],this.sessionManager=new Ma(this.config,this.persistence),this.sessionPropsManager=new Ga(this.sessionManager,this.persistence),new Ka(this).startIfEnabledOrStop(),this.sessionRecording=new Pa(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Ya(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Ja(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new el(this),this.exceptionObserver=new Qa(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new ws(this,ug),this.deadClicksAutocapture.startIfEnabled(),Mt.DEBUG=Mt.DEBUG||this.config.debug,Mt.DEBUG&&_.info("Starting in debug mode",{this:this,config:n,thisC:S({},this.config),p:o,s:l}),this._sync_opt_out_with_persistence(),((t=n.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,c,d=this.config.get_device_id(Ut()),u=(a=n.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(wt,(c=n.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:u})}if(this._hasBootstrappedFeatureFlags()){var p,h,g=Object.keys(((p=n.bootstrap)===null||p===void 0?void 0:p.featureFlags)||{}).filter(w=>{var b,O;return!((b=n.bootstrap)===null||b===void 0||(O=b.featureFlags)===null||O===void 0||!O[w])}).reduce((w,b)=>{var O,D;return w[b]=((O=n.bootstrap)===null||O===void 0||(D=O.featureFlags)===null||D===void 0?void 0:D[b])||!1,w},{}),m=Object.keys(((h=n.bootstrap)===null||h===void 0?void 0:h.featureFlagPayloads)||{}).filter(w=>g[w]).reduce((w,b)=>{var O,D,z,X;return(O=n.bootstrap)!==null&&O!==void 0&&(D=O.featureFlagPayloads)!==null&&D!==void 0&&D[b]&&(w[b]=(z=n.bootstrap)===null||z===void 0||(X=z.featureFlagPayloads)===null||X===void 0?void 0:X[b]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:m})}if(!this.get_distinct_id()){var k=this.config.get_device_id(Ut());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(wt,"anonymous")}return v==null||(r=v.addEventListener)===null||r===void 0||r.call(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),n.segment?Zf(this,()=>this._loaded()):this._loaded(),Ze(this.config._onCapture)&&this.config._onCapture!==rl&&(_.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",w=>this.config._onCapture(w.event,w))),this}_afterDecideResponse(e){var t,r,n,s,o,l,a,c,d;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=H(e.supportedCompression,at.GZipJS)?at.GZipJS:H(e.supportedCompression,at.Base64)?at.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),(r=this.sessionRecording)===null||r===void 0||r.afterDecideResponse(e),(n=this.autocapture)===null||n===void 0||n.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.experiments)===null||o===void 0||o.afterDecideResponse(e),(l=this.surveys)===null||l===void 0||l.afterDecideResponse(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.afterDecideResponse(e),(c=this.exceptionObserver)===null||c===void 0||c.afterDecideResponse(e),(d=this.deadClicksAutocapture)===null||d===void 0||d.afterDecideResponse(e)}_loaded(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(t){_.critical("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),e||(new Ra(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Hi(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(t=this._retryQueue)===null||t===void 0||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(_p?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=vs(e.url,{ip:this.config.ip?1:0}),e.headers=S({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(t=>{var r,n,s,o=S({},t);o.timeout=o.timeout||6e4,o.url=vs(o.url,{_:new Date().getTime().toString(),ver:Mt.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"XHR",a=(n=(s=wd(Ur,c=>c.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:Ur[0].method;if(!a)throw new Error("No available transport method");a(o)})(S(S({},e),{},{callback:t=>{var r,n,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(s=this.config).on_request_error)===null||n===void 0||n.call(s,t)),(r=e.callback)===null||r===void 0||r.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],n=[],s=[];Hi(e,l=>{l&&(t=l[0],he(t)?s.push(l):Ze(l)?l.call(this):he(l)&&t==="alias"?r.push(l):he(l)&&t.indexOf("capture")!==-1&&Ze(this[t])?s.push(l):n.push(l))});var o=function(l,a){Hi(l,function(c){if(he(c[0])){var d=a;K(c,function(u){d=d[u[0]].apply(d,u.slice(1))})}else this[c[0]].apply(this,c.slice(1))},a)};o(r,this),o(n,this),o(s,this)}_hasBootstrappedFeatureFlags(){var e,t;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!F(e)&&Pe(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=r?.timestamp||o,a={uuid:Ut(),event:e,properties:this._calculate_event_properties(e,t||{},l)};s&&(a.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(a.$set=r?.$set);var c=this._calculate_set_once_properties(r?.$set_once);c&&(a.$set_once=c),(a=Qh(a,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,F(r?.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=o);var d=S(S({},a.properties.$set),a.$set);if(ji(d)||this.setPersonPropertiesForFlags(d),!ee(this.config.before_send)){var u=this._runBeforeSend(a);if(!u)return;a=u}this._internalEventEmitter.emit("eventCaptured",a);var p={method:"POST",url:(n=r?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(p):this._requestQueue.enqueue(p),a}_.critical("This capture call is ignored due to client rate limiting.")}}else _.error("No event name provided to posthog.capture")}else _.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,r){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),s=S({},t);if(s.token=this.config.token,e==="$snapshot"){var o=S(S({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Pe(s.distinct_id)&&!Ge(s.distinct_id)||Ac(s.distinct_id))&&_.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l=ue.properties();if(this.sessionManager){var{sessionId:a,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=a,s.$window_id=c}if(this.requestRouter.region===hi.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var d=this.sessionPropsManager.getSessionProps();s=De(s,d)}if(!this.config.disable_scroll_properties){var u={};e==="$pageview"?u=this.pageViewManager.doPageView(r):e==="$pageleave"&&(u=this.pageViewManager.doPageLeave(r)),s=De(s,u)}if(e==="$pageview"&&T&&(s.title=T.title),!F(n)){var p=r.getTime()-n;s.$duration=parseFloat((p/1e3).toFixed(3))}ke&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=De({},l,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),he(this.config.property_denylist)?K(this.config.property_denylist,function(m){delete s[m]}):_.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;h&&(s=h(s,e));var g=this._hasPersonProcessing();return s.$process_person_profile=g,g&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=De({},this.persistence.get_initial_props(),e||{}),r=this.config.sanitize_properties;return r&&(t=r(t,"$set_once")),ji(t)?void 0:t}register(e,t){var r;(r=this.persistence)===null||r===void 0||r.register(e,t)}register_once(e,t,r){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,t,r)}register_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}unregister(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}_register_single(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){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,r;return(t=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,r){return this.surveys.getNextSurveyStep(e,t,r)}identify(e,t,r){if(!this.__loaded||!this.persistence)return _.uninitializedWarning("posthog.identify");if(Ge(e)&&(e=e.toString(),_.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()))_.critical('The string "'.concat(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(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(Rr)&&(this.unregister(Rr),this.register({distinct_id:e}));var o=(this.persistence.get_property(wt)||"anonymous")==="anonymous";e!==n&&o?(this.persistence.set_property(wt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:r||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||r)&&this.setPersonProperties(t,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(as))}}else _.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,r){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:S(S({},n),{},{[e]:t})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),n[e]===t||r||this.reloadFeatureFlags()}}else _.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,n,s,o;if(_.info("reset"),!this.__loaded)return _.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(r=this.sessionPersistence)===null||r===void 0||r.clear(),(n=this.surveys)===null||n===void 0||n.reset(),(s=this.persistence)===null||s===void 0||s.set_property(wt,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId();var a=this.config.get_device_id(Ut());this.register_once({distinct_id:a,$device_id:e?a:l},"")}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||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(e!=null&&e.withTimestamp&&r){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return n;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0);n+="?t=".concat(l)}return n}alias(e,t){return e===this.get_property(Sd)?(_.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Rr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(_.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,r,n,s,o=S({},this.config);fe(e)&&(De(this.config,_d(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Lr(S(S({},this.config),{},{persistence:"sessionStorage"})),me.is_supported()&&me.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Mt.DEBUG=!0,_.info("set_config",{config:e,oldConfig:o,newConfig:S({},this.config)})),(r=this.sessionRecording)===null||r===void 0||r.startIfEnabledOrStop(),(n=this.autocapture)===null||n===void 0||n.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=e===!0,r={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(r).some(Boolean)){var n,s,o,l,a;(n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((a=this.sessionRecording)===null||a===void 0||a.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===void 0||!e.started)}captureException(e,t){var r,n=new Error("PostHog syntheticException"),s=Ze((r=q.__PosthogExtensions__)===null||r===void 0?void 0:r.parseErrorAsProperties)?q.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):S({$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},t);this.exceptions.sendExceptionEvent(s)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Ui;return t!==Ui&&(t=Ui+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(wt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(wt))==="identified"}_hasPersonProcessing(){var e,t,r,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ji(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[Rr])&&((r=this.persistence)===null||r===void 0||(n=r.props)===null||n===void 0||!n[ls]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return this.config.person_profiles==="never"?(_.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(ls,!0),!0)}_sync_opt_out_with_persistence(){var e,t,r,n,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,l=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==l&&((r=this.persistence)===null||r===void 0||r.set_disabled(l)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==l&&((n=this.sessionPersistence)===null||n===void 0||n.set_disabled(l))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Je?mp(Je,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){T&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:T.title},{send_instantly:!0}))}debug(e){e===!1?(v?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(v?.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(e){if(ee(this.config.before_send))return e;var t=he(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),ee(r)){var s="Event '".concat(e.event,"' was rejected in beforeSend function");return sf(e.event)?_.warn("".concat(s,". This can cause unexpected behavior.")):_.info(s),null}r.properties&&!ji(r.properties)||_.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return r}};(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=Zh(i.prototype[e[t]])})(xs,["identify"]);var yd,yp=(yd=jr[Ui]=new xs,function(){function i(){i.done||(i.done=!0,_p=!1,K(jr,function(e){e._dom_loaded()}))}T!=null&&T.addEventListener&&(T.readyState==="complete"?i():T.addEventListener("DOMContentLoaded",i,!1)),v&&St(v,"load",i,!0)}(),yd);var bp=yp.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,advanced_disable_decide:!0},"MolinShopAI");function Le(i,e){if(!bp)throw new Error("Failed to initialize PostHog");bp.capture(i,e)}var As,Jr,Is,zt,xp,$s,Vr=class Vr extends G(B){constructor(){super();y(this,zt);y(this,As,new Ft(this,{onError:console.error}));y(this,Jr);y(this,Is,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Le("ShopAssistant: error",t),pe("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Le("ShopAssistant: user received bot message (streaming started)",t),pe("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Le("ShopAssistant: user received bot message (streaming ended)",t),pe("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Le("ShopAssistant: user canceled streaming",t),pe("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Le("ShopAssistant: user clicked link",t),pe("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Le("ShopAssistant: user sent input",t),pe("ShopAssistant: user sent input",t)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData="",this.xPromptExt=""}get config(){return f(this,Jr)||f(this,As).data}render(){return this.config?L`
400
400
  <!-- embed our chat component forwarding props -->
401
401
  <mw-chat
402
402
  .config="${{...this.config,widgetId:this.widgetId}}"
403
- .callbacks="${f(this,ws)}"
403
+ .callbacks="${f(this,Is)}"
404
404
  x-user-data="${this.xUserData}"
405
405
  x-prompt-ext="${this.xPromptExt}"
406
406
  ?show-close="${this.showClose}"
407
- @mw:close-click="${$(this,jt,ad)}">
407
+ @mw:close-click="${A(this,zt,xp)}">
408
408
  <slot name="banner" slot="banner"></slot>
409
409
  </mw-chat>
410
- `:U}injectConfig(t){R(this,Hr,t),this.requestUpdate()}reloadConfig(){f(this,jt,ys)?.reloadConfig()}get conversationId(){return f(this,jt,ys)?.conversationId??""}get messages(){return f(this,jt,ys)?.messages??[]}};bs=new WeakMap,Hr=new WeakMap,ws=new WeakMap,jt=new WeakSet,ad=function(){this.dispatchEvent(new jr.CloseClickEvent)},ys=function(){return this.renderRoot.querySelector("mw-chat")},T(jr,"styles",pt`
410
+ `:U}injectConfig(t){C(this,Jr,t),this.requestUpdate()}reloadConfig(){f(this,zt,$s)?.reloadConfig()}get conversationId(){return f(this,zt,$s)?.conversationId??""}get messages(){return f(this,zt,$s)?.messages??[]}};As=new WeakMap,Jr=new WeakMap,Is=new WeakMap,zt=new WeakSet,xp=function(){this.dispatchEvent(new Vr.CloseClickEvent)},$s=function(){return this.renderRoot.querySelector("mw-chat")},P(Vr,"styles",ht`
411
411
  :host {
412
412
  all: initial; /* reset all properties that can pierce the shadow DOM */
413
413
  }
414
- `),T(jr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var Br=jr;customElements.define("molin-shop-ai-chat",Br);var ol;Br.CloseClickEvent=(ol=class extends CustomEvent{constructor(e={}){super(Br.CloseClickEvent.type,{...e})}},T(ol,"type","mw:close-click"),ol);var ld=i=>i??U;var xs,zr=class extends G(B){constructor(){super();b(this,xs,new Pt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return f(this,xs).data}render(){return this.config?L`
414
+ `),P(Vr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"}});var Gr=Vr;customElements.define("molin-shop-ai-chat",Gr);var gl;Gr.CloseClickEvent=(gl=class extends CustomEvent{constructor(e={}){super(Gr.CloseClickEvent.type,{...e})}},P(gl,"type","mw:close-click"),gl);var kp=i=>i??U;var Ts,Xr=class extends G(B){constructor(){super();y(this,Ts,new Ft(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return f(this,Ts).data}render(){return this.config?L`
415
415
  <!-- embed our bubble component forwarding props -->
416
416
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
417
- <mw-bubble state="${this.state}" src="${ld(this.config?.bubble?.imageUrl)}"></mw-bubble>
418
- `:U}};xs=new WeakMap,T(zr,"styles",pt`
417
+ <mw-bubble state="${this.state}" src="${kp(this.config?.bubble?.imageUrl)}"></mw-bubble>
418
+ `:U}};Ts=new WeakMap,P(Xr,"styles",ht`
419
419
  :host {
420
420
  all: initial; /* reset all properties that can pierce the shadow DOM */
421
421
  }
422
- `),T(zr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",zr);var Ss,Gi,Xi,di,Wr,Vr,ks=class{constructor(e,t,r,n=window.history){b(this,Ss);b(this,Gi);b(this,Xi);b(this,di);b(this,Wr,!1);b(this,Vr,()=>{f(this,Gi).test(window.location.pathname)&&f(this,Xi).navigated()});R(this,Ss,e),R(this,Gi,t),R(this,Xi,r),R(this,di,n),e.addController(this)}hostConnected(){window.addEventListener("pageshow",f(this,Vr));let e=f(this,di).pushState;f(this,di).pushState=(...t)=>{if(e.call(f(this,di),...t),!f(this,Wr))try{let r=new URL(t[2],window.location.origin);f(this,Gi).test(r.pathname)&&f(this,Xi).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",f(this,Vr)),R(this,Wr,!0)}};Ss=new WeakMap,Gi=new WeakMap,Xi=new WeakMap,di=new WeakMap,Wr=new WeakMap,Vr=new WeakMap;function ud({min:i,max:e}){return Math.floor(Math.random()*(e-i+1))+i*1e3}var Bt,ct,ll,Gr,al=class{constructor(e=window.localStorage){b(this,ct);b(this,Bt);R(this,Bt,e)}setex(e,t,r){return f(this,Bt).setItem(e,$(this,ct,Gr).call(this,{value:$(this,ct,Gr).call(this,t),expiresAt:Date.now()+r*1e3})||"")}set(e,t){return f(this,Bt).setItem(e,$(this,ct,Gr).call(this,{value:$(this,ct,Gr).call(this,t)})||"")}get(e){let t=f(this,Bt).getItem(e);if(!t)return;let r=$(this,ct,ll).call(this,t);if(r){if(r.expiresAt&&r.expiresAt<Date.now()){f(this,Bt).removeItem(e);return}return $(this,ct,ll).call(this,r.value)}}};Bt=new WeakMap,ct=new WeakSet,ll=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Gr=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var ul=new al;function cl(i,e=""){return Object.entries(i).filter(([t,r])=>r).map(([t,r])=>`${e}${t}-[${r}]`).join(" ")}function cd(i,e={}){return[cl(i),cl(e,"max-sm:")].join(" ")}function pd(i){return cl(i)}function pl(i){return Object.entries(i).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let r=`sm:${e}-[${t}]`;return e==="left"&&(r+=" sm:right-auto"),e==="right"&&(r+=" sm:left-auto"),r}).join(" ")}function dd(i){let e=pl(i),r=`sm:bottom-[${i.bottom?`calc(${i.bottom}+72px)`:"72px"}]`;return[e,r].filter(Boolean).join(" ")}var hd="molin-shop-ai-widget-open",Es,Yr,dl,Te,Cs,se,fd,Jr,gd,vd,md,_d,Ji,Xr=class extends G(B){constructor(){super();b(this,se);b(this,Es,new Pt(this,{onError:console.error}));b(this,Yr);b(this,dl,new ks(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=f(this,se,gd);t&&Me("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,Te,!1);b(this,Cs,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Me("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>Me("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>Me("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>Me("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>Me("ShopAssistant: user clicked link",t),onUserSentInput:t=>Me("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData="",this.xPromptExt="",this._dialogAlreadyShown=!1}get config(){return f(this,Yr)||f(this,Es).data}render(){if(!this.config)return U;let t=cd(this.config.bubble.position,this.config.bubble.mobilePosition),r=pd(this.config.bubble.position),n=pl(this.config.bubble.position),s=dd(this.config.bubble.position);return this.config.hidden?U:L`
422
+ `),P(Xr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Xr);var Ps,Ki,Zi,gi,Kr,Zr,Yr=class{constructor(e,t,r,n=window.history){y(this,Ps);y(this,Ki);y(this,Zi);y(this,gi);y(this,Kr,!1);y(this,Zr,()=>{f(this,Ki).test(window.location.pathname)&&f(this,Zi).navigated()});C(this,Ps,e),C(this,Ki,t),C(this,Zi,r),C(this,gi,n),e.addController(this)}hostConnected(){window.addEventListener("pageshow",f(this,Zr));let e=f(this,gi).pushState;f(this,gi).pushState=(...t)=>{if(e.call(f(this,gi),...t),!f(this,Kr))try{let r=new URL(t[2],window.location.origin);f(this,Ki).test(r.pathname)&&f(this,Zi).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",f(this,Zr)),C(this,Kr,!0)}};Ps=new WeakMap,Ki=new WeakMap,Zi=new WeakMap,gi=new WeakMap,Kr=new WeakMap,Zr=new WeakMap;function Sp({min:i,max:e}){return Math.floor(Math.random()*(e-i+1))+i*1e3}var Wt,pt,ml,Qr,vl=class{constructor(e=window.localStorage){y(this,pt);y(this,Wt);C(this,Wt,e)}setex(e,t,r){return f(this,Wt).setItem(e,A(this,pt,Qr).call(this,{value:A(this,pt,Qr).call(this,t),expiresAt:Date.now()+r*1e3})||"")}set(e,t){return f(this,Wt).setItem(e,A(this,pt,Qr).call(this,{value:A(this,pt,Qr).call(this,t)})||"")}get(e){let t=f(this,Wt).getItem(e);if(!t)return;let r=A(this,pt,ml).call(this,t);if(r){if(r.expiresAt&&r.expiresAt<Date.now()){f(this,Wt).removeItem(e);return}return A(this,pt,ml).call(this,r.value)}}};Wt=new WeakMap,pt=new WeakSet,ml=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Qr=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var _l=new vl;function yl(i,e=""){return Object.entries(i).filter(([t,r])=>r).map(([t,r])=>`${e}${t}-[${r}]`).join(" ")}function Ep(i,e={}){return[yl(i),yl(e,"max-sm:")].join(" ")}function Cp(i){return yl(i)}function bl(i){return Object.entries(i).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let r=`sm:${e}-[${t}]`;return e==="left"&&(r+=" sm:right-auto"),e==="right"&&(r+=" sm:left-auto"),r}).join(" ")}function $p(i){let e=bl(i),r=`sm:bottom-[${i.bottom?`calc(${i.bottom}+72px)`:"72px"}]`;return[e,r].filter(Boolean).join(" ")}var Ap="molin-shop-ai-widget-open",Rs,rn,xl,kl,ce,Os,ne,Ip,tn,wl,Tp,Pp,Rp,Qi,en=class extends G(B){constructor(){super();y(this,ne);y(this,Rs,new Ft(this,{onError:console.error}));y(this,rn);y(this,xl,new Yr(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=f(this,ne,wl);t&&Le("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));y(this,kl,new Yr(this,/.*/i,{navigated:()=>{let t=f(this,ne,wl);pe("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:t?.conversationId||"",url:document.location.href,title:document.title})}}));y(this,ce,!1);y(this,Os,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Le("ShopAssistant: error",t),pe("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Le("ShopAssistant: user received bot message (streaming started)",t),pe("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Le("ShopAssistant: user received bot message (streaming ended)",t),pe("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Le("ShopAssistant: user canceled streaming",t),pe("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Le("ShopAssistant: user clicked link",t),pe("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Le("ShopAssistant: user sent input",t),pe("ShopAssistant: user sent input",t)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData="",this.xPromptExt="",this._dialogAlreadyShown=!1}get config(){return f(this,rn)||f(this,Rs).data}render(){if(!this.config)return U;let t=Ep(this.config.bubble.position,this.config.bubble.mobilePosition),r=Cp(this.config.bubble.position),n=bl(this.config.bubble.position),s=$p(this.config.bubble.position);return this.config.hidden?U:L`
423
423
  <mw-bubble
424
- class="${t} ${f(this,Te)?"opacity-0":"opacity-100"} fixed z-[${f(this,se,fd)}] transition-opacity"
425
- @click="${$(this,se,md)}"
426
- state="${f(this,Te)?"close":"open"}"
424
+ class="${t} ${f(this,ce)?"opacity-0":"opacity-100"} fixed z-[${f(this,ne,Ip)}] transition-opacity"
425
+ @click="${A(this,ne,Pp)}"
426
+ state="${f(this,ce)?"close":"open"}"
427
427
  src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
428
428
 
429
429
  <!-- only load the component if enabled on any platform -->
430
430
  ${this.isPopupEnabled?L`
431
431
  <mw-popup
432
432
  position="${s}"
433
- delay="${this.config.popup?.delayMs||ud({min:2,max:5})}"
433
+ delay="${this.config.popup?.delayMs||Sp({min:2,max:5})}"
434
434
  sound="https://molin.ai/sounds/widget/popup.aac"
435
435
  .content="${{desktop:{text:this.config.popup?.text||"Hello there. How can we help?"},mobile:{title:this.config.popup?.mobileTitleText||`Chat with ${this.config.title}`,text:this.config.popup?.text||"Hello there. How can we help?",button:this.config.popup?.mobileButtonText||`Chat with ${this.config.title}`,color:this.config.color,poweredBy:!this.config.removePoweredBy}}}"
436
- @mw:click="${$(this,se,vd)}"></mw-popup>
436
+ @mw:click="${A(this,ne,Tp)}"></mw-popup>
437
437
  `:U}
438
438
 
439
439
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
@@ -445,23 +445,23 @@ var kd=Object.defineProperty;var ml=i=>{throw TypeError(i)};var Sd=(i,e,t)=>e in
445
445
  <!-- On first render, do not render the dialog, so it does not connect to backend. Once it's rendered once, it's never removed from the DOM. -->
446
446
  ${this._dialogAlreadyShown?L`
447
447
  <div
448
- class="${f(this,Te)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${n} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:bottom-[1.5rem] sm:top-auto sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-[36px] 2xl:max-w-[420px]">
448
+ class="${f(this,ce)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${n} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:bottom-[1.5rem] sm:top-auto sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-[36px] 2xl:max-w-[420px]">
449
449
  <mw-chat
450
450
  .config="${{...this.config,widgetId:this.widgetId}}"
451
- .callbacks="${f(this,Cs)}"
451
+ .callbacks="${f(this,Os)}"
452
452
  ?show-close="${!0}"
453
453
  x-user-data="${this.xUserData}"
454
454
  x-prompt-ext="${this.xPromptExt}"
455
- @mw:close-click="${$(this,se,_d)}">
455
+ @mw:close-click="${A(this,ne,Rp)}">
456
456
  <slot name="banner" slot="banner"></slot>
457
457
  </mw-chat>
458
458
  </div>
459
459
  `:U}
460
- `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,Te)&&f(this,se,Jr)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&ul.get(hd)?.isOpen&&this.openChat()}openChat(){f(this,Te)||(R(this,Te,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,se,Ji).call(this,!0),f(this,se,Jr)?.hide())}closeChat(){f(this,Te)&&(R(this,Te,!1),this.requestUpdate(),$(this,se,Ji).call(this,!1),f(this,se,Jr)?.hide())}injectConfig(t){R(this,Yr,t),this.requestUpdate()}};Es=new WeakMap,Yr=new WeakMap,dl=new WeakMap,Te=new WeakMap,Cs=new WeakMap,se=new WeakSet,fd=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},Jr=function(){return this.renderRoot.querySelector("mw-popup")},gd=function(){return this.renderRoot.querySelector("mw-chat")},vd=function(){R(this,Te,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,se,Ji).call(this,!0)},md=function(){R(this,Te,!f(this,Te)),this._dialogAlreadyShown=!0,this.requestUpdate(),$(this,se,Ji).call(this,f(this,Te)),f(this,se,Jr)?.hide()},_d=function(){R(this,Te,!1),this.requestUpdate(),$(this,se,Ji).call(this,!1)},Ji=function(t){ul.set(hd,{isOpen:t})},T(Xr,"styles",pt`
460
+ `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,ce)&&f(this,ne,tn)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&_l.get(Ap)?.isOpen&&this.openChat()}openChat(){f(this,ce)||(C(this,ce,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),A(this,ne,Qi).call(this,!0),f(this,ne,tn)?.hide(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ce)?"open":"close"}))}closeChat(){f(this,ce)&&(C(this,ce,!1),this.requestUpdate(),A(this,ne,Qi).call(this,!1),f(this,ne,tn)?.hide(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ce)?"open":"close"}))}injectConfig(t){C(this,rn,t),this.requestUpdate()}};Rs=new WeakMap,rn=new WeakMap,xl=new WeakMap,kl=new WeakMap,ce=new WeakMap,Os=new WeakMap,ne=new WeakSet,Ip=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},tn=function(){return this.renderRoot.querySelector("mw-popup")},wl=function(){return this.renderRoot.querySelector("mw-chat")},Tp=function(){C(this,ce,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),A(this,ne,Qi).call(this,!0),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:f(this,ce)?"open":"close"})},Pp=function(){C(this,ce,!f(this,ce)),this._dialogAlreadyShown=!0,this.requestUpdate(),A(this,ne,Qi).call(this,f(this,ce)),f(this,ne,tn)?.hide(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:f(this,ce)?"open":"close"})},Rp=function(){C(this,ce,!1),this.requestUpdate(),A(this,ne,Qi).call(this,!1),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:f(this,ce)?"open":"close"})},Qi=function(t){_l.set(Ap,{isOpen:t})},P(en,"styles",ht`
461
461
  :host {
462
462
  all: initial; /* reset all properties that can pierce the shadow DOM */
463
463
  }
464
- `),T(Xr,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",Xr);
464
+ `),P(en,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:String,attribute:"x-user-data"},xPromptExt:{type:String,attribute:"x-prompt-ext"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",en);
465
465
  /*! Bundled license information:
466
466
 
467
467
  @lit/reactive-element/css-tag.js: