@molin.ai/shop-ai 0.7.22 → 0.7.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/molin-shop-ai.min.js +245 -229
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
1
|
+
var zf=Object.defineProperty;var Ju=r=>{throw TypeError(r)};var Vf=(r,e,t)=>e in r?zf(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var T=(r,e,t)=>Vf(r,typeof e!="symbol"?e+"":e,t),qo=(r,e,t)=>e.has(r)||Ju("Cannot "+t);var f=(r,e,t)=>(qo(r,e,"read from private field"),t?t.call(r):e.get(r)),b=(r,e,t)=>e.has(r)?Ju("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),A=(r,e,t,i)=>(qo(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),C=(r,e,t)=>(qo(r,e,"access private method"),t);var Xu=(r,e,t,i)=>({set _(n){A(r,e,n,t)},get _(){return f(r,e,i)}});var Rn=globalThis,On=Rn.ShadowRoot&&(Rn.ShadyCSS===void 0||Rn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bo=Symbol(),Zu=new WeakMap,mi=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Bo)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(On&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=Zu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Zu.set(t,e))}return e}toString(){return this.cssText}},Ku=r=>new mi(typeof r=="string"?r:r+"",void 0,Bo),tt=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((i,n,s)=>i+(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)+r[s+1],r[0]);return new mi(t,r,Bo)},Ho=(r,e)=>{if(On)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),n=Rn.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,r.appendChild(i)}},Mn=On?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return Ku(t)})(r):r;var{is:Wf,defineProperty:Gf,getOwnPropertyDescriptor:Jf,getOwnPropertyNames:Xf,getOwnPropertySymbols:Zf,getPrototypeOf:Kf}=Object,Fn=globalThis,Yu=Fn.trustedTypes,Yf=Yu?Yu.emptyScript:"",Qf=Fn.reactiveElementPolyfillSupport,vi=(r,e)=>r,zo={toAttribute(r,e){switch(e){case Boolean:r=r?Yf:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},ec=(r,e)=>!Wf(r,e),Qu={attribute:!0,type:String,converter:zo,reflect:!1,hasChanged:ec};Symbol.metadata??=Symbol("metadata"),Fn.litPropertyMetadata??=new WeakMap;var gt=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=Qu){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&Gf(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){let{get:n,set:s}=Jf(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,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Qu}static _$Ei(){if(this.hasOwnProperty(vi("elementProperties")))return;let e=Kf(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(vi("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(vi("properties"))){let t=this.properties,i=[...Xf(t),...Zf(t)];for(let n of i)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)t.unshift(Mn(n))}else e!==void 0&&t.push(Mn(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ho(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,i){this._$AK(e,i)}_$EC(e,t){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:zo).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:zo;this._$Em=n,this[n]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??ec)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.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 i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i)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(i=>i.hostUpdate?.()),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}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){}};gt.elementStyles=[],gt.shadowRootOptions={mode:"open"},gt[vi("elementProperties")]=new Map,gt[vi("finalized")]=new Map,Qf?.({ReactiveElement:gt}),(Fn.reactiveElementVersions??=[]).push("2.0.4");var Wo=globalThis,Ln=Wo.trustedTypes,tc=Ln?Ln.createPolicy("lit-html",{createHTML:r=>r}):void 0,Go="$lit$",mt=`lit$${Math.random().toFixed(9).slice(2)}$`,Jo="?"+mt,eg=`<${Jo}>`,Yt=document,_i=()=>Yt.createComment(""),bi=r=>r===null||typeof r!="object"&&typeof r!="function",Xo=Array.isArray,ac=r=>Xo(r)||typeof r?.[Symbol.iterator]=="function",Vo=`[
|
|
2
|
+
\f\r]`,yi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rc=/-->/g,ic=/>/g,Zt=RegExp(`>|${Vo}(?:([^\\s"'>=/]+)(${Vo}*=${Vo}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),nc=/'/g,sc=/"/g,lc=/^(?:script|style|textarea|title)$/i,Zo=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),E=Zo(1),gv=Zo(2),mv=Zo(3),rt=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),oc=new WeakMap,Kt=Yt.createTreeWalker(Yt,129);function uc(r,e){if(!Xo(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return tc!==void 0?tc.createHTML(e):e}var cc=(r,e)=>{let t=r.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=yi;for(let l=0;l<t;l++){let a=r[l],c,p,u=-1,d=0;for(;d<a.length&&(o.lastIndex=d,p=o.exec(a),p!==null);)d=o.lastIndex,o===yi?p[1]==="!--"?o=rc:p[1]!==void 0?o=ic:p[2]!==void 0?(lc.test(p[2])&&(n=RegExp("</"+p[2],"g")),o=Zt):p[3]!==void 0&&(o=Zt):o===Zt?p[0]===">"?(o=n??yi,u=-1):p[1]===void 0?u=-2:(u=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?Zt:p[3]==='"'?sc:nc):o===sc||o===nc?o=Zt:o===rc||o===ic?o=yi:(o=Zt,n=void 0);let h=o===Zt&&r[l+1].startsWith("/>")?" ":"";s+=o===yi?a+eg:u>=0?(i.push(c),a.slice(0,u)+Go+a.slice(u)+mt+h):a+mt+(u===-2?l:h)}return[uc(r,s+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},wi=class r{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let s=0,o=0,l=e.length-1,a=this.parts,[c,p]=cc(e,t);if(this.el=r.createElement(c,i),Kt.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=Kt.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(Go)){let d=p[o++],h=n.getAttribute(u).split(mt),g=/([.?@])?(.*)/.exec(d);a.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?jn:g[1]==="?"?Nn:g[1]==="@"?Un:er}),n.removeAttribute(u)}else u.startsWith(mt)&&(a.push({type:6,index:s}),n.removeAttribute(u));if(lc.test(n.tagName)){let u=n.textContent.split(mt),d=u.length-1;if(d>0){n.textContent=Ln?Ln.emptyScript:"";for(let h=0;h<d;h++)n.append(u[h],_i()),Kt.nextNode(),a.push({type:2,index:++s});n.append(u[d],_i())}}}else if(n.nodeType===8)if(n.data===Jo)a.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(mt,u+1))!==-1;)a.push({type:7,index:s}),u+=mt.length-1}s++}}static createElement(e,t){let i=Yt.createElement("template");return i.innerHTML=e,i}};function Qt(r,e,t=r,i){if(e===rt)return e;let n=i!==void 0?t._$Co?.[i]:t._$Cl,s=bi(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(r),n._$AT(r,t,i)),i!==void 0?(t._$Co??=[])[i]=n:t._$Cl=n),n!==void 0&&(e=Qt(r,n._$AS(r,e.values),n,i)),e}var Dn=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:i}=this._$AD,n=(e?.creationScope??Yt).importNode(t,!0);Kt.currentNode=n;let s=Kt.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new Sr(s,s.nextSibling,this,e):a.type===1?c=new a.ctor(s,a.name,a.strings,this,e):a.type===6&&(c=new qn(s,this,e)),this._$AV.push(c),a=i[++l]}o!==a?.index&&(s=Kt.nextNode(),o++)}return Kt.currentNode=Yt,n}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Sr=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,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=Qt(this,e,t),bi(e)?e===j||e==null||e===""?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==rt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ac(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!==j&&bi(this._$AH)?this._$AA.nextSibling.data=e:this.T(Yt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=wi.createElement(uc(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(t);else{let s=new Dn(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=oc.get(e.strings);return t===void 0&&oc.set(e.strings,t=new wi(e)),t}k(e){Xo(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,n=0;for(let s of e)n===t.length?t.push(i=new r(this.O(_i()),this.O(_i()),this,this.options)):i=t[n],i._$AI(s),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},er=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,s){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=j}_$AI(e,t=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Qt(this,e,t,0),o=!bi(e)||e!==this._$AH&&e!==rt,o&&(this._$AH=e);else{let l=e,a,c;for(e=s[0],a=0;a<s.length-1;a++)c=Qt(this,l[i+a],t,a),c===rt&&(c=this._$AH[a]),o||=!bi(c)||c!==this._$AH[a],c===j?e=j:e!==j&&(e+=(c??"")+s[a+1]),this._$AH[a]=c}o&&!n&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},jn=class extends er{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}},Nn=class extends er{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},Un=class extends er{constructor(e,t,i,n,s){super(e,t,i,n,s),this.type=5}_$AI(e,t=this){if((e=Qt(this,e,t,0)??j)===rt)return;let i=this._$AH,n=e===j&&i!==j||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==j&&(i===j||n);n&&this.element.removeEventListener(this.name,this,i),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)}},qn=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Qt(this,e)}},pc={M:Go,P:mt,A:Jo,C:1,L:cc,R:Dn,D:ac,V:Qt,I:Sr,H:er,N:Nn,U:Un,B:jn,F:qn},tg=Wo.litHtmlPolyfillSupport;tg?.(wi,Sr),(Wo.litHtmlVersions??=[]).push("3.2.1");var dc=(r,e,t)=>{let i=t?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=t?.renderBefore??null;i._$litPart$=n=new Sr(e.insertBefore(_i(),s),s,void 0,t??{})}return n._$AI(r),n};var H=class extends gt{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=dc(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return rt}};H._$litElement$=!0,H.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:H});var rg=globalThis.litElementPolyfillSupport;rg?.({LitElement:H});(globalThis.litElementVersions??=[]).push("4.1.1");var xi=class xi extends HTMLElement{constructor(){super();T(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(t,i,n){if(i!==n&&xi.observedAttributes.includes(t)){switch(t){case"name":this.name=n||"";break}this.render()}}resolveIcon(t){throw new Error("Not implemented")}render(){let t=document.createElement("style");for(t.textContent=`
|
|
4
4
|
:host {
|
|
5
5
|
display: inline-block;
|
|
6
6
|
line-height: 0;
|
|
7
7
|
}
|
|
8
|
-
`;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(t);if(!this.name)return;let
|
|
8
|
+
`;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(t);if(!this.name)return;let i=this.resolveIcon(this.name);if(!i){console.warn(`'${this.name}' not found, please add it to ${xi.name}`);return}let o=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;o.setAttribute("fill","currentColor"),o.style.width="100%",o.style.height="100%",this.shadowRoot?.appendChild(o)}};T(xi,"observedAttributes",["name"]);var Bn=xi;var hc={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
9
|
<path d="M12 6V12H16.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
10
|
</svg>`,"arrow-path":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
11
11
|
<path d="M16.0228 9.34841H21.0154V9.34663M2.98413 19.6444V14.6517M2.98413 14.6517L7.97677 14.6517M2.98413 14.6517L6.16502 17.8347C7.15555 18.8271 8.41261 19.58 9.86436 19.969C14.2654 21.1483 18.7892 18.5364 19.9685 14.1353M4.03073 9.86484C5.21 5.46374 9.73377 2.85194 14.1349 4.03121C15.5866 4.4202 16.8437 5.17312 17.8342 6.1655L21.0154 9.34663M21.0154 4.3558V9.34663" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -51,17 +51,17 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
51
51
|
<path d="M8.25 4.5L15.75 12L8.25 19.5" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
52
52
|
</svg>`,"arrow-down-right":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
53
53
|
<path d="M4.5 4.5L19.5 19.5M19.5 19.5V8.25M19.5 19.5H8.25" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
54
|
-
</svg>`};var sg=gc,Go=class extends jn{resolveIcon(e){return sg[e]}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found");e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(t=>{t.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",Go);function ra(i){return[...i.v,(i.i?"!":"")+i.n].join(":")}function og(i,e=","){return i.map(ra).join(e)}var xc=typeof CSS<"u"&&CSS.escape||(i=>i.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Nn(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 qn(i,e="@media "){return e+Q(i).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(r=>`(${r}-width:${t[r]})`).join(" and "))).join(",")}function Q(i=[]){return Array.isArray(i)?i:i==null?[]:[i]}function mc(i){return i}function Hn(){}var fe={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function kc(i){return i.match(/[-=:;]/g)?.length||0}function Ko(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(kc(i),15)<<18}var ag=["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 na({n:i,i:e,v:t=[]},r,n,s){i&&(i=ra({n:i,i:e,v:t})),s=[...Q(s)];for(let l of t){let a=r.theme("screens",l);for(let c of Q(a&&qn(a)||r.v(l))){var o;s.push(c),n|=a?67108864|Ko(c):l=="dark"?1073741824:c[0]=="@"?Ko(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~ag.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:i,p:n,r:s,i:e}}var Ec=new Map;function Qo(i){if(i.d){let e=[],t=Jo(i.r.reduce((r,n)=>n[0]=="@"?(e.push(n),r):n?Jo(r,s=>Jo(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):Xo(s,o)}return Xo(o,s)})):r,"&"),r=>Xo(r,i.n?"."+xc(i.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((r,n)=>n+"{"+r+"}",i.d)}}function Jo(i,e){return i.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,r,n)=>e(r)+n)}function Xo(i,e){return i.replace(/&/g,e)}var vc=new Intl.Collator("en",{numeric:!0});function Sc(i,e){for(var t=0,r=i.length;t<r;){let n=r+t>>1;0>=Cc(i[n],e)?t=n+1:r=n}return r}function Cc(i,e){let t=i.p&fe.o;return t==(e.p&fe.o)&&(t==fe.b||t==fe.o)?0:i.p-e.p||i.o-e.o||vc.compare(_c(i.n),_c(e.n))||vc.compare(yc(i.n),yc(e.n))}function _c(i){return(i||"").split(/:/).pop().split("/").pop()||"\0"}function yc(i){return(i||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Zo(i,e){return Math.round(parseInt(i,16)*e)}function We(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(${[Zo(i.substr(1,s),o),Zo(i.substr(1+s,s),o),Zo(i.substr(1+2*s,s),o),n]})`}return n=="1"?i:n=="0"?"#0000":i.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function $c(i,e,t,r,n=[]){return function s(o,{n:l,p:a,r:c=[],i:d},u){let p=[],h="",g=0,v=0;for(let _ in o||{}){var b,w;let k=o[_];if(_[0]=="@"){if(!k)continue;if(_[1]=="a"){p.push(...oa(l,a,Bn(""+k),u,a,c,d,!0));continue}if(_[1]=="l"){for(let S of Q(k))p.push(...s(S,{n:l,p:(b=fe[_[7]],a&~fe.o|b),r:_[7]=="d"?[]:c,i:d},u));continue}if(_[1]=="i"){p.push(...Q(k).map(S=>({p:-1,o:0,r:[],d:_+" "+S})));continue}if(_[1]=="k"){p.push({p:fe.d,o:0,r:[_],d:s(k,{p:fe.d},u).map(Qo).join("")});continue}if(_[1]=="f"){p.push(...Q(k).map(S=>({p:fe.d,o:0,r:[_],d:s(S,{p:fe.d},u).map(Qo).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))_=="label"&&k?l=k+Nn(JSON.stringify([a,d,o])):(k||k===0)&&(_=_.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),v+=1,g=Math.max(g,(w=_)[0]=="-"?0:kc(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?";":"")+Q(k).map(S=>u.s(_,sa(""+S,u.theme)+(d?" !important":""))).join(";"));else if(_[0]=="@"||_.includes("&")){let S=a;_[0]=="@"&&(_=_.replace(/\bscreen\(([^)]+)\)/g,(O,q)=>{let U=u.theme("screens",q);return U?(S|=67108864,qn(U,"")):O}),S|=Ko(_)),p.push(...s(k,{n:l,p:S,r:[...c,_],i:d},u))}else p.push(...s(k,{p:a,r:[...c,_]},u))}return p.unshift({n:l,p:a,o:Math.max(0,15-v)+1.5*Math.min(g||15,15),r:c,d:h}),p.sort(Cc)}(i,na(e,t,r,n),t)}function sa(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)?We(l):""+Q(l).filter(a=>Object(a)!==a)})}function Ic(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=fe.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,v){let b=Ec.get(g.n);return b?b(g,v):v.r(g.n,g.v[0]=="dark")}(a,c);return h?typeof h=="string"?({r:u,p:d}=na(a,c,d,u),Ic(Un(Bn(h),c,d,u,a.i),a.n)):Array.isArray(h)?h.map(g=>{var v,b;return{o:0,...g,r:[...Q(u),...Q(g.r)],p:(v=d,b=g.p??d,v&~fe.o|b)}}):$c(h,a,c,d,u):[{c:ra(a),p:0,o:0,r:[]}]}(o,e,t,r,n))s.splice(Sc(s,l),0,l);return s}function oa(i,e,t,r,n,s,o,l){return Ic((l?t.flatMap(a=>Un([a],r,n,s,o)):Un(t,r,n,s,o)).map(a=>a.p&fe.o&&(a.n||e==fe.b)?{...a,p:a.p&~fe.o|e,o:0}:a),i)}function lg(i,e,t,r){var n;return n=(s,o)=>{let{n:l,p:a,r:c,i:d}=na(s,o,e);return t&&oa(l,e,t,o,a,c,d,r)},Ec.set(i,n),i}function Yo(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(ug),i:n}))}}function ug(i,e,t){return t.indexOf(i)==e}var bc=new Map;function Bn(i){let e=bc.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&&Yo(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,Yo([...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);Yo([...t,lg(u.length>1?u.slice(0,-1)+Nn(JSON.stringify([u,p])):u+"("+og(p)+")",fe.a,p,/@$/.test(u))],r)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(c)&&i[l+1]=="("&&r.unshift([])}a(!0),bc.set(i,e=r[0])}return e}function C(i,e,t){return[i,ea(e,t)]}function ea(i,e){return typeof i=="function"?i:typeof i=="string"&&/^[\w-]+$/.test(i)?(t,r)=>({[i]:e?e(t,r):ta(t,1)}):t=>i||{[t[1]]:ta(t,2)}}function ta(i,e,t=i.slice(e).find(Boolean)||i.$$||i.input){return i.input[0]=="-"?`calc(${t} * -1)`:t}function $(i,e,t,r){return[i,aa(e,t,r)]}function aa(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=Ac(i||n[1]),l=s.theme(o,n.$$)??at(n.$$,o,s);if(l!=null)return n._=ta(n,0,l),r(n,s,o)}}function ge(i,e={},t){return[i,cg(e,t)]}function cg(i={},e){return(t,r)=>{let{section:n=Ac(t[0]).replace("-","")+"Color"}=i,[s,o]=dg(t.$$);if(!s)return;let l=r.theme(n,s)||at(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&&at(o,c,r),h=e||(({_:v})=>{let b=br(d,v);return u?{[u]:b}:b});t._={value:We(l,{opacityVariable:a||void 0,opacityValue:p||void 0}),color:v=>We(l,v),opacityVariable:a||void 0,opacityValue:p||void 0};let g=h(t,r);if(!t.dark){let v=r.d(n,s,l);v&&v!==l&&(t._={value:We(v,{opacityVariable:a||void 0,opacityValue:p||"1"}),color:b=>We(v,b),opacityVariable:a||void 0,opacityValue:p||void 0},g={"&":g,[r.v("dark")]:h(t,r)})}return g}}function dg(i){return(i.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function br(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 at(i,e,t){if(i[0]=="["&&i.slice(-1)=="]"){if(i=Ei(sa(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 Ac(i){return i.replace(/-./g,e=>e[1].toUpperCase())}function Ei(i){return i.includes("url(")?i.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",r,n="")=>Ei(t)+r+Ei(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 wr({presets:i=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Q(e.variants),rules:Q(e.rules),ignorelist:Q(e.ignorelist),hash:void 0,stringify:(r,n)=>r+":"+n,finalize:[]};for(let r of Q([...i,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Q(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,...Q(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Q(a)],rules:[...t.rules,...Q(c)],ignorelist:[...t.ignorelist,...Q(d)],hash:u,stringify:p,finalize:[...t.finalize,...Q(h)]}}return t}function wc(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 pg(i){var e;return ia(i[0],typeof(e=i[1])=="function"?e:()=>e)}function hg(i){var e,t;return Array.isArray(i)?ia(i[0],ea(i[1],i[2])):ia(i,ea(e,t))}function ia(i,e){return Tc(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 Tc(i,e){let t=Q(i).map(fg);return(r,n,s)=>{for(let o of t){let l=e(r,o,n,s);if(l)return l}}}function fg(i){return typeof i=="string"?RegExp("^"+i+(i.includes("$")||i.slice(-1)=="-"?"":"$")):i}function Pc(i,e){let t=wr(i),r=function({theme:a,darkMode:c,darkColor:d=Hn,variants:u,rules:p,hash:h,stringify:g,ignorelist:v,finalize:b}){let w=new Map,_=new Map,k=new Map,S=new Map,O=Tc(v,(R,B)=>B.test(R));u.push(["dark",Array.isArray(c)||c=="class"?`${Q(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let q=typeof h=="function"?R=>h(R,Nn):h?Nn:mc;q!==mc&&b.push(R=>({...R,n:R.n&&q(R.n),d:R.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(B,V)=>"--"+q(V).replace("#",""))}));let U={theme:function({extend:R={},...B}){let V={},we={get colors(){return ce("colors")},theme:ce,negative(){return{}},breakpoints(J){let Y={};for(let de in J)typeof J[de]=="string"&&(Y["screen-"+de]=J[de]);return Y}};return ce;function ce(J,Y,de,Le){if(J){if({1:J,2:Le}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(J)||[,J],/[.[]/.test(J)){let Ce=[];J.replace(/\[([^\]]+)\]|([^.[]+)/g,(re,_e,Ae=_e)=>Ce.push(Ae)),J=Ce.shift(),de=Y,Y=Ce.join("-")}let ae=V[J]||Object.assign(Object.assign(V[J]={},Fe(B,J)),Fe(R,J));if(Y==null)return ae;Y||(Y="DEFAULT");let Se=ae[Y]??Y.split("-").reduce((Ce,re)=>Ce?.[re],ae)??de;return Le?We(Se,{opacityValue:sa(Le,ce)}):Se}let Be={};for(let ae of[...Object.keys(B),...Object.keys(R)])Be[ae]=ce(ae);return Be}function Fe(J,Y){let de=J[Y];return typeof de=="function"&&(de=de(we)),de&&/color|fill|stroke/i.test(Y)?function Le(Be,ae=[]){let Se={};for(let Ce in Be){let re=Be[Ce],_e=[...ae,Ce];Se[_e.join("-")]=re,Ce=="DEFAULT"&&(_e=ae,Se[ae.join("-")]=re),typeof re=="object"&&Object.assign(Se,Le(re,_e))}return Se}(de):de}}(a),e:xc,h:q,s(R,B){return g(R,B,U)},d(R,B,V){return d(R,B,U,V)},v(R){return w.has(R)||w.set(R,wc(R,u,_,pg,U)||"&:"+R),w.get(R)},r(R,B){let V=JSON.stringify([R,B]);return k.has(V)||k.set(V,!O(R,U)&&wc(R,p,S,hg,U,B)),k.get(V)},f(R){return b.reduce((B,V)=>V(B,U),R)}};return U}(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=Qo(c);if(d&&!o.has(d)){o.add(d);let u=Sc(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 Q(t.preflight))typeof u=="function"&&(u=u(r)),u&&(typeof u=="string"?oa("",fe.b,Bn(u),r,fe.b,[],!1,!0):$c(u,{},r,fe.b)).forEach(l);c=""+c;let d=n.get(c);if(!d){let u=new Set;for(let p of Un(Bn(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 gg(i,e){return i!=e&&""+i.split(" ").sort()!=""+e.split(" ").sort()}function Rc(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&&gg(o,s=i(o))&&n.setAttribute("class",s)}}function mg(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 zn(i){let e=i?.cssRules?i:(i&&typeof i!="string"?i:mg(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:Hn}}var vg=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 Mc(i){return vg.get(i)}function Oc(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 Fc(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 _g=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Vn(){return({stringify:i})=>({stringify(e,t,r){let n="",s=Mc(e);s&&(n+=i(s,t,r)+";");let o=Oc(e),l=Fc(e,t);for(let a of _g)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 Wn(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",aa("lineClamp",({_:i})=>Lc(i))],["line-clamp-(\\d+)",({1:i})=>Lc(i)]]}}function Lc(i){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${i}`}}var kr={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",...qe(4,"rem",4,.5,.5),...qe(12,"rem",4,5),14:"3.5rem",...qe(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:W("blur"),backdropBrightness:W("brightness"),backdropContrast:W("contrast"),backdropGrayscale:W("grayscale"),backdropHueRotate:W("hueRotate"),backdropInvert:W("invert"),backdropOpacity:W("opacity"),backdropSaturate:W("saturate"),backdropSepia:W("sepia"),backgroundColor:W("colors"),backgroundImage:{none:"none"},backgroundOpacity:W("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:{...qe(200,"",100,0,50),...qe(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:i})=>({DEFAULT:i("colors.gray.200","currentColor"),...i("colors")}),borderOpacity:W("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:W("spacing"),borderWidth:{DEFAULT:"1px",...Ge(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:W("colors"),caretColor:W("colors"),accentColor:({theme:i})=>({auto:"auto",...i("colors")}),contrast:{...qe(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:W("borderColor"),divideOpacity:W("borderOpacity"),divideWidth:W("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"),...xr(2,6),...xr(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:W("spacing"),gradientColorStops:W("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"),...xr(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:i})=>({...i("spacing"),...xr(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:{...qe(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:{...qe(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:W("spacing"),placeholderColor:W("colors"),placeholderOpacity:W("opacity"),outlineColor:W("colors"),outlineOffset:Ge(8,"px"),outlineWidth:Ge(8,"px"),ringColor:({theme:i})=>({...i("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:W("colors"),ringOffsetWidth:Ge(8,"px"),ringOpacity:({theme:i})=>({...i("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ge(8,"px")},rotate:{...Ge(2,"deg"),...Ge(12,"deg",3),...Ge(180,"deg",45)},saturate:qe(200,"",100,0,50),scale:{...qe(150,"",100,0,50),...qe(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:W("spacing"),scrollPadding:W("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ge(2,"deg"),...Ge(12,"deg",3)},space:W("spacing"),stroke:({theme:i})=>({...i("colors"),none:"none"}),strokeWidth:qe(2),textColor:W("colors"),textDecorationColor:W("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ge(8,"px")},textUnderlineOffset:{auto:"auto",...Ge(8,"px")},textIndent:W("spacing"),textOpacity:W("opacity"),transitionDuration:({theme:i})=>({...i("durations"),DEFAULT:"150ms"}),transitionDelay:W("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"),...xr(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:{...qe(50,"",1,0,10),auto:"auto"}};function xr(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 Ge(i,e,t=0){let r={};for(;t<=i;t=2*t||1)r[t]=t+e;return r}function qe(i,e="",t=1,r=0,n=1,s={}){for(;r<=i;r+=n)s[r]=r/t+e;return s}function W(i){return({theme:e})=>e(i)}var Dc={"*,::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, ${kr.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, ${kr.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 Hc=[C("\\[([-\\w]+):(.+)]",({1:i,2:e},t)=>({"@layer overrides":{"&":{[i]:at(`[${e}]`,"",t)}}})),C("(group|peer)([~/][^-[]+)?",({input:i},{h:e})=>[{c:e(i)}]),$("aspect-","aspectRatio"),C("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[qn(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}}}),$("content-","content",({_:i})=>({"--tw-content":i,content:"var(--tw-content)"})),C("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),C("box-(border|content)","boxSizing",({1:i})=>i+"-box"),C("hidden",{display:"none"}),C("table-(auto|fixed)","tableLayout"),C(["(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)",C("isolate","isolation"),C("object-(contain|cover|fill|none|scale-down)","objectFit"),$("object-","objectPosition"),C("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Gn),C("overscroll(-[xy])?-(auto|contain|none)",({1:i="",2:e})=>({["overscroll-behavior"+i]:e})),C("(static|fixed|absolute|relative|sticky)","position"),$("-?inset(-[xy])?(?:$|-)","inset",({1:i,_:e})=>({top:i!="-x"&&e,right:i!="-y"&&e,bottom:i!="-x"&&e,left:i!="-y"&&e})),$("-?(top|bottom|left|right)(?:$|-)","inset"),C("(visible|collapse)","visibility"),C("invisible",{visibility:"hidden"}),$("-?z-","zIndex"),C("flex-((row|col)(-reverse)?)","flexDirection",jc),C("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),$("(flex-(?:grow|shrink))(?:$|-)"),$("(flex)-"),$("grow(?:$|-)","flexGrow"),$("shrink(?:$|-)","flexShrink"),$("basis-","flexBasis"),$("-?(order)-"),"-?(order)-(\\d+)",$("grid-cols-","gridTemplateColumns"),C("grid-cols-(\\d+)","gridTemplateColumns",qc),$("col-","gridColumn"),C("col-(span)-(\\d+)","gridColumn",Bc),$("col-start-","gridColumnStart"),C("col-start-(auto|\\d+)","gridColumnStart"),$("col-end-","gridColumnEnd"),C("col-end-(auto|\\d+)","gridColumnEnd"),$("grid-rows-","gridTemplateRows"),C("grid-rows-(\\d+)","gridTemplateRows",qc),$("row-","gridRow"),C("row-(span)-(\\d+)","gridRow",Bc),$("row-start-","gridRowStart"),C("row-start-(auto|\\d+)","gridRowStart"),$("row-end-","gridRowEnd"),C("row-end-(auto|\\d+)","gridRowEnd"),C("grid-flow-((row|col)(-dense)?)","gridAutoFlow",i=>Gn(jc(i))),C("grid-flow-(dense)","gridAutoFlow"),$("auto-cols-","gridAutoColumns"),$("auto-rows-","gridAutoRows"),$("gap-x(?:$|-)","gap","columnGap"),$("gap-y(?:$|-)","gap","rowGap"),$("gap(?:$|-)","gap"),"(justify-(?:items|self))-",C("justify-","justifyContent",Nc),C("(content|items|self)-",i=>({["align-"+i[1]]:Nc(i)})),C("(place-(content|items|self))-",({1:i,$$:e})=>({[i]:("wun".includes(e[3])?"space-":"")+e})),$("p([xytrbl])?(?:$|-)","padding",Si("padding")),$("-?m([xytrbl])?(?:$|-)","margin",Si("margin")),$("-?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))`}})),C("space-(x|y)-reverse",({1:i})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${i}-reverse`]:"1"}})),$("w-","width"),$("min-w-","minWidth"),$("max-w-","maxWidth"),$("h-","height"),$("min-h-","minHeight"),$("max-h-","maxHeight"),$("font-","fontWeight"),$("font-","fontFamily",({_:i})=>typeof(i=Q(i))[1]=="string"?{fontFamily:et(i)}:{fontFamily:et(i[0]),...i[1]}),C("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),C("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),C("italic","fontStyle"),C("not-italic",{fontStyle:"normal"}),C("(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)",...Tt({"--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,/*!*/ /*!*/)"})}),$("tracking-","letterSpacing"),$("leading-","lineHeight"),C("list-(inside|outside)","listStylePosition"),$("list-","listStyleType"),C("list-","listStyleType"),$("placeholder-opacity-","placeholderOpacity",({_:i})=>({"&::placeholder":{"--tw-placeholder-opacity":i}})),ge("placeholder-",{property:"color",selector:"&::placeholder"}),C("text-(left|center|right|justify|start|end)","textAlign"),C("text-(ellipsis|clip)","textOverflow"),$("text-opacity-","textOpacity","--tw-text-opacity"),ge("text-",{property:"color"}),$("text-","fontSize",({_:i})=>typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}),$("indent-","textIndent"),C("(overline|underline|line-through)","textDecorationLine"),C("no-underline",{textDecorationLine:"none"}),$("underline-offset-","textUnderlineOffset"),ge("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),$("decoration-","textDecorationThickness"),C("decoration-","textDecorationStyle"),C("(uppercase|lowercase|capitalize)","textTransform"),C("normal-case",{textTransform:"none"}),C("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),C("align-","verticalAlign"),C("whitespace-","whiteSpace"),C("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),C("break-words",{overflowWrap:"break-word"}),C("break-all",{wordBreak:"break-all"}),C("break-keep",{wordBreak:"keep-all"}),ge("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ge("accent-",{opacityVariable:!1,opacitySection:"opacity"}),C("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:i})=>`linear-gradient(to ${ei(i," ")},var(--tw-gradient-stops))`),ge("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)"})),ge("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)`})),ge("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),C("bg-(fixed|local|scroll)","backgroundAttachment"),C("bg-origin-(border|padding|content)","backgroundOrigin",({1:i})=>i+"-box"),C(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),C("bg-blend-","backgroundBlendMode"),C("bg-clip-(border|padding|content|text)","backgroundClip",({1:i})=>i+(i=="text"?"":"-box")),$("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ge("bg-",{section:"backgroundColor"}),$("bg-","backgroundImage"),$("bg-","backgroundPosition"),C("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Gn),$("bg-","backgroundSize"),$("rounded(?:$|-)","borderRadius"),$("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-${ei(t[0])}-radius`]:e,[`border-${ei(t[1])}-radius`]:e}}),C("border-(collapse|separate)","borderCollapse"),$("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),C("border-(solid|dashed|dotted|double|none)","borderStyle"),$("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:i,_:e})=>({...Tt({"--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)"})),ge("border-([xytrbl])-",{section:"borderColor"},Si("border","Color")),ge("border-"),$("border-([xytrbl])(?:$|-)","borderWidth",Si("border","Width")),$("border(?:$|-)","borderWidth"),$("divide-opacity(?:$|-)","divideOpacity",({_:i})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":i}})),C("divide-(solid|dashed|dotted|double|none)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:i}})),C("divide-([xy]-reverse)",({1:i})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+i]:"1"}})),$("divide-([xy])(?:$|-)","divideWidth",({1:i,_:e})=>{let t={x:"lr",y:"tb"}[i];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${i}-reverse`]:"0",[`border-${ei(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${i}-reverse)))`,[`border-${ei(t[1])}Width`]:`calc(${e} * var(--tw-divide-${i}-reverse))`}}}),ge("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),$("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ge("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),$("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),C("ring-inset",{"--tw-ring-inset":"inset"}),ge("ring-",{property:"--tw-ring-color"}),$("ring(?:$|-)","ringWidth",({_:i},{theme:e})=>({...Tt({"--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":We(e("ringOffsetColor","","#fff")),"--tw-ring-color":We(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)"})),ge("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:i})=>({"--tw-shadow-color":i.value,"--tw-shadow":"var(--tw-shadow-colored)"})),$("shadow(?:$|-)","boxShadow",({_:i})=>({...Tt({"--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)"})),$("(opacity)-"),C("mix-blend-","mixBlendMode"),...Uc(),...Uc("backdrop-"),$("transition(?:$|-)","transitionProperty",(i,{theme:e})=>({transitionProperty:et(i),transitionTimingFunction:i._=="none"?void 0:et(e("transitionTimingFunction","")),transitionDuration:i._=="none"?void 0:et(e("transitionDuration",""))})),$("duration(?:$|-)","transitionDuration","transitionDuration",et),$("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",et),$("delay(?:$|-)","transitionDelay","transitionDelay",et),$("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)",C("transform",ua),C("transform-(cpu|gpu)",({1:i})=>({"--tw-transform":zc(i=="gpu")})),$("scale(-[xy])?-","scale",({1:i,_:e})=>({["--tw-scale"+(i||"-x")]:e,["--tw-scale"+(i||"-y")]:e,...ua()})),$("-?(rotate)-","rotate",la),$("-?(translate-[xy])-","translate",la),$("-?(skew-[xy])-","skew",la),C("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Gn),"(appearance)-",$("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",$("(cursor)-"),"(cursor)-",C("snap-(none)","scroll-snap-type"),C("snap-(x|y|both)",({1:i})=>({...Tt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":i+" var(--tw-scroll-snap-strictness)"})),C("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),C("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),C("snap-(normal|always)","scroll-snap-stop"),C("scroll-(auto|smooth)","scroll-behavior"),$("scroll-p([xytrbl])?(?:$|-)","padding",Si("scroll-padding")),$("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",Si("scroll-margin")),C("touch-(auto|none|manipulation)","touch-action"),C("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:i,2:e,3:t})=>({...Tt({"--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)"})),C("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),C("outline",{outlineStyle:"solid"}),C("outline-(dashed|dotted|double)","outlineStyle"),$("-?(outline-offset)-"),ge("outline-",{opacityVariable:!1,opacitySection:"opacity"}),$("outline-","outlineWidth"),"(pointer-events)-",$("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:i})=>({x:"horizontal",y:"vertical"})[i]||i||"both"],C("select-(none|text|all|auto)","userSelect"),ge("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ge("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),$("stroke-","strokeWidth"),C("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),C("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Gn(i){return(typeof i=="string"?i:i[1]).replace(/-/g," ").trim()}function jc(i){return(typeof i=="string"?i:i[1]).replace("col","column")}function ei(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 Nc({$$:i}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[i[3]||""]||"")+i}function Si(i,e=""){return({1:t,_:r})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...br(i+"-"+ei(n[0])+e,r),...br(i+"-"+ei(n[1])+e,r)}:br(i+e,r)}}function Uc(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={...Tt(t),[`${i}filter`]:e.map(r=>`var(--tw-${i}${r})`).join(" ")},[`(${i}filter)-(none)`,C(`${i}filter`,t),...e.map(r=>$(`${r[0]=="h"?"-?":""}(${i}${r})(?:$|-)`,r,({1:n,_:s})=>({[`--tw-${n}`]:Q(s).map(o=>`${r}(${o})`).join(" "),...t})))]}function la({1:i,_:e}){return{["--tw-"+i]:e,...ua()}}function ua(){return{...Tt({"--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":zc()}),transform:"var(--tw-transform)"}}function zc(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 Bc({1:i,2:e}){return`${i} ${e} / ${i} ${e}`}function qc({1:i}){return`repeat(${i},minmax(0,1fr))`}function Tt(i){return{"@layer defaults":{"*,::before,::after":i,"::backdrop":i}}}var Vc=[["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)||at(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=Ei(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)||at(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)||at(i,"",e)),typeof i=="string")return`@media not all and (min-width:${i})`}],["min-",({$$:i},e)=>(i&&(i=at(i,"",e)),i&&`@media (min-width:${i})`)],[/^\[(.+)]$/,({1:i})=>/[&@]/.test(i)&&Ei(i).replace(/[}]+$/,"").split("{")]];function Wc({colors:i,disablePreflight:e}={}){return{preflight:e?void 0:Dc,theme:{...kr,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...i}},variants:Vc,rules:Hc,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 yg={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},bg={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},wg={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},xg={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},kg={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Eg={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Sg={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Cg={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},$g={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Ig={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Ag={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Tg={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Pg={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Rg={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Mg={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Og={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Fg={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Lg={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Dg={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},jg={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Ng={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Ug={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Gc={__proto__:null,slate:yg,gray:bg,zinc:wg,neutral:xg,stone:kg,red:Eg,orange:Sg,amber:Cg,yellow:$g,lime:Ig,green:Ag,emerald:Tg,teal:Pg,cyan:Rg,sky:Mg,blue:Og,indigo:Fg,violet:Lg,purple:Dg,fuchsia:jg,pink:Ng,rose:Ug};function Jn({disablePreflight:i}={}){return Wc({colors:Gc,disablePreflight:i})}function Xn({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)=>Zc(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=Xc(o.theme("fontSize",s));return l&&{"@layer components":l}}],[i+"-",({$$:s},o)=>n(s,o)],[i,(s,o)=>({...n(e,o),"@layer base":[Jc(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:L(20,16),marginBottom:L(20,16),paddingLeft:L(26,16)},li:{marginTop:L(8,16),marginBottom:L(8,16)},"ol>li,ul>li":{paddingLeft:L(6,16)},">ul>li p":{marginTop:L(12,16),marginBottom:L(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:L(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:L(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:L(12,16),marginBottom:L(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:L(48,16),marginBottom:L(48,16)},blockquote:{marginTop:L(32,20),marginBottom:L(32,20),paddingLeft:L(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:L(20,16),marginBottom:L(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:L(36,16),marginTop:"0",marginBottom:L(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:L(24,16),marginTop:L(48,24),marginBottom:L(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:L(20,16),marginTop:L(32,20),marginBottom:L(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:L(24,16),marginBottom:L(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:L(32,16),marginBottom:L(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:L(14,16),lineHeight:"1.4",marginTop:L(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:L(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:L(21,24)},"h3 code":{fontSize:L(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:L(14,16),lineHeight:"1.7",marginTop:L(24,14),marginBottom:L(24,14),borderRadius:"0.375rem",paddingTop:L(12,14),paddingRight:L(16,14),paddingBottom:L(12,14),paddingLeft:L(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:L(32,16),marginBottom:L(32,16),fontSize:L(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:L(8,14),paddingBottom:L(8,14),paddingLeft:L(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:L(8,14),paddingRight:L(8,14),paddingBottom:L(8,14),paddingLeft:L(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:L(20,16),lineHeight:"1.6",marginTop:L(24,20),marginBottom:L(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Jc(i,o,t)],"@layer components":{...Xc(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]=We(h);let g=p!=a&&o.d("colors",`${s}-${u}`,h);g&&(a["--tw-prose-"+d]=We(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 Jc(i,e,t){let r={};for(let n in t)r[Zc(i,n,e,s=>`.${e.e(e.h(i))}${s}`)]=t[n];return r}function Zc(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 Xc(i){return i?typeof i=="string"?{fontSize:i}:{fontSize:i[0],...typeof i[1]=="string"?{lineHeight:i[1]}:i[1]}:void 0}function L(i,e){return`${(i/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var ca=wr({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:[Jn(),Vn(),Wn(),Xn()]});function Zn(i,e=!0){let t=function(){if(Bg)try{let a=zn(new CSSStyleSheet);return a.connect=c=>{let d=da(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,a.target]},a.disconnect=Hn,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[zn(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");da(a).appendChild(c);let d=zn(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=Pc({...i,hash:i.hash??e},t),n=Rc(r);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(da(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=r}}}}var Bg=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function da(i){return i.shadowRoot||i.attachShadow({mode:"open"})}var G=i=>Zn(ca)(i);var Yn=class extends G(H){constructor(){super();T(this,"render",()=>A`
|
|
54
|
+
</svg>`};var ig=hc,Ko=class extends Bn{resolveIcon(e){return ig[e]}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found");e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(t=>{t.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",Ko);function aa(r){return[...r.v,(r.i?"!":"")+r.n].join(":")}function ng(r,e=","){return r.map(aa).join(e)}var bc=typeof CSS<"u"&&CSS.escape||(r=>r.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Hn(r){for(var e=9,t=r.length;t--;)e=Math.imul(e^r.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Wn(r,e="@media "){return e+Y(r).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function Y(r=[]){return Array.isArray(r)?r:r==null?[]:[r]}function fc(r){return r}function Gn(){}var ge={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function wc(r){return r.match(/[-=:;]/g)?.length||0}function ra(r){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(r)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(wc(r),15)<<18}var sg=["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 la({n:r,i:e,v:t=[]},i,n,s){r&&(r=aa({n:r,i:e,v:t})),s=[...Y(s)];for(let l of t){let a=i.theme("screens",l);for(let c of Y(a&&Wn(a)||i.v(l))){var o;s.push(c),n|=a?67108864|ra(c):l=="dark"?1073741824:c[0]=="@"?ra(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~sg.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:r,p:n,r:s,i:e}}var xc=new Map;function ia(r){if(r.d){let e=[],t=Yo(r.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?Yo(i,s=>Yo(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):Qo(s,o)}return Qo(o,s)})):i,"&"),i=>Qo(i,r.n?"."+bc(r.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",r.d)}}function Yo(r,e){return r.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,n)=>e(i)+n)}function Qo(r,e){return r.replace(/&/g,e)}var gc=new Intl.Collator("en",{numeric:!0});function kc(r,e){for(var t=0,i=r.length;t<i;){let n=i+t>>1;0>=Sc(r[n],e)?t=n+1:i=n}return i}function Sc(r,e){let t=r.p&ge.o;return t==(e.p&ge.o)&&(t==ge.b||t==ge.o)?0:r.p-e.p||r.o-e.o||gc.compare(mc(r.n),mc(e.n))||gc.compare(vc(r.n),vc(e.n))}function mc(r){return(r||"").split(/:/).pop().split("/").pop()||"\0"}function vc(r){return(r||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function ea(r,e){return Math.round(parseInt(r,16)*e)}function Je(r,e={}){if(typeof r=="function")return r(e);let{opacityValue:t="1",opacityVariable:i}=e,n=i?`var(${i})`:t;if(r.includes("<alpha-value>"))return r.replace("<alpha-value>",n);if(r[0]=="#"&&(r.length==4||r.length==7)){let s=(r.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[ea(r.substr(1,s),o),ea(r.substr(1+s,s),o),ea(r.substr(1+2*s,s),o),n]})`}return n=="1"?r:n=="0"?"#0000":r.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function Ec(r,e,t,i,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 _,w;let x=o[y];if(y[0]=="@"){if(!x)continue;if(y[1]=="a"){d.push(...ca(l,a,Vn(""+x),u,a,c,p,!0));continue}if(y[1]=="l"){for(let S of Y(x))d.push(...s(S,{n:l,p:(_=ge[y[7]],a&~ge.o|_),r:y[7]=="d"?[]:c,i:p},u));continue}if(y[1]=="i"){d.push(...Y(x).map(S=>({p:-1,o:0,r:[],d:y+" "+S})));continue}if(y[1]=="k"){d.push({p:ge.d,o:0,r:[y],d:s(x,{p:ge.d},u).map(ia).join("")});continue}if(y[1]=="f"){d.push(...Y(x).map(S=>({p:ge.d,o:0,r:[y],d:s(S,{p:ge.d},u).map(ia).join("")})));continue}}if(typeof x!="object"||Array.isArray(x))y=="label"&&x?l=x+Hn(JSON.stringify([a,p,o])):(x||x===0)&&(y=y.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),m+=1,g=Math.max(g,(w=y)[0]=="-"?0:wc(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?";":"")+Y(x).map(S=>u.s(y,ua(""+S,u.theme)+(p?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let S=a;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(M,B)=>{let U=u.theme("screens",B);return U?(S|=67108864,Wn(U,"")):M}),S|=ra(y)),d.push(...s(x,{n:l,p:S,r:[...c,y],i:p},u))}else d.push(...s(x,{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(Sc)}(r,la(e,t,i,n),t)}function ua(r,e){return r.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,n,s,o="")=>{let l=e(n,o);return typeof l=="function"&&/color|fill|stroke/i.test(n)?Je(l):""+Y(l).filter(a=>Object(a)!==a)})}function Cc(r,e){let t,i=[];for(let n of r)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):i.push(t={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function zn(r,e,t=ge.u,i,n){let s=[];for(let o of r)for(let l of function(a,c,p,u,d){a={...a,i:a.i||d};let h=function(g,m){let _=xc.get(g.n);return _?_(g,m):m.r(g.n,g.v[0]=="dark")}(a,c);return h?typeof h=="string"?({r:u,p}=la(a,c,p,u),Cc(zn(Vn(h),c,p,u,a.i),a.n)):Array.isArray(h)?h.map(g=>{var m,_;return{o:0,...g,r:[...Y(u),...Y(g.r)],p:(m=p,_=g.p??p,m&~ge.o|_)}}):Ec(h,a,c,p,u):[{c:aa(a),p:0,o:0,r:[]}]}(o,e,t,i,n))s.splice(kc(s,l),0,l);return s}function ca(r,e,t,i,n,s,o,l){return Cc((l?t.flatMap(a=>zn([a],i,n,s,o)):zn(t,i,n,s,o)).map(a=>a.p&ge.o&&(a.n||e==ge.b)?{...a,p:a.p&~ge.o|e,o:0}:a),r)}function og(r,e,t,i){var n;return n=(s,o)=>{let{n:l,p:a,r:c,i:p}=la(s,o,e);return t&&ca(l,e,t,o,a,c,p,i)},xc.set(r,n),r}function ta(r,e,t){if(r[r.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let l of r)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),n=!n),l.endsWith(":")){i[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:i.filter(ag),i:n}))}}function ag(r,e,t){return t.indexOf(r)==e}var yc=new Map;function Vn(r){let e=yc.get(r);if(!e){let t=[],i=[[]],n=0,s=0,o=null,l=0,a=(c,p=0)=>{n!=l&&(t.push(r.slice(n,l+p)),c&&ta(t,i)),n=l+1};for(;l<r.length;l++){let c=r[l];if(s)r[l-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)r[l-1]!="\\"&&o.test(r.slice(l))&&(o=null,n=l+RegExp.lastMatch.length);else if(c=="/"&&r[l-1]!="\\"&&(r[l+1]=="*"||r[l+1]=="/"))o=r[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")a(),t.push(c);else if(c==":")r[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=i.shift();t.length=p,ta([...t,"#"],i);let{v:h}=i[0].pop();for(let g of d)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);ta([...t,og(u.length>1?u.slice(0,-1)+Hn(JSON.stringify([u,d])):u+"("+ng(d)+")",ge.a,d,/@$/.test(u))],i)}p=t.lastIndexOf("(",p-1)}t.length=p+1}else/[~@]/.test(c)&&r[l+1]=="("&&i.unshift([])}a(!0),yc.set(r,e=i[0])}return e}function $(r,e,t){return[r,na(e,t)]}function na(r,e){return typeof r=="function"?r:typeof r=="string"&&/^[\w-]+$/.test(r)?(t,i)=>({[r]:e?e(t,i):sa(t,1)}):t=>r||{[t[1]]:sa(t,2)}}function sa(r,e,t=r.slice(e).find(Boolean)||r.$$||r.input){return r.input[0]=="-"?`calc(${t} * -1)`:t}function I(r,e,t,i){return[r,pa(e,t,i)]}function pa(r,e,t){let i=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=$c(r||n[1]),l=s.theme(o,n.$$)??lt(n.$$,o,s);if(l!=null)return n._=sa(n,0,l),i(n,s,o)}}function me(r,e={},t){return[r,lg(e,t)]}function lg(r={},e){return(t,i)=>{let{section:n=$c(t[0]).replace("-","")+"Color"}=r,[s,o]=ug(t.$$);if(!s)return;let l=i.theme(n,s)||lt(s,n,i);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}=r,d=i.theme(c,o||"DEFAULT")||o&<(o,c,i),h=e||(({_:m})=>{let _=ki(p,m);return u?{[u]:_}:_});t._={value:Je(l,{opacityVariable:a||void 0,opacityValue:d||void 0}),color:m=>Je(l,m),opacityVariable:a||void 0,opacityValue:d||void 0};let g=h(t,i);if(!t.dark){let m=i.d(n,s,l);m&&m!==l&&(t._={value:Je(m,{opacityVariable:a||void 0,opacityValue:d||"1"}),color:_=>Je(m,_),opacityVariable:a||void 0,opacityValue:d||void 0},g={"&":g,[i.v("dark")]:h(t,i)})}return g}}function ug(r){return(r.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function ki(r,e){let t={};return typeof e=="string"?t[r]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[r]=e.value),t}function lt(r,e,t){if(r[0]=="["&&r.slice(-1)=="]"){if(r=Er(ua(r.slice(1,-1),t.theme)),!e)return r;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(r)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(r))||/image/i.test(e)&&!(/^image:/.test(r)||/^[a-z-]+\(/.test(r))||/weight/i.test(e)&&!(/^(number|any):/.test(r)||/^\d+$/.test(r))||/position/i.test(e)&&/^(length|size):/.test(r)))return r.replace(/^[a-z-]+:/,"")}}function $c(r){return r.replace(/-./g,e=>e[1].toUpperCase())}function Er(r){return r.includes("url(")?r.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,n="")=>Er(t)+i+Er(n)):r.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 Si({presets:r=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Y(e.variants),rules:Y(e.rules),ignorelist:Y(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of Y([...r,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Y(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 i=="function"?i(t):i;t={preflight:t.preflight!==!1&&n!==!1&&[...t.preflight,...Y(n)],darkMode:s,darkColor:o,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...Y(a)],rules:[...t.rules,...Y(c)],ignorelist:[...t.ignorelist,...Y(p)],hash:u,stringify:d,finalize:[...t.finalize,...Y(h)]}}return t}function _c(r,e,t,i,n,s){for(let o of e){let l=t.get(o);l||t.set(o,l=i(o));let a=l(r,n,s);if(a)return a}}function cg(r){var e;return oa(r[0],typeof(e=r[1])=="function"?e:()=>e)}function pg(r){var e,t;return Array.isArray(r)?oa(r[0],na(r[1],r[2])):oa(r,na(e,t))}function oa(r,e){return Ic(r,(t,i,n,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,n)})}function Ic(r,e){let t=Y(r).map(dg);return(i,n,s)=>{for(let o of t){let l=e(i,o,n,s);if(l)return l}}}function dg(r){return typeof r=="string"?RegExp("^"+r+(r.includes("$")||r.slice(-1)=="-"?"":"$")):r}function Ac(r,e){let t=Si(r),i=function({theme:a,darkMode:c,darkColor:p=Gn,variants:u,rules:d,hash:h,stringify:g,ignorelist:m,finalize:_}){let w=new Map,y=new Map,x=new Map,S=new Map,M=Ic(m,(R,q)=>q.test(R));u.push(["dark",Array.isArray(c)||c=="class"?`${Y(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let B=typeof h=="function"?R=>h(R,Hn):h?Hn:fc;B!==fc&&_.push(R=>({...R,n:R.n&&B(R.n),d:R.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(q,V)=>"--"+B(V).replace("#",""))}));let U={theme:function({extend:R={},...q}){let V={},xe={get colors(){return ce("colors")},theme:ce,negative(){return{}},breakpoints(J){let Z={};for(let pe in J)typeof J[pe]=="string"&&(Z["screen-"+pe]=J[pe]);return Z}};return ce;function ce(J,Z,pe,De){if(J){if({1:J,2:De}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(J)||[,J],/[.[]/.test(J)){let $e=[];J.replace(/\[([^\]]+)\]|([^.[]+)/g,(ie,_e,Te=_e)=>$e.push(Te)),J=$e.shift(),pe=Z,Z=$e.join("-")}let ae=V[J]||Object.assign(Object.assign(V[J]={},Le(q,J)),Le(R,J));if(Z==null)return ae;Z||(Z="DEFAULT");let Ce=ae[Z]??Z.split("-").reduce(($e,ie)=>$e?.[ie],ae)??pe;return De?Je(Ce,{opacityValue:ua(De,ce)}):Ce}let Be={};for(let ae of[...Object.keys(q),...Object.keys(R)])Be[ae]=ce(ae);return Be}function Le(J,Z){let pe=J[Z];return typeof pe=="function"&&(pe=pe(xe)),pe&&/color|fill|stroke/i.test(Z)?function De(Be,ae=[]){let Ce={};for(let $e in Be){let ie=Be[$e],_e=[...ae,$e];Ce[_e.join("-")]=ie,$e=="DEFAULT"&&(_e=ae,Ce[ae.join("-")]=ie),typeof ie=="object"&&Object.assign(Ce,De(ie,_e))}return Ce}(pe):pe}}(a),e:bc,h:B,s(R,q){return g(R,q,U)},d(R,q,V){return p(R,q,U,V)},v(R){return w.has(R)||w.set(R,_c(R,u,y,cg,U)||"&:"+R),w.get(R)},r(R,q){let V=JSON.stringify([R,q]);return x.has(V)||x.set(V,!M(R,U)&&_c(R,d,S,pg,U,q)),x.get(V)},f(R){return _.reduce((q,V)=>V(q,U),R)}};return U}(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=i.f(a),p=ia(c);if(p&&!o.has(p)){o.add(p);let u=kc(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 Y(t.preflight))typeof u=="function"&&(u=u(i)),u&&(typeof u=="string"?ca("",ge.b,Vn(u),i,ge.b,[],!1,!0):Ec(u,{},i,ge.b)).forEach(l);c=""+c;let p=n.get(c);if(!p){let u=new Set;for(let d of zn(Vn(c),i))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:i.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 hg(r,e){return r!=e&&""+r.split(" ").sort()!=""+e.split(" ").sort()}function Tc(r){let e=new MutationObserver(t);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),t([{target:n,type:""}])},disconnect(){e.disconnect()}};function t(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let l of o.querySelectorAll("[class]"))i(l);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&hg(o,s=r(o))&&n.setAttribute("class",s)}}function fg(r){let e=document.querySelector(r||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Jn(r){let e=r?.cssRules?r:(r&&typeof r!="string"?r:fg(r)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,i=>i.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,i){try{e.insertRule(t,i)}catch{e.insertRule(":root{}",i)}},resume:Gn}}var gg=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 Pc(r){return gg.get(r)}function Rc(r){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(r);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Oc(r,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(r);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 mg=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Xn(){return({stringify:r})=>({stringify(e,t,i){let n="",s=Pc(e);s&&(n+=r(s,t,i)+";");let o=Rc(e),l=Oc(e,t);for(let a of mg)o&a[1]&&(n+=r(a[0]+e,t,i)+";"),l&a[1]&&(n+=r(e,a[0]+t,i)+";");return n+r(e,t,i)}})}function Zn(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",pa("lineClamp",({_:r})=>Mc(r))],["line-clamp-(\\d+)",({1:r})=>Mc(r)]]}}function Mc(r){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${r}`}}var Ci={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:W("blur"),backdropBrightness:W("brightness"),backdropContrast:W("contrast"),backdropGrayscale:W("grayscale"),backdropHueRotate:W("hueRotate"),backdropInvert:W("invert"),backdropOpacity:W("opacity"),backdropSaturate:W("saturate"),backdropSepia:W("sepia"),backgroundColor:W("colors"),backgroundImage:{none:"none"},backgroundOpacity:W("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:r})=>({DEFAULT:r("colors.gray.200","currentColor"),...r("colors")}),borderOpacity:W("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:W("spacing"),borderWidth:{DEFAULT:"1px",...Xe(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:W("colors"),caretColor:W("colors"),accentColor:({theme:r})=>({auto:"auto",...r("colors")}),contrast:{...He(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:W("borderColor"),divideOpacity:W("borderOpacity"),divideWidth:W("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:r})=>({...r("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:r})=>({...r("spacing"),...Ei(2,6),...Ei(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:W("spacing"),gradientColorStops:W("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:r})=>({...r("spacing"),...Ei(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:r})=>({...r("spacing"),...Ei(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:r})=>({auto:"auto",...r("spacing")}),maxHeight:({theme:r})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...r("spacing")}),maxWidth:({theme:r,breakpoints:e})=>({...e(r("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:W("spacing"),placeholderColor:W("colors"),placeholderOpacity:W("opacity"),outlineColor:W("colors"),outlineOffset:Xe(8,"px"),outlineWidth:Xe(8,"px"),ringColor:({theme:r})=>({...r("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:W("colors"),ringOffsetWidth:Xe(8,"px"),ringOpacity:({theme:r})=>({...r("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Xe(8,"px")},rotate:{...Xe(2,"deg"),...Xe(12,"deg",3),...Xe(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:W("spacing"),scrollPadding:W("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Xe(2,"deg"),...Xe(12,"deg",3)},space:W("spacing"),stroke:({theme:r})=>({...r("colors"),none:"none"}),strokeWidth:He(2),textColor:W("colors"),textDecorationColor:W("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Xe(8,"px")},textUnderlineOffset:{auto:"auto",...Xe(8,"px")},textIndent:W("spacing"),textOpacity:W("opacity"),transitionDuration:({theme:r})=>({...r("durations"),DEFAULT:"150ms"}),transitionDelay:W("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:r})=>({...r("spacing"),...Ei(2,4),full:"100%"}),width:({theme:r})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...r("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...He(50,"",1,0,10),auto:"auto"}};function Ei(r,e){let t={};do for(var i=1;i<r;i++)t[`${i}/${r}`]=Number((i/r*100).toFixed(6))+"%";while(++r<=e);return t}function Xe(r,e,t=0){let i={};for(;t<=r;t=2*t||1)i[t]=t+e;return i}function He(r,e="",t=1,i=0,n=1,s={}){for(;i<=r;i+=n)s[i]=i/t+e;return s}function W(r){return({theme:e})=>e(r)}var Fc={"*,::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, ${Ci.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, ${Ci.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 qc=[$("\\[([-\\w]+):(.+)]",({1:r,2:e},t)=>({"@layer overrides":{"&":{[r]:lt(`[${e}]`,"",t)}}})),$("(group|peer)([~/][^-[]+)?",({input:r},{h:e})=>[{c:e(r)}]),I("aspect-","aspectRatio"),$("container",(r,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let l in t){let a=t[l];typeof a=="string"&&(s[Wn(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}}}),I("content-","content",({_:r})=>({"--tw-content":r,content:"var(--tw-content)"})),$("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),$("box-(border|content)","boxSizing",({1:r})=>r+"-box"),$("hidden",{display:"none"}),$("table-(auto|fixed)","tableLayout"),$(["(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)",$("isolate","isolation"),$("object-(contain|cover|fill|none|scale-down)","objectFit"),I("object-","objectPosition"),$("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Kn),$("overscroll(-[xy])?-(auto|contain|none)",({1:r="",2:e})=>({["overscroll-behavior"+r]:e})),$("(static|fixed|absolute|relative|sticky)","position"),I("-?inset(-[xy])?(?:$|-)","inset",({1:r,_:e})=>({top:r!="-x"&&e,right:r!="-y"&&e,bottom:r!="-x"&&e,left:r!="-y"&&e})),I("-?(top|bottom|left|right)(?:$|-)","inset"),$("(visible|collapse)","visibility"),$("invisible",{visibility:"hidden"}),I("-?z-","zIndex"),$("flex-((row|col)(-reverse)?)","flexDirection",Lc),$("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),I("(flex-(?:grow|shrink))(?:$|-)"),I("(flex)-"),I("grow(?:$|-)","flexGrow"),I("shrink(?:$|-)","flexShrink"),I("basis-","flexBasis"),I("-?(order)-"),"-?(order)-(\\d+)",I("grid-cols-","gridTemplateColumns"),$("grid-cols-(\\d+)","gridTemplateColumns",Uc),I("col-","gridColumn"),$("col-(span)-(\\d+)","gridColumn",Nc),I("col-start-","gridColumnStart"),$("col-start-(auto|\\d+)","gridColumnStart"),I("col-end-","gridColumnEnd"),$("col-end-(auto|\\d+)","gridColumnEnd"),I("grid-rows-","gridTemplateRows"),$("grid-rows-(\\d+)","gridTemplateRows",Uc),I("row-","gridRow"),$("row-(span)-(\\d+)","gridRow",Nc),I("row-start-","gridRowStart"),$("row-start-(auto|\\d+)","gridRowStart"),I("row-end-","gridRowEnd"),$("row-end-(auto|\\d+)","gridRowEnd"),$("grid-flow-((row|col)(-dense)?)","gridAutoFlow",r=>Kn(Lc(r))),$("grid-flow-(dense)","gridAutoFlow"),I("auto-cols-","gridAutoColumns"),I("auto-rows-","gridAutoRows"),I("gap-x(?:$|-)","gap","columnGap"),I("gap-y(?:$|-)","gap","rowGap"),I("gap(?:$|-)","gap"),"(justify-(?:items|self))-",$("justify-","justifyContent",Dc),$("(content|items|self)-",r=>({["align-"+r[1]]:Dc(r)})),$("(place-(content|items|self))-",({1:r,$$:e})=>({[r]:("wun".includes(e[3])?"space-":"")+e})),I("p([xytrbl])?(?:$|-)","padding",Cr("padding")),I("-?m([xytrbl])?(?:$|-)","margin",Cr("margin")),I("-?space-(x|y)(?:$|-)","space",({1:r,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[r]]:`calc(${e} * calc(1 - var(--tw-space-${r}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[r]]:`calc(${e} * var(--tw-space-${r}-reverse))`}})),$("space-(x|y)-reverse",({1:r})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"1"}})),I("w-","width"),I("min-w-","minWidth"),I("max-w-","maxWidth"),I("h-","height"),I("min-h-","minHeight"),I("max-h-","maxHeight"),I("font-","fontWeight"),I("font-","fontFamily",({_:r})=>typeof(r=Y(r))[1]=="string"?{fontFamily:it(r)}:{fontFamily:it(r[0]),...r[1]}),$("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),$("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),$("italic","fontStyle"),$("not-italic",{fontStyle:"normal"}),$("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:r,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":r)]:r,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Tt({"--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,/*!*/ /*!*/)"})}),I("tracking-","letterSpacing"),I("leading-","lineHeight"),$("list-(inside|outside)","listStylePosition"),I("list-","listStyleType"),$("list-","listStyleType"),I("placeholder-opacity-","placeholderOpacity",({_:r})=>({"&::placeholder":{"--tw-placeholder-opacity":r}})),me("placeholder-",{property:"color",selector:"&::placeholder"}),$("text-(left|center|right|justify|start|end)","textAlign"),$("text-(ellipsis|clip)","textOverflow"),I("text-opacity-","textOpacity","--tw-text-opacity"),me("text-",{property:"color"}),I("text-","fontSize",({_:r})=>typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}),I("indent-","textIndent"),$("(overline|underline|line-through)","textDecorationLine"),$("no-underline",{textDecorationLine:"none"}),I("underline-offset-","textUnderlineOffset"),me("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),I("decoration-","textDecorationThickness"),$("decoration-","textDecorationStyle"),$("(uppercase|lowercase|capitalize)","textTransform"),$("normal-case",{textTransform:"none"}),$("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),$("align-","verticalAlign"),$("whitespace-","whiteSpace"),$("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),$("break-words",{overflowWrap:"break-word"}),$("break-all",{wordBreak:"break-all"}),$("break-keep",{wordBreak:"keep-all"}),me("caret-",{opacityVariable:!1,opacitySection:"opacity"}),me("accent-",{opacityVariable:!1,opacitySection:"opacity"}),$("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:r})=>`linear-gradient(to ${tr(r," ")},var(--tw-gradient-stops))`),me("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-from":r.value,"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),me("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${r.value},var(--tw-gradient-to)`})),me("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),$("bg-(fixed|local|scroll)","backgroundAttachment"),$("bg-origin-(border|padding|content)","backgroundOrigin",({1:r})=>r+"-box"),$(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),$("bg-blend-","backgroundBlendMode"),$("bg-clip-(border|padding|content|text)","backgroundClip",({1:r})=>r+(r=="text"?"":"-box")),I("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),me("bg-",{section:"backgroundColor"}),I("bg-","backgroundImage"),I("bg-","backgroundPosition"),$("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Kn),I("bg-","backgroundSize"),I("rounded(?:$|-)","borderRadius"),I("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:r,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[r]||[r,r];return{[`border-${tr(t[0])}-radius`]:e,[`border-${tr(t[1])}-radius`]:e}}),$("border-(collapse|separate)","borderCollapse"),I("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),$("border-(solid|dashed|dotted|double|none)","borderStyle"),I("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:r,_:e})=>({...Tt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(r||"-x")]:e,["--tw-border-spacing"+(r||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),me("border-([xytrbl])-",{section:"borderColor"},Cr("border","Color")),me("border-"),I("border-([xytrbl])(?:$|-)","borderWidth",Cr("border","Width")),I("border(?:$|-)","borderWidth"),I("divide-opacity(?:$|-)","divideOpacity",({_:r})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":r}})),$("divide-(solid|dashed|dotted|double|none)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:r}})),$("divide-([xy]-reverse)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+r]:"1"}})),I("divide-([xy])(?:$|-)","divideWidth",({1:r,_:e})=>{let t={x:"lr",y:"tb"}[r];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${r}-reverse`]:"0",[`border-${tr(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${r}-reverse)))`,[`border-${tr(t[1])}Width`]:`calc(${e} * var(--tw-divide-${r}-reverse))`}}}),me("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),I("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),me("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),I("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),$("ring-inset",{"--tw-ring-inset":"inset"}),me("ring-",{property:"--tw-ring-color"}),I("ring(?:$|-)","ringWidth",({_:r},{theme:e})=>({...Tt({"--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":Je(e("ringOffsetColor","","#fff")),"--tw-ring-color":Je(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(${r} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),me("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-shadow-color":r.value,"--tw-shadow":"var(--tw-shadow-colored)"})),I("shadow(?:$|-)","boxShadow",({_:r})=>({...Tt({"--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(r),"--tw-shadow-colored":it(r).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)"})),I("(opacity)-"),$("mix-blend-","mixBlendMode"),...jc(),...jc("backdrop-"),I("transition(?:$|-)","transitionProperty",(r,{theme:e})=>({transitionProperty:it(r),transitionTimingFunction:r._=="none"?void 0:it(e("transitionTimingFunction","")),transitionDuration:r._=="none"?void 0:it(e("transitionDuration",""))})),I("duration(?:$|-)","transitionDuration","transitionDuration",it),I("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",it),I("delay(?:$|-)","transitionDelay","transitionDelay",it),I("animate(?:$|-)","animation",(r,{theme:e,h:t,e:i})=>{let n=it(r),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",$("transform",ha),$("transform-(cpu|gpu)",({1:r})=>({"--tw-transform":Bc(r=="gpu")})),I("scale(-[xy])?-","scale",({1:r,_:e})=>({["--tw-scale"+(r||"-x")]:e,["--tw-scale"+(r||"-y")]:e,...ha()})),I("-?(rotate)-","rotate",da),I("-?(translate-[xy])-","translate",da),I("-?(skew-[xy])-","skew",da),$("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Kn),"(appearance)-",I("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",I("(cursor)-"),"(cursor)-",$("snap-(none)","scroll-snap-type"),$("snap-(x|y|both)",({1:r})=>({...Tt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":r+" var(--tw-scroll-snap-strictness)"})),$("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),$("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),$("snap-(normal|always)","scroll-snap-stop"),$("scroll-(auto|smooth)","scroll-behavior"),I("scroll-p([xytrbl])?(?:$|-)","padding",Cr("scroll-padding")),I("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",Cr("scroll-margin")),$("touch-(auto|none|manipulation)","touch-action"),$("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:r,2:e,3:t})=>({...Tt({"--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":r}`]:r,"touch-action":"var(--tw-touch-action)"})),$("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),$("outline",{outlineStyle:"solid"}),$("outline-(dashed|dotted|double)","outlineStyle"),I("-?(outline-offset)-"),me("outline-",{opacityVariable:!1,opacitySection:"opacity"}),I("outline-","outlineWidth"),"(pointer-events)-",I("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:r})=>({x:"horizontal",y:"vertical"})[r]||r||"both"],$("select-(none|text|all|auto)","userSelect"),me("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),me("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),I("stroke-","strokeWidth"),$("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),$("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Kn(r){return(typeof r=="string"?r:r[1]).replace(/-/g," ").trim()}function Lc(r){return(typeof r=="string"?r:r[1]).replace("col","column")}function tr(r,e="-"){let t=[];for(let i of r)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function it(r){return r&&""+(r._||r)}function Dc({$$:r}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[r[3]||""]||"")+r}function Cr(r,e=""){return({1:t,_:i})=>{let n={x:"lr",y:"tb"}[t]||t+t;return n?{...ki(r+"-"+tr(n[0])+e,i),...ki(r+"-"+tr(n[1])+e,i)}:ki(r+e,i)}}function jc(r=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",r&&"opacity","saturate","sepia",!r&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${r}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...Tt(t),[`${r}filter`]:e.map(i=>`var(--tw-${r}${i})`).join(" ")},[`(${r}filter)-(none)`,$(`${r}filter`,t),...e.map(i=>I(`${i[0]=="h"?"-?":""}(${r}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:Y(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function da({1:r,_:e}){return{["--tw-"+r]:e,...ha()}}function ha(){return{...Tt({"--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":Bc()}),transform:"var(--tw-transform)"}}function Bc(r){return[r?"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 Nc({1:r,2:e}){return`${r} ${e} / ${r} ${e}`}function Uc({1:r}){return`repeat(${r},minmax(0,1fr))`}function Tt(r){return{"@layer defaults":{"*,::before,::after":r,"::backdrop":r}}}var Hc=[["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:r})=>`@media (orientation:${r})`],["contrast-(more|less)",({1:r})=>`@media (prefers-contrast:${r})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:r})=>`&::${r}`],["(marker|selection)",({1:r})=>`& *::${r},&::${r}`],["file","&::file-selector-button"],["(first|last|only)",({1:r})=>`&:${r}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:r,$$:e},t)=>e&&`&[${r}-${t.theme(r,e)||lt(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:r,3:e="",4:t,5:i="",6:n=e},{e:s,h:o,v:l})=>{let a=Er(i)||(t[0]=="["?t:l(t.slice(1)));return`${(a.includes("&")?a:"&"+a).replace(/&/g,`:merge(.${s(o(r+n))})`)}${r[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:r})=>`[dir="${r}"] &`],["supports-",({$$:r},e)=>{if(r&&(r=e.theme("supports",r)||lt(r,"",e)),r)return r.includes(":")||(r+=":var(--tw)"),/^\w*\s*\(/.test(r)||(r=`(${r})`),`@supports ${r.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:r},e)=>{if(r&&(r=e.theme("screens",r)||lt(r,"",e)),typeof r=="string")return`@media not all and (min-width:${r})`}],["min-",({$$:r},e)=>(r&&(r=lt(r,"",e)),r&&`@media (min-width:${r})`)],[/^\[(.+)]$/,({1:r})=>/[&@]/.test(r)&&Er(r).replace(/[}]+$/,"").split("{")]];function zc({colors:r,disablePreflight:e}={}){return{preflight:e?void 0:Fc,theme:{...Ci,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...r}},variants:Hc,rules:qc,finalize(t){return t.n&&t.d&&t.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var vg={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},yg={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},_g={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},bg={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},wg={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},xg={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},kg={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Sg={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Eg={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Cg={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},$g={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Ig={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Ag={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Tg={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Pg={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Rg={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Og={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Mg={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},Fg={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Lg={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Dg={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},jg={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Vc={__proto__:null,slate:vg,gray:yg,zinc:_g,neutral:bg,stone:wg,red:xg,orange:kg,amber:Sg,yellow:Eg,lime:Cg,green:$g,emerald:Ig,teal:Ag,cyan:Tg,sky:Pg,blue:Rg,indigo:Og,violet:Mg,purple:Fg,fuchsia:Lg,pink:Dg,rose:jg};function Yn({disablePreflight:r}={}){return zc({colors:Vc,disablePreflight:r})}function Qn({className:r="prose",defaultColor:e="gray",extend:t={},colors:i={}}={}){return i={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",...i,dark:i.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",...i.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])=>[`${r}-${s}`,(l,a)=>Jc(r,o[0]=="."?"."+a.e(a.h(o.slice(1))):o,a,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${r})`,({1:s},{h:o})=>[{c:o(s)}]],[`${r}-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)"}}],[r+"-",({$$:s},o)=>{let l=Gc(o.theme("fontSize",s));return l&&{"@layer components":l}}],[r+"-",({$$:s},o)=>n(s,o)],[r,(s,o)=>({...n(e,o),"@layer base":[Wc(r,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:L(20,16),marginBottom:L(20,16),paddingLeft:L(26,16)},li:{marginTop:L(8,16),marginBottom:L(8,16)},"ol>li,ul>li":{paddingLeft:L(6,16)},">ul>li p":{marginTop:L(12,16),marginBottom:L(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:L(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:L(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:L(12,16),marginBottom:L(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:L(48,16),marginBottom:L(48,16)},blockquote:{marginTop:L(32,20),marginBottom:L(32,20),paddingLeft:L(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:L(20,16),marginBottom:L(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:L(36,16),marginTop:"0",marginBottom:L(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:L(24,16),marginTop:L(48,24),marginBottom:L(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:L(20,16),marginTop:L(32,20),marginBottom:L(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:L(24,16),marginBottom:L(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:L(32,16),marginBottom:L(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:L(14,16),lineHeight:"1.4",marginTop:L(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:L(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:L(21,24)},"h3 code":{fontSize:L(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:L(14,16),lineHeight:"1.7",marginTop:L(24,14),marginBottom:L(24,14),borderRadius:"0.375rem",paddingTop:L(12,14),paddingRight:L(16,14),paddingBottom:L(12,14),paddingLeft:L(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:L(32,16),marginBottom:L(32,16),fontSize:L(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:L(8,14),paddingBottom:L(8,14),paddingLeft:L(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:L(8,14),paddingRight:L(8,14),paddingBottom:L(8,14),paddingLeft:L(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:L(20,16),lineHeight:"1.6",marginTop:L(24,20),marginBottom:L(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Wc(r,o,t)],"@layer components":{...Gc(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]=Je(h);let g=d!=a&&o.d("colors",`${s}-${u}`,h);g&&(a["--tw-prose-"+p]=Je(g))};for(let p in i){let u=i[p];p!="dark"&&u&&c(p,u,l)}for(let p in i.dark||{}){let u=i.dark[p];u&&(i.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 Wc(r,e,t){let i={};for(let n in t)i[Jc(r,n,e,s=>`.${e.e(e.h(r))}${s}`)]=t[n];return i}function Jc(r,e,{e:t,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",l=s,a="")=>n(`${o}:where(${l}):not(:where(.${t(i("not-"+r))} *))${a}`))}function Gc(r){return r?typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}:void 0}function L(r,e){return`${(r/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var fa=Si({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:[Yn(),Xn(),Zn(),Qn()]});function es(r,e=!0){let t=function(){if(Ng)try{let a=Jn(new CSSStyleSheet);return a.connect=c=>{let p=ga(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,a.target]},a.disconnect=Gn,a}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Jn(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");ga(a).appendChild(c);let p=Jn(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)}}}(),i=Ac({...r,hash:r.hash??e},t),n=Tc(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),n.observe(ga(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...a){super(...a),this.tw=i}}}}var Ng=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function ga(r){return r.shadowRoot||r.attachShadow({mode:"open"})}var G=r=>es(fa)(r);var ts=class extends G(H){constructor(){super();T(this,"render",()=>E`
|
|
55
55
|
<!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
|
|
56
56
|
<!-- 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 -->
|
|
57
57
|
<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">
|
|
58
58
|
<!-- the 'open' state invites the user to open (e.g. the chat window) -->
|
|
59
59
|
<div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute bottom-0 left-0 right-0 top-0 transition-[opacity,visibility]">
|
|
60
|
-
${this.src?
|
|
60
|
+
${this.src?E`
|
|
61
61
|
<!-- load given source -->
|
|
62
62
|
<!-- scale-[1.01] fixes aliasing (white outline) -->
|
|
63
63
|
<img class="block h-full w-full scale-[1.01] bg-white" src="${this.src}" alt="Molin AI chat" />
|
|
64
|
-
`:
|
|
64
|
+
`:E`
|
|
65
65
|
<!-- if no image URL is specified, we default to our animation -->
|
|
66
66
|
<!-- scale-[1.01] fixes aliasing (white outline) -->
|
|
67
67
|
<img src="https://assets.molinai.io/2024/widget-v20241209/bubble.webp" class="block h-full w-full scale-[1.01]" alt="Molin AI chat" />
|
|
@@ -77,9 +77,9 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
77
77
|
</svg>
|
|
78
78
|
</div>
|
|
79
79
|
</button>
|
|
80
|
-
`);this.state="open",this.src=""}};T(
|
|
80
|
+
`);this.state="open",this.src=""}};T(ts,"properties",{state:{type:String},src:{type:String}});customElements.get("mw-bubble")||customElements.define("mw-bubble",ts);var rs={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},is=r=>(...e)=>({_$litDirective$:r,values:e}),$r=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Ug}=pc;var Xc=()=>document.createComment(""),Ir=(r,e,t)=>{let i=r._$AA.parentNode,n=e===void 0?r._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(Xc(),n),o=i.insertBefore(Xc(),n);t=new Ug(s,o,r,r.options)}else{let s=t._$AB.nextSibling,o=t._$AM,l=o!==r;if(l){let a;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(a=r._$AU)!==o._$AU&&t._$AP(a)}if(s!==n||l){let a=t._$AA;for(;a!==s;){let c=a.nextSibling;i.insertBefore(a,n),a=c}}}return t},Pt=(r,e,t=r)=>(r._$AI(e,t),r),qg={},Zc=(r,e=qg)=>r._$AH=e,Kc=r=>r._$AH,ns=r=>{r._$AP?.(!1,!0);let e=r._$AA,t=r._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var Yc=(r,e,t)=>{let i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},Rt=is(class extends $r{constructor(r){if(super(r),r.type!==rs.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let l of r)n[o]=i?i(l,o):o,s[o]=t(l,o),o++;return{values:s,keys:n}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){let n=Kc(r),{values:s,keys:o}=this.dt(e,t,i);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]=Pt(n[u],s[h]),u++,h++;else if(l[d]===o[g])a[g]=Pt(n[d],s[g]),d--,g--;else if(l[u]===o[g])a[g]=Pt(n[u],s[g]),Ir(r,a[g+1],n[u]),u++,g--;else if(l[d]===o[h])a[h]=Pt(n[d],s[h]),Ir(r,n[u],n[d]),d--,h++;else if(c===void 0&&(c=Yc(o,h,g),p=Yc(l,u,d)),c.has(l[u]))if(c.has(l[d])){let m=p.get(o[h]),_=m!==void 0?n[m]:null;if(_===null){let w=Ir(r,n[u]);Pt(w,s[h]),a[h]=w}else a[h]=Pt(_,s[h]),Ir(r,n[u],_),n[m]=null;h++}else ns(n[d]),d--;else ns(n[u]),u++;for(;h<=g;){let m=Ir(r,a[g+1]);Pt(m,s[h]),a[h++]=m}for(;u<=d;){let m=n[u++];m!==null&&ns(m)}return this.ut=o,Zc(r,a),rt}});function $i(r,e,t){return r?e(r):t?.(r)}var ss,Qc,os=class os extends G(H){constructor(){super();b(this,ss);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?j:E`
|
|
81
81
|
<div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pb-2 pt-6">
|
|
82
|
-
${
|
|
82
|
+
${$i(this.examples.title,()=>E`
|
|
83
83
|
<h2 class="mt-14 px-2 pb-2 pt-9 text-left text-3xl font-bold leading-tight tracking-tight">
|
|
84
84
|
<span>${this.examples.title}</span>
|
|
85
85
|
<svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
|
|
@@ -89,20 +89,20 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
89
89
|
</svg>
|
|
90
90
|
</h2>
|
|
91
91
|
`)}
|
|
92
|
-
${this.examples?.items?.length?
|
|
92
|
+
${this.examples?.items?.length?E`
|
|
93
93
|
<ul class="mt-auto flex select-none flex-wrap justify-end gap-2.5 text-sm/6 text-black">
|
|
94
|
-
${
|
|
94
|
+
${Rt(this.examples.items,t=>t,t=>E`
|
|
95
95
|
<li
|
|
96
96
|
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"
|
|
97
|
-
@click="${()=>
|
|
97
|
+
@click="${()=>C(this,ss,Qc).call(this,t)}">
|
|
98
98
|
<span>${t.trim()}</span>
|
|
99
99
|
</li>
|
|
100
100
|
`)}
|
|
101
101
|
</ul>
|
|
102
102
|
`:j}
|
|
103
103
|
</div>
|
|
104
|
-
`}};
|
|
105
|
-
<div class="relative
|
|
104
|
+
`}};ss=new WeakSet,Qc=function(t){this.dispatchEvent(new os.ExampleClickEvent({example:t}))},T(os,"properties",{examples:{type:Object},color:{type:String}});var Ii=os,ma;Ii.ExampleClickEvent=(ma=class extends CustomEvent{constructor(e,t={}){super(Ii.ExampleClickEvent.type,{detail:e,...t})}},T(ma,"type","mw:example-click"),ma);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Ii);var Tr,ep,tp,Ar=class Ar extends G(H){constructor(){super();b(this,Tr);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return E`
|
|
105
|
+
<div class="relative h-12">
|
|
106
106
|
<div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
|
|
107
107
|
|
|
108
108
|
<div class="absolute inset-0 h-12 overflow-hidden rounded-full">
|
|
@@ -124,7 +124,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
124
124
|
<div class="flex-grow"></div>
|
|
125
125
|
|
|
126
126
|
<!-- new chat btn -->
|
|
127
|
-
<button @click=${
|
|
127
|
+
<button @click=${C(this,Tr,ep)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
|
|
128
128
|
<!-- svg icon of a bubble with a plus -->
|
|
129
129
|
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
|
|
130
130
|
<path
|
|
@@ -136,7 +136,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
136
136
|
</button>
|
|
137
137
|
|
|
138
138
|
<!-- close chat btn -->
|
|
139
|
-
<button @click=${
|
|
139
|
+
<button @click=${C(this,Tr,tp)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
|
|
140
140
|
<!-- svg icon of an X -->
|
|
141
141
|
<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">
|
|
142
142
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
|
@@ -151,7 +151,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
151
151
|
</div>
|
|
152
152
|
</div>
|
|
153
153
|
</div>
|
|
154
|
-
`}};
|
|
154
|
+
`}};Tr=new WeakSet,ep=function(){this.dispatchEvent(new Ar.NewChatClickEvent)},tp=function(){this.dispatchEvent(new Ar.CloseClickEvent)},T(Ar,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),T(Ar,"styles",tt`
|
|
155
155
|
/* blurred background */
|
|
156
156
|
|
|
157
157
|
.gradient-blur {
|
|
@@ -163,24 +163,24 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
163
163
|
/* bg-color gradient */
|
|
164
164
|
background-image: linear-gradient(to bottom, white 20%, transparent);
|
|
165
165
|
}
|
|
166
|
-
`);var
|
|
167
|
-
<form @submit="${
|
|
166
|
+
`);var rr=Ar,va;rr.NewChatClickEvent=(va=class extends CustomEvent{constructor(e={}){super(rr.NewChatClickEvent.type,{...e})}},T(va,"type","mw:new-chat-click"),va);var ya;rr.CloseClickEvent=(ya=class extends CustomEvent{constructor(e={}){super(rr.CloseClickEvent.type,{...e})}},T(ya,"type","mw:close-click"),ya);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",rr);var _a={maxHeight:120,initialHeight:32,paddingY:12},Ie,ka,rp,ip,np,sp,Sa,Pr=class Pr extends G(H){constructor(){super();b(this,Ie);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message..."}render(){return E`
|
|
167
|
+
<form @submit="${C(this,Ie,np)}" class="flex w-full items-center overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)]">
|
|
168
168
|
<textarea
|
|
169
169
|
name="input"
|
|
170
|
-
@input="${
|
|
171
|
-
@keydown="${
|
|
170
|
+
@input="${C(this,Ie,sp)}"
|
|
171
|
+
@keydown="${C(this,Ie,ip)}"
|
|
172
172
|
autofocus
|
|
173
173
|
?disabled="${this.disabled}"
|
|
174
174
|
placeholder="${this.placeholder}"
|
|
175
|
-
class="box-content h-[${
|
|
175
|
+
class="box-content h-[${_a.initialHeight}px] w-full resize-none place-content-center rounded bg-white px-3 py-[${_a.paddingY}px] text-base text-gray-800 outline-none"></textarea>
|
|
176
176
|
|
|
177
177
|
<button type="submit" ?disabled="${this.disabled}" class="mx-1 px-2 transition-opacity duration-200 hover:opacity-80">
|
|
178
|
-
${this.streaming?
|
|
178
|
+
${this.streaming?E`
|
|
179
179
|
<!-- x -->
|
|
180
180
|
<svg class="h-6 w-6 fill-current" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="#312E30">
|
|
181
181
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
|
182
182
|
</svg>
|
|
183
|
-
`:
|
|
183
|
+
`:E`
|
|
184
184
|
<!-- airplane -->
|
|
185
185
|
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 35 34">
|
|
186
186
|
<path
|
|
@@ -196,7 +196,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
196
196
|
<slot>
|
|
197
197
|
<div class="h-5 w-full"></div>
|
|
198
198
|
</slot>
|
|
199
|
-
`}}
|
|
199
|
+
`}};Ie=new WeakSet,ka=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},rp=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},ip=function(t){Bg(t)&&(t.preventDefault(),this.streaming||f(this,Ie,rp)?.click())},np=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new Pr.CancelEvent);return}let i=f(this,Ie,ka);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new Pr.SubmitEvent(i.value))&&(i.value=""),C(this,Ie,Sa).call(this)},sp=function(t){this.dispatchEvent(new Pr.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),C(this,Ie,Sa).call(this)},Sa=function(){let t=f(this,Ie,ka);if(!t)return;let{maxHeight:i,initialHeight:n,paddingY:s}=_a;t.style.height=`${n}px`;let o=t.scrollHeight,l=s*2,a=Math.min(o-l,i);t.style.height=`${a}px`},T(Pr,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String}});var vt=Pr,ba;vt.ChangeEvent=(ba=class extends CustomEvent{constructor(e,t={}){super(vt.ChangeEvent.type,{detail:e,...t})}},T(ba,"type","mw:change"),ba);var wa;vt.SubmitEvent=(wa=class extends CustomEvent{constructor(e,t={}){super(vt.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},T(wa,"type","mw:submit"),wa);var xa;vt.CancelEvent=(xa=class extends CustomEvent{constructor(e={}){super(vt.CancelEvent.type,{...e})}},T(xa,"type","mw:cancel"),xa);function Bg(r){return(r.code==="Enter"||r.code==="NumpadEnter")&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",vt);var as=class extends G(H){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 E`
|
|
200
200
|
<div class="ml-20 flex justify-end font-sans text-base">
|
|
201
201
|
<div class="max-w-full">
|
|
202
202
|
<!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
|
|
@@ -205,7 +205,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
205
205
|
</div>
|
|
206
206
|
|
|
207
207
|
<!-- render status (if any) -->
|
|
208
|
-
${this.status==="sent"?
|
|
208
|
+
${this.status==="sent"?E`
|
|
209
209
|
<!-- tick mark -->
|
|
210
210
|
<svg class="ml-auto h-3 w-3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
|
211
211
|
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
|
|
@@ -213,7 +213,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
213
213
|
`:j}
|
|
214
214
|
</div>
|
|
215
215
|
</div>
|
|
216
|
-
`;case"assistant":case"support":return
|
|
216
|
+
`;case"assistant":case"support":return E`
|
|
217
217
|
<div class="mr-8 flex justify-start font-sans text-base">
|
|
218
218
|
<div class="flex max-w-full space-x-2">
|
|
219
219
|
<!--
|
|
@@ -226,13 +226,13 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
226
226
|
<!--
|
|
227
227
|
min-h-[50px] because when we start streaming we sometimes start with an empty paragraph
|
|
228
228
|
-->
|
|
229
|
-
<!--
|
|
229
|
+
<!-- TODO: maybe add back border? border border-gray-100 -->
|
|
230
230
|
<div class="${t} min-h-[50px] max-w-full overflow-hidden bg-gray-50 px-4 py-3 text-left text-gray-800">
|
|
231
231
|
<slot></slot>
|
|
232
232
|
</div>
|
|
233
233
|
</div>
|
|
234
234
|
</div>
|
|
235
|
-
`;default:throw new Error(`Unknown side: ${this.side}`)}}};T(
|
|
235
|
+
`;default:throw new Error(`Unknown side: ${this.side}`)}}};T(as,"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",as);var Ea=class extends G(H){constructor(){super(...arguments);T(this,"render",()=>E`
|
|
236
236
|
<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">
|
|
237
237
|
<circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
|
|
238
238
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
|
|
@@ -244,11 +244,11 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
244
244
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
|
|
245
245
|
</circle>
|
|
246
246
|
</svg>
|
|
247
|
-
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",
|
|
247
|
+
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",Ea);var Hg="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Ca=class extends G(H){constructor(){super(...arguments);T(this,"render",()=>E`
|
|
248
248
|
<p class="flex items-center justify-center whitespace-nowrap text-xs">
|
|
249
249
|
<span>Powered by</span>
|
|
250
250
|
|
|
251
|
-
<a href="${
|
|
251
|
+
<a href="${Hg}" target="_blank" class="inline-flex items-center underline">
|
|
252
252
|
<svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
253
253
|
<circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
|
|
254
254
|
<path
|
|
@@ -267,7 +267,163 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
267
267
|
<span>Molin AI</span>
|
|
268
268
|
</a>
|
|
269
269
|
</p>
|
|
270
|
-
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",xa);var $r,De,lt,Ir,ka,ns=class{constructor(e,t){y(this,Ir);y(this,$r);y(this,De);y(this,lt);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");I(this,$r,e),f(this,$r).addController(this),I(this,De,t)}connect(e){I(this,De,e),I(this,lt,x(this,Ir,ka).call(this))}hostConnected(){setTimeout(()=>{I(this,lt,x(this,Ir,ka).call(this))},0)}hostDisconnected(){f(this,lt)?.close(1e3,"lit_host_disconnected"),I(this,lt,void 0)}send(e){f(this,lt)?.send(e)}close(e,t){f(this,lt)?.close(e,t)}get isConnected(){return f(this,lt)?.readyState===WebSocket.OPEN}};$r=new WeakMap,De=new WeakMap,lt=new WeakMap,Ir=new WeakSet,ka=function(){let e=new WebSocket(f(this,De).url());return f(this,De).onClose&&(e.onclose=f(this,De).onClose),f(this,De).onOpen&&(e.onopen=f(this,De).onOpen),f(this,De).onError&&(e.onerror=f(this,De).onError),f(this,De).onMessage&&(e.onmessage=f(this,De).onMessage),e};var ld="664df22d-d461-42d6-801e-f70247e2cd7c",me,ye,tt,Pi,Ri,xe,ii,ud,cd,dd,pd,ss=class{constructor(e,t){y(this,xe);y(this,me);y(this,ye);y(this,tt);T(this,"isStreaming",!1);T(this,"typingIndicator");T(this,"ranOutOfCredits",!1);T(this,"messages",[]);T(this,"conversationId","");y(this,Pi,0);y(this,Ri);T(this,"isLiveMode",!1);I(this,me,e),I(this,ye,t),I(this,tt,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:r,role:n="user",expectStreaming:s=!1}={}){return x(this,xe,ii).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:r},{expectStreaming:s})}sendUserCancel(){return x(this,xe,ii).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return x(this,xe,ii).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return x(this,xe,ii).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){x(this,xe,ii).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,tt).close(1e3,"closed by user")}retry(){clearTimeout(f(this,Ri)),I(this,Ri,setTimeout(()=>{f(this,ye).onReconnect?.(),I(this,tt,this.initWS())},1e3*f(this,Pi))),Yu(this,Pi)._++}initWS(){return new ns(f(this,me),{url:()=>f(this,ye).url(this.conversationId,{}),onOpen:e=>x(this,xe,ud).call(this,e),onMessage:e=>x(this,xe,cd).call(this,JSON.parse(e.data)),onError:e=>x(this,xe,dd).call(this,e),onClose:e=>x(this,xe,pd).call(this,e)})}hostConnected(){this.conversationId=f(this,ye).restoreConversationState?.()?.conversationId||"",this.messages=f(this,ye).restoreConversationState?.()?.messages||[]}reset(){x(this,xe,ii).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,me).requestUpdate()}hostDisconnected(){clearTimeout(f(this,Ri))}reconnectSocket(){f(this,tt).close(1e3,"destroy"),I(this,tt,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};me=new WeakMap,ye=new WeakMap,tt=new WeakMap,Pi=new WeakMap,Ri=new WeakMap,xe=new WeakSet,ii=function(e,{expectStreaming:t=!1}={}){return f(this,tt).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,me).requestUpdate()),f(this,tt).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},ud=function(e){I(this,Pi,0)},cd=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,me).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,me).requestUpdate();else throw new Error(`Message with id ${e.message.id} not found`);break}case"APPEND_MESSAGE":{let t=this.messages.find(r=>r.id===e.message.id);if(t){let{delta:r,position:n,content_type:s}=e.message;s==="text"?t.content=t.content.slice(0,Number(n))+r:t.content_html=t.content_html?t.content_html.slice(0,Number(n))+r:r,f(this,ye).onMessageAppend?.(e),f(this,me).requestUpdate()}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,me).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,me).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,me).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,me).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,me).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===ld)||this.messages.push({id:ld,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,me).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,me).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},dd=function(e){console.error("onError",e),f(this,ye).onError?.(e)},pd=function(e){f(this,me).isConnected&&!f(this,tt).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,me).requestUpdate(),f(this,ye).onClose?.()};var Ar,Mi,Rt,ri,as,hd,os=class{constructor(e,t,{timeoutMs:r=2e3}={}){y(this,as);y(this,Ar);y(this,Mi);y(this,Rt);y(this,ri,!1);T(this,"timeoutMs");I(this,Ar,e),I(this,Mi,t),this.timeoutMs=r,e.addController(this)}get isTyping(){return f(this,ri)}hostDisconnected(){clearTimeout(f(this,Rt)),I(this,Rt,void 0)}onInput(e){if(f(this,Ar).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,Rt)),I(this,Rt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,ri)||x(this,as,hd).call(this)}}typingStopped(){clearTimeout(f(this,Rt)),I(this,ri,!1),f(this,Mi).typingStopped()}};Ar=new WeakMap,Mi=new WeakMap,Rt=new WeakMap,ri=new WeakMap,as=new WeakSet,hd=function(){I(this,ri,!0),f(this,Mi).typingStarted()};function fd(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 gd(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 Tr=class extends Ci{constructor(e){if(super(e),this.it=j,e.type!==Kn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===j||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:[]}}};Tr.directiveName="unsafeHTML",Tr.resultType=1;var md=Qn(Tr);var Wg=!0,Ea="Invariant failed";function vd(i,e){if(!i){if(Wg)throw new Error(Ea);var t=typeof e=="function"?e():e,r=t?"".concat(Ea,": ").concat(t):Ea;throw new Error(r)}}var Sa;function Ca(i){return{lang:i?.lang??Sa?.lang,message:i?.message,abortEarly:i?.abortEarly??Sa?.abortEarly,abortPipeEarly:i?.abortPipeEarly??Sa?.abortPipeEarly}}var Gg;function Jg(i){return Gg?.get(i)}var Xg;function Zg(i){return Xg?.get(i)}var Yg;function Kg(i,e){return Yg?.get(i)?.get(e)}function yd(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??yd(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??Kg(i.reference,a.lang)??(c?Zg(a.lang):null)??r.message??Jg(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 it(i){return{version:1,vendor:"valibot",validate(e){return i["~run"]({value:e},Ca())}}}function Qg(i,e){return Object.hasOwn(i,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function bd(i,e){let t=[...new Set(i)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var em=class extends Error{constructor(e){super(e[0].message);T(this,"issues");this.name="ValiError",this.issues=e}};function $a(i,e){return{kind:"validation",type:"max_length",reference:$a,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 Ia(i,e){return{kind:"validation",type:"min_length",reference:Ia,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 tm(i,e,t){return typeof i.default=="function"?i.default(e,t):i.default}function Aa(i,e){return{kind:"schema",type:"array",reference:Aa,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 Je(this,"type",t,r);return t}}}function Ta(i){return{kind:"schema",type:"boolean",reference:Ta,expects:"boolean",async:!1,message:i,get"~standard"(){return it(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:Je(this,"type",e,t),e}}}function Pa(i){return{kind:"schema",type:"null",reference:Pa,expects:"null",async:!1,message:i,get"~standard"(){return it(this)},"~run"(e,t){return e.value===null?e.typed=!0:Je(this,"type",e,t),e}}}function ls(i){return{kind:"schema",type:"number",reference:ls,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:Je(this,"type",e,t),e}}}function us(i,e){return{kind:"schema",type:"object",reference:us,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 Je(this,"type",t,r);return t}}}function Pr(i,e){return{kind:"schema",type:"optional",reference:Pr,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=tm(this,t,r)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,r)}}}function Ra(i,e){return{kind:"schema",type:"picklist",reference:Ra,expects:bd(i.map(yd),"|"),async:!1,options:i,message:e,get"~standard"(){return it(this)},"~run"(t,r){return this.options.includes(t.value)?t.typed=!0:Je(this,"type",t,r),t}}}function Ma(i,e,t){return{kind:"schema",type:"record",reference:Ma,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(Qg(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 _t(i){return{kind:"schema",type:"string",reference:_t,expects:"string",async:!1,message:i,get"~standard"(){return it(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:Je(this,"type",e,t),e}}}function _d(i){let e;if(i)for(let t of i)e?e.push(...t.issues):e=t.issues;return e}function Oa(i,e){return{kind:"schema",type:"union",reference:Oa,expects:bd(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];Je(this,"type",t,r,{issues:_d(s)}),t.typed=!0}else{if(o?.length===1)return o[0];Je(this,"type",t,r,{issues:_d(o)})}return t}}}function wd(i,e,t){let r=i["~run"]({value:e},Ca(t));if(r.issues)throw new em(r.issues);return r.value}function xd(...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 Fa(i,e,t){let r=i["~run"]({value:e},Ca(t));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var rm="\xB7 \xB7 \xB7",nm=us({conversationId:Pr(_t()),messages:Pr(Aa(us({id:_t(),timestamp:ls(),role:Ra(["user","assistant","support"]),content:_t(),content_html:Pr(_t())})))}),sm=Ma(_t(),Oa([_t(),ls(),Ta(),Pa()])),om=xd(_t(),Ia(1),$a(1e3)),Oi,Fi,X,Da,cs,Mr,ni,ne,Or,kd,Ed,Sd,Cd,$d,Id,Ad,Td,ds,ps=class ps extends G(H){constructor(){super();y(this,X);y(this,Oi);y(this,Fi);y(this,Mr,new os(this,{typingStarted:()=>f(this,ne).sendUserTypingStart(),typingStopped:()=>f(this,ne).sendUserTypingStop()}));y(this,ni,!1);y(this,ne,new ss(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=>{I(this,ni,!1),t.role==="user"&&f(this,X,ds)?.scrollTo(0,f(this,X,ds).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageAppend:t=>{let r=f(this,X,ds);if(!r)return;let n=f(this,ne).lastMsg;!n||n.role!=="assistant"||requestAnimationFrame(()=>{let s=r.querySelector(`[data-id="${n.id}"]`);if(!s)return;let o=s.offsetHeight,l=r.getClientRects()[0].height-70;o>l&&!f(this,ni)&&(r.scrollTop=s.offsetTop-80)})},onMessageDone:(t,r)=>{I(this,ni,!1),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,X,cs))},onConnect:t=>{},persistConversationState:(t,r)=>{localStorage.setItem(f(this,X,cs),JSON.stringify({conversationId:t,messages:r}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,X,cs))||"{}"),r=wd(nm,t);return{conversationId:r.conversationId||"",messages:r.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));y(this,Or,"single");this.widgetId="",this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get conversationId(){return f(this,ne).conversationId}get messages(){return f(this,ne).messages}firstUpdated(){x(this,X,Da).call(this)}updated(){x(this,X,Da).call(this)}render(){vd(this.config,"config is required");let t=fd(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 A`
|
|
270
|
+
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Ca);function op(r,e){let t=r instanceof URL?r:new URL(r);if(e)for(let[i,n]of e)t.searchParams.set(i,n);return t}var zg={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},$a=Si({preflight:{...zg},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},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"}}}},presets:[Yn(),Xn(),Zn(),Qn()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Ai=r=>es($a)(r);var Ti=r=>r??j;var Pi=class extends Ai(H){constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let e=this.product?.url,t=this.searchParams;try{if(e&&t)return op(e,t).href}catch{}return e}render(){let{name:e,description:t,price:i,url:n}=this.product||{},s=n?this.imagesByProductUrl?.[n]:void 0;return E`
|
|
271
|
+
<a
|
|
272
|
+
href="${Ti(this.trackedProductUrl)}"
|
|
273
|
+
title="${Ti(e)}"
|
|
274
|
+
class="group flex w-full max-w-md cursor-pointer gap-2 overflow-hidden rounded-lg font-sans text-base"
|
|
275
|
+
target="${this.linksNewTab?"_blank":"_self"}"
|
|
276
|
+
?disabled="${this.streaming}">
|
|
277
|
+
${this.streaming?E`
|
|
278
|
+
<!-- shimmer -->
|
|
279
|
+
<div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200"></div>
|
|
280
|
+
`:s?E`
|
|
281
|
+
<div class="flex h-[70px] w-[70px] flex-shrink-0 overflow-hidden rounded-lg bg-gray-200">
|
|
282
|
+
<picture>
|
|
283
|
+
<!-- Cloudflare Images: resize the source image -->
|
|
284
|
+
<source
|
|
285
|
+
srcset="
|
|
286
|
+
https://molin.foo/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=1/${s} 1x,
|
|
287
|
+
https://molin.foo/cdn-cgi/image/w=70,fit=crop,format=auto,quality=75,dpr=2/${s} 2x
|
|
288
|
+
" />
|
|
289
|
+
<img alt="" class="h-full w-auto flex-shrink-0 object-cover" loading="lazy" />
|
|
290
|
+
</picture>
|
|
291
|
+
</div>
|
|
292
|
+
`:E`
|
|
293
|
+
<!-- missing image url -->
|
|
294
|
+
<div class="flex h-[70px] w-[70px] flex-shrink-0 overflow-hidden rounded-lg bg-gray-200">
|
|
295
|
+
<div class="flex h-full w-full items-center justify-center">
|
|
296
|
+
<!-- shopping bag icon -->
|
|
297
|
+
<svg class="h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
298
|
+
<path
|
|
299
|
+
stroke-linecap="round"
|
|
300
|
+
stroke-linejoin="round"
|
|
301
|
+
d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
|
|
302
|
+
</svg>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
`}
|
|
306
|
+
|
|
307
|
+
<div class="flex flex-1 flex-col justify-between">
|
|
308
|
+
<div>
|
|
309
|
+
${e||!this.streaming?E`<h3 class="line-clamp-1 text-[14px] font-medium leading-[20px] group-hover:underline">${e}</h3>`:E`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
|
|
310
|
+
|
|
311
|
+
<!-- no margin here -->
|
|
312
|
+
|
|
313
|
+
${t||!this.streaming?E`<p class="line-clamp-2 text-[12px] leading-[16px] text-gray-500">${t}</p>`:E`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
<!-- flexbox filled space -->
|
|
317
|
+
|
|
318
|
+
${i||!this.streaming?E`<span class="text-[12px] leading-[16px] text-gray-900">${i}</span>`:E`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
|
|
319
|
+
</div>
|
|
320
|
+
</a>
|
|
321
|
+
`}};T(Pi,"styles",tt`
|
|
322
|
+
:host {
|
|
323
|
+
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
324
|
+
}
|
|
325
|
+
`),T(Pi,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Pi);function ls(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}var us=function(){},Rr=function(){};var Ri=(r,e,t)=>Math.min(Math.max(t,r),e);var Ia=.001,Vg=.01,ap=10,Wg=.05,Gg=1;function lp({duration:r=800,bounce:e=.25,velocity:t=0,mass:i=1}){let n,s;us(r<=ap*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Ri(Wg,Gg,o),r=Ri(Vg,ap,r/1e3),o<1?(n=c=>{let p=c*o,u=p*r,d=p-t,h=cs(c,o),g=Math.exp(-u);return Ia-d/h*g},s=c=>{let u=c*o*r,d=u*t+t,h=Math.pow(o,2)*Math.pow(c,2)*r,g=Math.exp(-u),m=cs(Math.pow(c,2),o);return(-n(c)+Ia>0?-1:1)*((d-h)*g)/m}):(n=c=>{let p=Math.exp(-c*r),u=(c-t)*r+1;return-Ia+p*u},s=c=>{let p=Math.exp(-c*r),u=(t-c)*(r*r);return p*u});let l=5/r,a=Xg(n,s,l);if(r=r*1e3,isNaN(a))return{stiffness:100,damping:10,duration:r};{let c=Math.pow(a,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:r}}}var Jg=12;function Xg(r,e,t){let i=t;for(let n=1;n<Jg;n++)i=i-r(i)/e(i);return i}function cs(r,e){return r*Math.sqrt(1-e*e)}var Zg=["duration","bounce"],Kg=["stiffness","damping","mass"];function up(r,e){return e.some(t=>r[t]!==void 0)}function Yg(r){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},r);if(!up(r,Kg)&&up(r,Zg)){let t=lp(r);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function ps(r){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:n}=r,s=ls(r,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:l,damping:a,mass:c,velocity:p,duration:u,isResolvedFromDuration:d}=Yg(s),h=cp,g=cp;function m(){let _=p?-(p/1e3):0,w=t-e,y=a/(2*Math.sqrt(l*c)),x=Math.sqrt(l/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(t-e)/100,.4)),y<1){let S=cs(x,y);h=M=>{let B=Math.exp(-y*x*M);return t-B*((_+y*x*w)/S*Math.sin(S*M)+w*Math.cos(S*M))},g=M=>{let B=Math.exp(-y*x*M);return y*x*B*(Math.sin(S*M)*(_+y*x*w)/S+w*Math.cos(S*M))-B*(Math.cos(S*M)*(_+y*x*w)-S*w*Math.sin(S*M))}}else if(y===1)h=S=>t-Math.exp(-x*S)*(w+(_+x*w)*S);else{let S=x*Math.sqrt(y*y-1);h=M=>{let B=Math.exp(-y*x*M),U=Math.min(S*M,300);return t-B*((_+y*x*w)*Math.sinh(U)+S*w*Math.cosh(U))/S}}}return m(),{next:_=>{let w=h(_);if(d)o.done=_>=u;else{let y=g(_)*1e3,x=Math.abs(y)<=i,S=Math.abs(t-w)<=n;o.done=x&&S}return o.value=o.done?t:w,o},flipTarget:()=>{p=-p,[e,t]=[t,e],m()}}}ps.needsInterpolation=(r,e)=>typeof r=="string"||typeof e=="string";var cp=r=>0;var Aa=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var Or=(r,e,t)=>-t*r+t*e+r;var ds=(r,e)=>t=>Math.max(Math.min(t,e),r),Ot=r=>r%1?Number(r.toFixed(5)):r,Mr=/(-)?([\d]*\.?[\d])+/g,hs=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,pp=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function yt(r){return typeof r=="string"}var Fr={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},fs=Object.assign(Object.assign({},Fr),{transform:ds(0,1)}),t1=Object.assign(Object.assign({},Fr),{default:1});var Oi=r=>({test:e=>yt(e)&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),n1=Oi("deg"),Lr=Oi("%"),s1=Oi("px"),o1=Oi("vh"),a1=Oi("vw"),l1=Object.assign(Object.assign({},Lr),{parse:r=>Lr.parse(r)/100,transform:r=>Lr.transform(r*100)});var Dr=(r,e)=>t=>!!(yt(t)&&pp.test(t)&&t.startsWith(r)||e&&Object.prototype.hasOwnProperty.call(t,e)),gs=(r,e,t)=>i=>{if(!yt(i))return i;let[n,s,o,l]=i.match(Mr);return{[r]:parseFloat(n),[e]:parseFloat(s),[t]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}};var ut={test:Dr("hsl","hue"),parse:gs("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Lr.transform(Ot(e))+", "+Lr.transform(Ot(t))+", "+Ot(fs.transform(i))+")"};var Qg=ds(0,255),ms=Object.assign(Object.assign({},Fr),{transform:r=>Math.round(Qg(r))}),Ze={test:Dr("rgb","red"),parse:gs("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+ms.transform(r)+", "+ms.transform(e)+", "+ms.transform(t)+", "+Ot(fs.transform(i))+")"};function em(r){let e="",t="",i="",n="";return r.length>5?(e=r.substr(1,2),t=r.substr(3,2),i=r.substr(5,2),n=r.substr(7,2)):(e=r.substr(1,1),t=r.substr(2,1),i=r.substr(3,1),n=r.substr(4,1),e+=e,t+=t,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var jr={test:Dr("#"),parse:em,transform:Ze.transform};var Mt={test:r=>Ze.test(r)||jr.test(r)||ut.test(r),parse:r=>Ze.test(r)?Ze.parse(r):ut.test(r)?ut.parse(r):jr.parse(r),transform:r=>yt(r)?r:r.hasOwnProperty("red")?Ze.transform(r):ut.transform(r)};var dp="${c}",hp="${n}";function tm(r){var e,t,i,n;return isNaN(r)&&yt(r)&&((t=(e=r.match(Mr))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((n=(i=r.match(hs))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function fp(r){typeof r=="number"&&(r=`${r}`);let e=[],t=0,i=r.match(hs);i&&(t=i.length,r=r.replace(hs,dp),e.push(...i.map(Mt.parse)));let n=r.match(Mr);return n&&(r=r.replace(Mr,hp),e.push(...n.map(Fr.parse))),{values:e,numColors:t,tokenised:r}}function gp(r){return fp(r).values}function mp(r){let{values:e,numColors:t,tokenised:i}=fp(r),n=e.length;return s=>{let o=i;for(let l=0;l<n;l++)o=o.replace(l<t?dp:hp,l<t?Mt.transform(s[l]):Ot(s[l]));return o}}var rm=r=>typeof r=="number"?0:r;function im(r){let e=gp(r);return mp(r)(e.map(rm))}var vs={test:tm,parse:gp,createTransformer:mp,getAnimatableNone:im};function Ta(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function Pa({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let n=0,s=0,o=0;if(!e)n=s=o=t;else{let l=t<.5?t*(1+e):t+e-t*e,a=2*t-l;n=Ta(a,l,r+1/3),s=Ta(a,l,r),o=Ta(a,l,r-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var nm=(r,e,t)=>{let i=r*r,n=e*e;return Math.sqrt(Math.max(0,t*(n-i)+i))},sm=[jr,Ze,ut],vp=r=>sm.find(e=>e.test(r)),yp=r=>`'${r}' is not an animatable color. Use the equivalent color code instead.`,ys=(r,e)=>{let t=vp(r),i=vp(e);Rr(!!t,yp(r)),Rr(!!i,yp(e));let n=t.parse(r),s=i.parse(e);t===ut&&(n=Pa(n),t=Ze),i===ut&&(s=Pa(s),i=Ze);let o=Object.assign({},n);return l=>{for(let a in o)a!=="alpha"&&(o[a]=nm(n[a],s[a],l));return o.alpha=Or(n.alpha,s.alpha,l),t.transform(o)}};var _p=r=>typeof r=="number";var om=(r,e)=>t=>e(r(t)),_s=(...r)=>r.reduce(om);function wp(r,e){return _p(r)?t=>Or(r,e,t):Mt.test(r)?ys(r,e):Oa(r,e)}var Ra=(r,e)=>{let t=[...r],i=t.length,n=r.map((s,o)=>wp(s,e[o]));return s=>{for(let o=0;o<i;o++)t[o]=n[o](s);return t}},xp=(r,e)=>{let t=Object.assign(Object.assign({},r),e),i={};for(let n in t)r[n]!==void 0&&e[n]!==void 0&&(i[n]=wp(r[n],e[n]));return n=>{for(let s in i)t[s]=i[s](n);return t}};function bp(r){let e=vs.parse(r),t=e.length,i=0,n=0,s=0;for(let o=0;o<t;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Oa=(r,e)=>{let t=vs.createTransformer(e),i=bp(r),n=bp(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?_s(Ra(i.parsed,n.parsed),t):(us(!0,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:r}`)};var am=(r,e)=>t=>Or(r,e,t);function lm(r){if(typeof r=="number")return am;if(typeof r=="string")return Mt.test(r)?ys:Oa;if(Array.isArray(r))return Ra;if(typeof r=="object")return xp}function um(r,e,t){let i=[],n=t||lm(r[0]),s=r.length-1;for(let o=0;o<s;o++){let l=n(r[o],r[o+1]);if(e){let a=Array.isArray(e)?e[o]:e;l=_s(a,l)}i.push(l)}return i}function cm([r,e],[t]){return i=>t(Aa(r,e,i))}function pm(r,e){let t=r.length,i=t-1;return n=>{let s=0,o=!1;if(n<=r[0]?o=!0:n>=r[i]&&(s=i-1,o=!0),!o){let a=1;for(;a<t&&!(r[a]>n||a===i);a++);s=a-1}let l=Aa(r[s],r[s+1],n);return e[s](l)}}function bs(r,e,{clamp:t=!0,ease:i,mixer:n}={}){let s=r.length;Rr(s===e.length,"Both input and output ranges must be the same length"),Rr(!i||!Array.isArray(i)||i.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),r[0]>r[s-1]&&(r=[].concat(r),e=[].concat(e),r.reverse(),e.reverse());let o=um(e,i,n),l=s===2?cm(r,o):pm(r,o);return t?a=>l(Ri(r[0],r[s-1],a)):l}var Mi=r=>e=>1-r(1-e),ws=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2,kp=r=>e=>Math.pow(e,r),Ma=r=>e=>e*e*((r+1)*e-r),Sp=r=>{let e=Ma(r);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))};var Ep=1.525,dm=4/11,hm=8/11,fm=9/10;var Cp=kp(2),pb=Mi(Cp),$p=ws(Cp),gm=r=>1-Math.sin(Math.acos(r)),mm=Mi(gm),db=ws(mm),Ip=Ma(Ep),hb=Mi(Ip),fb=ws(Ip),gb=Sp(Ep),vm=4356/361,ym=35442/1805,_m=16061/1805,bm=r=>{if(r===1||r===0)return r;let e=r*r;return r<dm?7.5625*e:r<hm?9.075*e-9.9*r+3.4:r<fm?vm*e-ym*r+_m:10.8*r*r-20.52*r+10.72},mb=Mi(bm);function wm(r,e){return r.map(()=>e||$p).splice(0,r.length-1)}function xm(r){let e=r.length;return r.map((t,i)=>i!==0?i/(e-1):0)}function km(r,e){return r.map(t=>t*e)}function Fi({from:r=0,to:e=1,ease:t,offset:i,duration:n=300}){let s={done:!1,value:r},o=Array.isArray(e)?e:[r,e],l=km(i&&i.length===o.length?i:xm(o),n);function a(){return bs(l,o,{ease:Array.isArray(t)?t:wm(o,t)})}let c=a();return{next:p=>(s.value=c(p),s.done=p>=n,s),flipTarget:()=>{o.reverse(),c=a()}}}function Ap({velocity:r=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},l=t*r,a=e+l,c=s===void 0?a:s(a);return c!==a&&(l=c-e),{next:p=>{let u=-l*Math.exp(-p/i);return o.done=!(u>n||u<-n),o.value=o.done?c:c+u,o},flipTarget:()=>{}}}var Tp={keyframes:Fi,spring:ps,decay:Ap};function Pp(r){if(Array.isArray(r.to))return Fi;if(Tp[r.type])return Tp[r.type];let e=new Set(Object.keys(r));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Fi:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ps:Fi}var Fa=16.666666666666668,Sm=typeof performance<"u"?()=>performance.now():()=>Date.now(),La=typeof window<"u"?r=>window.requestAnimationFrame(r):r=>setTimeout(()=>r(Sm()),Fa);function Rp(r){let e=[],t=[],i=0,n=!1,s=!1,o=new WeakSet,l={schedule:(a,c=!1,p=!1)=>{let u=p&&n,d=u?e:t;return c&&o.add(a),d.indexOf(a)===-1&&(d.push(a),u&&n&&(i=e.length)),a},cancel:a=>{let c=t.indexOf(a);c!==-1&&t.splice(c,1),o.delete(a)},process:a=>{if(n){s=!0;return}if(n=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c<i;c++){let p=e[c];p(a),o.has(p)&&(l.schedule(p),r())}n=!1,s&&(s=!1,l.process(a))}};return l}var Em=40,Da=!0,Di=!1,ja=!1,Li={delta:0,timestamp:0},ji=["read","update","preRender","render","postRender"],xs=ji.reduce((r,e)=>(r[e]=Rp(()=>Di=!0),r),{}),Cm=ji.reduce((r,e)=>{let t=xs[e];return r[e]=(i,n=!1,s=!1)=>(Di||Im(),t.schedule(i,n,s)),r},{}),Op=ji.reduce((r,e)=>(r[e]=xs[e].cancel,r),{}),Tb=ji.reduce((r,e)=>(r[e]=()=>xs[e].process(Li),r),{}),$m=r=>xs[r].process(Li),Mp=r=>{Di=!1,Li.delta=Da?Fa:Math.max(Math.min(r-Li.timestamp,Em),1),Li.timestamp=r,ja=!0,ji.forEach($m),ja=!1,Di&&(Da=!1,La(Mp))},Im=()=>{Di=!0,Da=!0,ja||La(Mp)};var Fp=Cm;function Na(r,e,t=0){return r-e-t}function Lp(r,e,t=0,i=!0){return i?Na(e+-r,e,t):e-(r-e)+t}function Dp(r,e,t,i){return i?r>=e+t:r<=-t}var Am=r=>{let e=({delta:t})=>r(t);return{start:()=>Fp.update(e,!0),stop:()=>Op.update(e)}};function Ua(r){var e,t,{from:i,autoplay:n=!0,driver:s=Am,elapsed:o=0,repeat:l=0,repeatType:a="loop",repeatDelay:c=0,onPlay:p,onStop:u,onComplete:d,onRepeat:h,onUpdate:g}=r,m=ls(r,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:_}=m,w,y=0,x=m.duration,S,M=!1,B=!0,U,R=Pp(m);!((t=(e=R).needsInterpolation)===null||t===void 0)&&t.call(e,i,_)&&(U=bs([0,100],[i,_],{clamp:!1}),i=0,_=100);let q=R(Object.assign(Object.assign({},m),{from:i,to:_}));function V(){y++,a==="reverse"?(B=y%2===0,o=Lp(o,x,c,B)):(o=Na(o,x,c),a==="mirror"&&q.flipTarget()),M=!1,h&&h()}function xe(){w.stop(),d&&d()}function ce(J){if(B||(J=-J),o+=J,!M){let Z=q.next(Math.max(0,o));S=Z.value,U&&(S=U(S)),M=B?Z.done:o<=0}g?.(S),M&&(y===0&&(x??(x=o)),y<l?Dp(o,x,c,B)&&V():xe())}function Le(){p?.(),w=s(ce),w.start()}return n&&Le(),{stop:()=>{u?.(),w.stop()}}}var te,jp,ks,Np,Ss,Up,qp,Bp,Es,Cs=class Cs extends Ai(H){constructor(){super();b(this,te);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(t){t.has("product")&&C(this,te,jp).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return E`
|
|
326
|
+
<div class="my-2 w-full rounded-3xl border bg-white p-4">
|
|
327
|
+
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
328
|
+
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
|
|
329
|
+
</div>
|
|
330
|
+
<div class="mb-2 flex items-end justify-between">
|
|
331
|
+
<div>
|
|
332
|
+
<div class="mb-1 h-4 w-20 animate-pulse rounded bg-gray-200"></div>
|
|
333
|
+
<div class="h-6 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
334
|
+
</div>
|
|
335
|
+
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
336
|
+
</div>
|
|
337
|
+
<div class="mb-4 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>
|
|
338
|
+
<div class="my-4 border-t border-gray-200"></div>
|
|
339
|
+
<div class="flex items-end justify-between gap-3">
|
|
340
|
+
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
341
|
+
<div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
`;if(this.product.layout==="horizontal")return E` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:t,description:i,price:n,category:s}=this.product;return E`
|
|
345
|
+
<div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
|
|
346
|
+
<div class="pointer-events-auto mx-auto mb-4">
|
|
347
|
+
<div class="group relative overflow-hidden rounded-2xl">
|
|
348
|
+
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
349
|
+
${this.images.length>0?Rt(this.images,o=>o,(o,l)=>E`
|
|
350
|
+
<!-- Cloudflare Images: resize the source image -->
|
|
351
|
+
<img
|
|
352
|
+
src="https://molin.foo/cdn-cgi/image/w=100,fit=scale-down,format=auto,quality=75,dpr=1/${o}"
|
|
353
|
+
srcset="
|
|
354
|
+
https://molin.foo/cdn-cgi/image/w=100,fit=scale-down,format=auto,quality=75,dpr=1/${o} 1x,
|
|
355
|
+
https://molin.foo/cdn-cgi/image/w=100,fit=scale-down,format=auto,quality=75,dpr=2/${o} 2x
|
|
356
|
+
"
|
|
357
|
+
alt="image ${l+1}: ${t}"
|
|
358
|
+
class="h-auto w-full flex-shrink-0 object-scale-down"
|
|
359
|
+
loading="lazy" />
|
|
360
|
+
`):E`
|
|
361
|
+
<div class="h-full w-full flex-shrink-0 object-scale-down"></div>
|
|
362
|
+
<svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
363
|
+
<rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
|
|
364
|
+
<g transform="matrix(0.6458070278167725, 0, 0, 0.5434090495109558, -19.74715805053711, -14.242161750793464)">
|
|
365
|
+
<rect x="92" y="135.169" width="32" height="26.831" rx="2" stroke-width="4" style="isolation: isolate; stroke: rgb(187, 187, 187); fill: none;" />
|
|
366
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M 109.142 156.857 L 104 149 L 94 160 L 108 160 L 114 160 L 122 160 L 115 153 L 109.142 156.857 Z" fill="#BBBBBB" style="" />
|
|
367
|
+
<circle cx="110" cy="146" r="3" fill="#BBBBBB" style="" />
|
|
368
|
+
</g>
|
|
369
|
+
</svg>
|
|
370
|
+
`}
|
|
371
|
+
</div>
|
|
372
|
+
${$i(this.images.length>1,()=>E`
|
|
373
|
+
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
374
|
+
<button
|
|
375
|
+
@click="${C(this,te,qp)}"
|
|
376
|
+
class="absolute left-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
|
|
377
|
+
<hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
|
|
378
|
+
</button>
|
|
379
|
+
<button
|
|
380
|
+
@click="${C(this,te,Up)}"
|
|
381
|
+
class="absolute right-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
|
|
382
|
+
<hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
|
|
383
|
+
</button>
|
|
384
|
+
</div>
|
|
385
|
+
`)}
|
|
386
|
+
${$i(this.images?.length>1,()=>E`
|
|
387
|
+
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
388
|
+
${this.images.map((o,l)=>E`
|
|
389
|
+
<button
|
|
390
|
+
@click="${()=>C(this,te,Bp).call(this,l)}"
|
|
391
|
+
class="${l===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} h-1.5 w-1.5 rounded-full bg-white transition-all hover:bg-opacity-80"></button>
|
|
392
|
+
`)}
|
|
393
|
+
</div>
|
|
394
|
+
`)}
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
<div @click="${C(this,te,ks)}" class="cursor-pointer">
|
|
398
|
+
${s?E`<a @click="${C(this,te,ks)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
|
|
399
|
+
|
|
400
|
+
<h3
|
|
401
|
+
@click="${C(this,te,ks)}"
|
|
402
|
+
class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
|
|
403
|
+
${t||E`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
404
|
+
</h3>
|
|
405
|
+
${i?E`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${i}</p>`:E`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
406
|
+
<span class="text-lg font-bold"> ${n||E`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
|
|
407
|
+
|
|
408
|
+
<!-- <div class="my-4 border-t border-gray-200"></div> -->
|
|
409
|
+
|
|
410
|
+
<!-- <button
|
|
411
|
+
@click="${C(this,te,Np)}"
|
|
412
|
+
?disabled="${!this._isValidUrl}"
|
|
413
|
+
class="${this._isValidUrl?"bg-gray-900 hover:bg-gray-800":"bg-gray-900/80 cursor-default"} w-full rounded-xl px-4 py-1.5 text-sm text-white">
|
|
414
|
+
${this.labels.addToCart}
|
|
415
|
+
</button> -->
|
|
416
|
+
</div>
|
|
417
|
+
</div>
|
|
418
|
+
`}};te=new WeakSet,jp=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let t=new URL(this.product.url);this._isValidUrl=t.protocol==="http:"||t.protocol==="https:"}catch{this._isValidUrl=!1}},ks=function(t){t.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Np=function(t){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new Cs.AddToCartEvent(this.product)))},Ss=function(t,i){f(this,te,Es)&&Ua({from:t,to:i,duration:300,onUpdate:n=>{f(this,te,Es)&&(f(this,te,Es).style.transform=`translateX(${n}%)`)}})},Up=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,i=(t+1)%this.product.images.length,n=-(t*100),s=-(i*100);C(this,te,Ss).call(this,n,s),this._currentImageIndex=i},qp=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,i=(t-1+this.product.images.length)%this.product.images.length,n=-(t*100),s=-(i*100);C(this,te,Ss).call(this,n,s),this._currentImageIndex=i},Bp=function(t){if(!this.product?.images?.length)return;let i=this._currentImageIndex,n=Math.max(0,Math.min(t,this.product.images.length-1)),s=-(i*100),o=-(n*100);C(this,te,Ss).call(this,s,o),this._currentImageIndex=n},Es=function(){return this.renderRoot.querySelector(".image-slider")},T(Cs,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Ni=Cs,qa;Ni.AddToCartEvent=(qa=class extends CustomEvent{constructor(e,t={}){super(Ni.AddToCartEvent.type,{detail:{product:e},...t})}},T(qa,"type","mw-product-card:add-to-cart"),qa);customElements.get("mw-product-card")||customElements.define("mw-product-card",Ni);var Ui,je,ct,qi,Ba,$s=class{constructor(e,t){b(this,qi);b(this,Ui);b(this,je);b(this,ct);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");A(this,Ui,e),f(this,Ui).addController(this),A(this,je,t)}connect(e){A(this,je,e),A(this,ct,C(this,qi,Ba).call(this))}hostConnected(){setTimeout(()=>{A(this,ct,C(this,qi,Ba).call(this))},0)}hostDisconnected(){f(this,ct)?.close(1e3,"lit_host_disconnected"),A(this,ct,void 0)}send(e){f(this,ct)?.send(e)}close(e,t){f(this,ct)?.close(e,t)}get isConnected(){return f(this,ct)?.readyState===WebSocket.OPEN}};Ui=new WeakMap,je=new WeakMap,ct=new WeakMap,qi=new WeakSet,Ba=function(){let e=new WebSocket(f(this,je).url());return f(this,je).onClose&&(e.onclose=f(this,je).onClose),f(this,je).onOpen&&(e.onopen=f(this,je).onOpen),f(this,je).onError&&(e.onerror=f(this,je).onError),f(this,je).onMessage&&(e.onmessage=f(this,je).onMessage),e};var Hp="664df22d-d461-42d6-801e-f70247e2cd7c",ve,be,nt,Nr,Ur,ke,ir,zp,Vp,Wp,Gp,Is=class{constructor(e,t){b(this,ke);b(this,ve);b(this,be);b(this,nt);T(this,"isStreaming",!1);T(this,"typingIndicator");T(this,"ranOutOfCredits",!1);T(this,"messages",[]);T(this,"conversationId","");b(this,Nr,0);b(this,Ur);T(this,"isLiveMode",!1);A(this,ve,e),A(this,be,t),A(this,nt,this.initWS()),e.addController(this)}sendUserInput(e,{xUserData:t,xPromptExt:i,role:n="user",expectStreaming:s=!1}={}){return C(this,ke,ir).call(this,{type:"USER_INPUT",value:e,role:n,xUserData:t,xPromptExt:i},{expectStreaming:s})}sendUserCancel(){return C(this,ke,ir).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return C(this,ke,ir).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return C(this,ke,ir).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){C(this,ke,ir).call(this,{type:"RELOAD_CONFIG"})}close(){f(this,nt).close(1e3,"closed by user")}retry(){clearTimeout(f(this,Ur)),A(this,Ur,setTimeout(()=>{f(this,be).onReconnect?.(),A(this,nt,this.initWS())},1e3*f(this,Nr))),Xu(this,Nr)._++}initWS(){return new $s(f(this,ve),{url:()=>f(this,be).url(this.conversationId,{}),onOpen:e=>C(this,ke,zp).call(this,e),onMessage:e=>C(this,ke,Vp).call(this,JSON.parse(e.data)),onError:e=>C(this,ke,Wp).call(this,e),onClose:e=>C(this,ke,Gp).call(this,e)})}hostConnected(){this.conversationId=f(this,be).restoreConversationState?.()?.conversationId||"",this.messages=f(this,be).restoreConversationState?.()?.messages||[]}reset(){C(this,ke,ir).call(this,{type:"NEW_CHAT"}),f(this,be).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,f(this,ve).requestUpdate()}hostDisconnected(){clearTimeout(f(this,Ur))}reconnectSocket(){f(this,nt).close(1e3,"destroy"),A(this,nt,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};ve=new WeakMap,be=new WeakMap,nt=new WeakMap,Nr=new WeakMap,Ur=new WeakMap,ke=new WeakSet,ir=function(e,{expectStreaming:t=!1}={}){return f(this,nt).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,f(this,ve).requestUpdate()),f(this,nt).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},zp=function(e){A(this,Nr,0)},Vp=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((t,i,n)=>i===n.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,f(this,ve).requestUpdate(),f(this,be).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),f(this,ve).requestUpdate();else throw new Error(`Message with id ${e.message.id} not found`);break}case"APPEND_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t){switch(e.message.content_type){case"text":{let{part:i,delta:n,position:s}=e.message;t.content=t.content.slice(0,s)+n,t.parts||=[],t.parts[i]={text:t.parts[i]&&"text"in t.parts[i]?(t.parts[i].text||"").slice(0,s)+n:n};break}case"html":{let{part:i,delta:n,position:s}=e.message;t.parts||=[],t.parts[i]={html:t.parts[i]&&"html"in t.parts[i]?(t.parts[i].html||"").slice(0,s)+n:n};break}case"data":{let{part:i}=e.message;t.parts||=[],t.parts[i]={tag:e.message.tag,data:t.parts[i]&&"data"in t.parts[i]?Object.assign(t.parts[i].data||{},e.message.data):e.message.data};break}}e.metadata&&(t.metadata=e.metadata),f(this,be).onMessageAppend?.(e),f(this,ve).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),t.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,f(this,ve).requestUpdate(),f(this,be).onMessageDone?.(e,t),f(this,be).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,f(this,ve).requestUpdate();break}case"ERROR":{f(this,be).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,f(this,be).onConnect?.(e.conversationId),f(this,be).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,f(this,ve).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},f(this,ve).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,f(this,ve).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Hp)||this.messages.push({id:Hp,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,f(this,ve).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),f(this,ve).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Wp=function(e){console.error("onError",e),f(this,be).onError?.(e)},Gp=function(e){f(this,ve).isConnected&&!f(this,nt).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,f(this,ve).requestUpdate(),f(this,be).onClose?.()};function Jp(r){return Array.isArray(r)?r:r?[r]:[]}function Xp(r,e){let t=new Map;for(let i of r){let n=e(i);t.has(n)||t.set(n,[]),(t.get(n)||[]).push(i)}return t}var Bi=class extends $r{constructor(e){if(super(e),this.it=j,e.type!==rs.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===j||e==null)return this._t=void 0,this.it=e;if(e===rt)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:[]}}};Bi.directiveName="unsafeHTML",Bi.resultType=1;var Zp=is(Bi);var Ha;function za(r){return{lang:r?.lang??Ha?.lang,message:r?.message,abortEarly:r?.abortEarly??Ha?.abortEarly,abortPipeEarly:r?.abortPipeEarly??Ha?.abortPipeEarly}}var Tm;function Pm(r){return Tm?.get(r)}var Rm;function Om(r){return Rm?.get(r)}var Mm;function Fm(r,e){return Mm?.get(r)?.get(e)}function Yp(r){let e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}function Ke(r,e,t,i,n){let s=n&&"input"in n?n.input:t.value,o=n?.expected??r.expects??null,l=n?.received??Yp(s),a={kind:r.kind,type:r.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:r.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=r.kind==="schema",p=n?.message??r.message??Fm(r.reference,a.lang)??(c?Om(a.lang):null)??i.message??Pm(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 ze(r){return{version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},za())}}}function Lm(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Qp(r,e){let t=[...new Set(r)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Dm=class extends Error{constructor(e){super(e[0].message);T(this,"issues");this.name="ValiError",this.issues=e}};function Va(r,e){return{kind:"validation",type:"max_length",reference:Va,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(t,i){return t.typed&&t.value.length>this.requirement&&Ke(this,"length",t,i,{received:`${t.value.length}`}),t}}}function Wa(r,e){return{kind:"validation",type:"min_length",reference:Wa,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(t,i){return t.typed&&t.value.length<this.requirement&&Ke(this,"length",t,i,{received:`${t.value.length}`}),t}}}function jm(r,e,t){return typeof r.default=="function"?r.default(e,t):r.default}function Ga(){return{kind:"schema",type:"any",reference:Ga,expects:"any",async:!1,get"~standard"(){return ze(this)},"~run"(r){return r.typed=!0,r}}}function qr(r,e){return{kind:"schema",type:"array",reference:qr,expects:"Array",async:!1,item:r,message:e,get"~standard"(){return ze(this)},"~run"(t,i){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},i);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),i.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else Ke(this,"type",t,i);return t}}}function Ja(r){return{kind:"schema",type:"boolean",reference:Ja,expects:"boolean",async:!1,message:r,get"~standard"(){return ze(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:Ke(this,"type",e,t),e}}}function Xa(r){return{kind:"schema",type:"null",reference:Xa,expects:"null",async:!1,message:r,get"~standard"(){return ze(this)},"~run"(e,t){return e.value===null?e.typed=!0:Ke(this,"type",e,t),e}}}function As(r){return{kind:"schema",type:"number",reference:As,expects:"number",async:!1,message:r,get"~standard"(){return ze(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ke(this,"type",e,t),e}}}function _t(r,e){return{kind:"schema",type:"object",reference:_t,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return ze(this)},"~run"(t,i){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},i);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),i.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),(l.value!==void 0||s in n)&&(t.value[s]=l.value)}}else Ke(this,"type",t,i);return t}}}function Br(r,e){return{kind:"schema",type:"optional",reference:Br,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return ze(this)},"~run"(t,i){return t.value===void 0&&(this.default!==void 0&&(t.value=jm(this,t,i)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,i)}}}function Za(r,e){return{kind:"schema",type:"picklist",reference:Za,expects:Qp(r.map(Yp),"|"),async:!1,options:r,message:e,get"~standard"(){return ze(this)},"~run"(t,i){return this.options.includes(t.value)?t.typed=!0:Ke(this,"type",t,i),t}}}function Ts(r,e,t){return{kind:"schema",type:"record",reference:Ts,expects:"Object",async:!1,key:r,value:e,message:t,get"~standard"(){return ze(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(Lm(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],i.issues?.push(u);if(i.issues||(i.issues=a.issues),n.abortEarly){i.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],i.issues?.push(u);if(i.issues||(i.issues=c.issues),n.abortEarly){i.typed=!1;break}}(!a.typed||!c.typed)&&(i.typed=!1),a.typed&&(i.value[a.value]=c.value)}}else Ke(this,"type",i,n);return i}}}function de(r){return{kind:"schema",type:"string",reference:de,expects:"string",async:!1,message:r,get"~standard"(){return ze(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:Ke(this,"type",e,t),e}}}function Kp(r){let e;if(r)for(let t of r)e?e.push(...t.issues):e=t.issues;return e}function Hr(r,e){return{kind:"schema",type:"union",reference:Hr,expects:Qp(r.map(t=>t.expects),"|"),async:!1,options:r,message:e,get"~standard"(){return ze(this)},"~run"(t,i){let n,s,o;for(let l of this.options){let a=l["~run"]({value:t.value},i);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];Ke(this,"type",t,i,{issues:Kp(s)}),t.typed=!0}else{if(o?.length===1)return o[0];Ke(this,"type",t,i,{issues:Kp(o)})}return t}}}function ed(r,e,t){let i=r["~run"]({value:e},za(t));if(i.issues)throw new Dm(i.issues);return i.value}function td(r,e){let t={};for(let i in r.entries)t[i]=!e||e.includes(i)?Br(r.entries[i]):r.entries[i];return{...r,entries:t,get"~standard"(){return ze(this)}}}function rd(...r){return{...r[0],pipe:r,get"~standard"(){return ze(this)},"~run"(e,t){for(let i of r)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=i["~run"](e,t))}return e}}}function Hi(r,e,t){let i=r["~run"]({value:e},za(t));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var Nm=td(_t({name:de(),description:de(),price:de(),image_url:Hr([de(),qr(de())]),category:de(),url:de()}));function nd(r,e,t,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1}){if(!r)return E``;let l=e>0&&"data"in t[e-1],a=e<t.length-1||!o;if("text"in r)return E`<p>${r.text}</p>`;if("html"in r)return E`${Zp(r.html)}`;if("data"in r)switch(r.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let c=Hi(Nm,r.data);if(c.success){let p={...c.output,images:[]};return p.images=Jp(p.image_url),E`
|
|
419
|
+
${l?E`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
|
|
420
|
+
<mw-product-card-horizontal
|
|
421
|
+
product="${JSON.stringify(p)}"
|
|
422
|
+
?streaming="${!a}"
|
|
423
|
+
?links-new-tab="${n}"
|
|
424
|
+
.searchParams="${s}"
|
|
425
|
+
.imagesByProductUrl="${i}"></mw-product-card-horizontal>
|
|
426
|
+
`}console.warn(c.issues);break}}return console.warn("could not render part:",r),E`<p><i>data type not supported</i></p>`}var zi,zr,Ft,nr,Rs,sd,Ps=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,Rs);b(this,zi);b(this,zr);b(this,Ft);b(this,nr,!1);T(this,"timeoutMs");A(this,zi,e),A(this,zr,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return f(this,nr)}hostDisconnected(){clearTimeout(f(this,Ft)),A(this,Ft,void 0)}onInput(e){if(f(this,zi).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(f(this,Ft)),A(this,Ft,setTimeout(()=>this.typingStopped(),this.timeoutMs)),f(this,nr)||C(this,Rs,sd).call(this)}}typingStopped(){clearTimeout(f(this,Ft)),A(this,nr,!1),f(this,zr).typingStopped()}};zi=new WeakMap,zr=new WeakMap,Ft=new WeakMap,nr=new WeakMap,Rs=new WeakSet,sd=function(){A(this,nr,!0),f(this,zr).typingStarted()};function od(r,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(r);return`${r.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var Um=!0,Ka="Invariant failed";function ad(r,e){if(!r){if(Um)throw new Error(Ka);var t=typeof e=="function"?e():e,i=t?"".concat(Ka,": ").concat(t):Ka;throw new Error(i)}}var qm="\xB7 \xB7 \xB7",Bm=_t({conversationId:Br(de()),messages:Br(qr(_t({id:de(),timestamp:As(),role:Za(["user","assistant","support"]),content:de(),parts:Br(qr(Hr([_t({text:de()}),_t({html:de()}),_t({tag:de(),data:Ts(de(),Ga())})])))})))}),Hm=Ts(de(),Hr([de(),As(),Ja(),Xa()])),zm=rd(de(),Wa(1),Va(1e3)),Vr,Wr,X,Qa,Os,Wi,sr,ne,Gi,ld,ud,cd,pd,dd,hd,fd,gd,Ms,Fs=class Fs extends G(H){constructor(){super();b(this,X);b(this,Vr);b(this,Wr);b(this,Wi,new Ps(this,{typingStarted:()=>f(this,ne).sendUserTypingStart(),typingStopped:()=>f(this,ne).sendUserTypingStop()}));b(this,sr,!1);b(this,ne,new Is(this,{url:t=>{let i=new URL(this.config.wsApiUrl);return i.searchParams.set("widgetId",this.widgetId),i.searchParams.set("conversationId",t),i.searchParams.set("pageUrl",window.location.href),i},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{A(this,sr,!1),t.role==="user"&&f(this,X,Ms)?.scrollTo(0,f(this,X,Ms).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageAppend:t=>{let i=f(this,X,Ms);if(!i)return;let n=f(this,ne).lastMsg;!n||n.role!=="assistant"||requestAnimationFrame(()=>{let s=i.querySelector(`[data-id="${n.id}"]`);if(!s)return;let o=s.offsetHeight,l=i.getClientRects()[0].height-70;o>l&&!f(this,sr)&&(i.scrollTop=s.offsetTop-80)})},onMessageDone:(t,i)=>{A(this,sr,!1),i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,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,X,Os))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(f(this,X,Os),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(f(this,X,Os))||"{}"),i=ed(Bm,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));b(this,Gi,"single");this.widgetId="",this.config={},this.callbacks={},this.showClose=!1,this.xUserData="",this.xPromptExt=""}get conversationId(){return f(this,ne).conversationId}get messages(){return f(this,ne).messages}firstUpdated(){C(this,X,Qa).call(this)}updated(){C(this,X,Qa).call(this)}render(){ad(this.config,"config is required");let t=Xp(this.messages,i=>{try{let n=new Date(i.timestamp),s=Math.floor(n.getUTCMinutes()/5)*5;return n.setUTCMinutes(s,0,0),n.valueOf().toString()}catch(n){console.error(n)}});return E`
|
|
271
427
|
<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]">
|
|
272
428
|
<div
|
|
273
429
|
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]">
|
|
@@ -276,8 +432,8 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
276
432
|
.content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
|
|
277
433
|
?show-new-chat="${!f(this,ne).isLiveMode&&this.messages.length>0}"
|
|
278
434
|
?show-close="${this.showClose}"
|
|
279
|
-
@mw:new-chat-click="${
|
|
280
|
-
@mw:close-click="${
|
|
435
|
+
@mw:new-chat-click="${C(this,X,fd)}"
|
|
436
|
+
@mw:close-click="${C(this,X,gd)}">
|
|
281
437
|
</mw-chat-header>
|
|
282
438
|
|
|
283
439
|
<!-- used by the dashboard to inject content -->
|
|
@@ -286,8 +442,8 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
286
442
|
</div>
|
|
287
443
|
|
|
288
444
|
<!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
|
|
289
|
-
<div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto" @scroll="${
|
|
290
|
-
${this.config?.showStillLearningBanner?
|
|
445
|
+
<div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto" @scroll="${C(this,X,ld)}">
|
|
446
|
+
${this.config?.showStillLearningBanner?E`
|
|
291
447
|
<div class="flex justify-center">
|
|
292
448
|
<div class="mb-2 flex max-w-[70%] select-none items-center justify-center rounded-full bg-black px-3 py-2">
|
|
293
449
|
<!-- (i) symbol -->
|
|
@@ -302,7 +458,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
302
458
|
<span class="ml-1 text-xs text-white">I'm still learning!</span>
|
|
303
459
|
</div>
|
|
304
460
|
</div>
|
|
305
|
-
`:
|
|
461
|
+
`:E`
|
|
306
462
|
<!-- this makes the chat stick to bottom when the banner is hidden -->
|
|
307
463
|
<div class="flex p-1"></div>
|
|
308
464
|
`}
|
|
@@ -310,19 +466,19 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
310
466
|
<!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
|
|
311
467
|
<!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
|
|
312
468
|
<div class="${this.messages.length>0?"pt-20":""}">
|
|
313
|
-
${
|
|
314
|
-
<div class="my-2 text-center text-xs text-gray-500">${
|
|
315
|
-
${
|
|
469
|
+
${Rt(Array.from(t),([i])=>i,([i,n])=>E`
|
|
470
|
+
<div class="my-2 text-center text-xs text-gray-500">${od(new Date(Number(i)),window.navigator.language)}</div>
|
|
471
|
+
${Rt(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;A(this,Gi,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,ne).isLiveMode&&s.role==="user"&&s.id===f(this,ne).lastMsg?.id?"sent":"";return E`
|
|
316
472
|
<div data-id="${s.id}" class="${a?"mb-[2px]":"mb-3"} mx-2 flex-row">
|
|
317
473
|
<mw-chat-message
|
|
318
474
|
color="${this.config.color}"
|
|
319
475
|
status="${g}"
|
|
320
476
|
logo="${s.metadata?.avatar||this.config.logoUrl}"
|
|
321
477
|
side="${s.role}"
|
|
322
|
-
position=${f(this,
|
|
323
|
-
@click="${
|
|
478
|
+
position=${f(this,Gi)}
|
|
479
|
+
@click="${C(this,X,ud)}">
|
|
324
480
|
<div class="prose break-words text-inherit">
|
|
325
|
-
${s.content===
|
|
481
|
+
${s.content===qm?E`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.parts?Rt(s.parts,(m,_)=>_,(m,_)=>nd(m,_,s.parts??[],{imagesByProductUrl:s.metadata?.imagesByProductUrl,linksNewTab:this.config.linksNewTab??!0,searchParams:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:s.streaming})):E`<p>${s.content}</p>`}
|
|
326
482
|
</div>
|
|
327
483
|
</mw-chat-message>
|
|
328
484
|
</div>
|
|
@@ -330,7 +486,7 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
330
486
|
`)}
|
|
331
487
|
|
|
332
488
|
<!-- show typing indicator if the non-user side is typing -->
|
|
333
|
-
${["assistant","support"].includes(f(this,ne)?.typingIndicator?.role??"")&&f(this,ne)?.typingIndicator?.role?
|
|
489
|
+
${["assistant","support"].includes(f(this,ne)?.typingIndicator?.role??"")&&f(this,ne)?.typingIndicator?.role?E`
|
|
334
490
|
<mw-chat-message
|
|
335
491
|
class="mx-2 mb-3 block"
|
|
336
492
|
color="${this.config.color}"
|
|
@@ -347,20 +503,20 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
347
503
|
class="flex-grow"
|
|
348
504
|
.examples="${this.messages.length>0?[]:this.config.examples}"
|
|
349
505
|
color="${this.config.color}"
|
|
350
|
-
@mw:example-click="${
|
|
506
|
+
@mw:example-click="${C(this,X,cd)}"></mw-chat-background>
|
|
351
507
|
</div>
|
|
352
508
|
|
|
353
509
|
<div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
|
|
354
510
|
<mw-chat-input
|
|
355
|
-
@mw:change="${
|
|
356
|
-
@mw:submit="${
|
|
357
|
-
@mw:cancel="${
|
|
511
|
+
@mw:change="${C(this,X,dd)}"
|
|
512
|
+
@mw:submit="${C(this,X,pd)}"
|
|
513
|
+
@mw:cancel="${C(this,X,hd)}"
|
|
358
514
|
placeholder="${this.config.input?.placeholder}"
|
|
359
515
|
?disabled="${f(this,ne).ranOutOfCredits}"
|
|
360
516
|
?streaming="${f(this,ne)?.isStreaming??!0}">
|
|
361
517
|
</mw-chat-input>
|
|
362
518
|
|
|
363
|
-
${this.config.removePoweredBy?j:
|
|
519
|
+
${this.config.removePoweredBy?j:E`
|
|
364
520
|
<!-- spacing between input box and powered-by or bottom -->
|
|
365
521
|
<div class="h-4">
|
|
366
522
|
<mw-powered-by></mw-powered-by>
|
|
@@ -369,39 +525,39 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
369
525
|
</div>
|
|
370
526
|
</div>
|
|
371
527
|
</div>
|
|
372
|
-
`}reloadConfig(){f(this,ne).reloadConfig(),this.requestUpdate()}};
|
|
528
|
+
`}reloadConfig(){f(this,ne).reloadConfig(),this.requestUpdate()}};Vr=new WeakMap,Wr=new WeakMap,X=new WeakSet,Qa=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 i=Hi(Hm,t);i.success?A(this,Vr,i.output):console.error("Molin: x-user-data does not pass schema validation",i.issues)}if(this.xPromptExt){let t=Hi(zm,this.xPromptExt);t.success?A(this,Wr,t.output):console.error("Molin: x-prompt-ext does not pass schema validation",t.issues)}},Os=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},Wi=new WeakMap,sr=new WeakMap,ne=new WeakMap,Gi=new WeakMap,ld=function(){A(this,sr,!0)},ud=function(t){let i=t.target;if(i instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let s=this.config.linksNewTab?"_blank":"_self";window.open(i.href,i.target||s)}},cd=function(t){let i=t.detail.example;if(!f(this,ne)?.sendUserInput(i,{xUserData:f(this,Vr),xPromptExt:f(this,Wr)})){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},pd=function(t){let i=t.detail;if(!f(this,ne)?.sendUserInput(i,{xUserData:f(this,Vr),xPromptExt:f(this,Wr)})){t.preventDefault();return}f(this,Wi).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},dd=function(t){f(this,Wi).onInput(t.detail.full)},hd=function(){f(this,ne)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},fd=function(){f(this,ne).reset()},gd=function(){this.dispatchEvent(new Fs.CloseClickEvent)},Ms=function(){return this.renderRoot.querySelector("#scrollable-content")},T(Fs,"properties",{widgetId:{type:String,attribute:"widget"},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 Vi=Fs,Ya;Vi.CloseClickEvent=(Ya=class extends CustomEvent{constructor(e={}){super(Vi.CloseClickEvent.type,{...e})}},T(Ya,"type","mw:close-click"),Ya);customElements.get("mw-chat")||customElements.define("mw-chat",Vi);var Gr,md,vd,Ji=class Ji extends G(H){constructor(){super();b(this,Gr);T(this,"render",()=>E`
|
|
373
529
|
<!-- wrapper -->
|
|
374
530
|
<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">
|
|
375
531
|
<!-- close button -->
|
|
376
532
|
<button
|
|
377
533
|
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"
|
|
378
|
-
@click="${
|
|
534
|
+
@click="${C(this,Gr,md)}"
|
|
379
535
|
aria-label="Close">
|
|
380
536
|
×
|
|
381
537
|
</button>
|
|
382
538
|
|
|
383
539
|
<!-- content -->
|
|
384
|
-
<div class="p-4 text-left text-gray-800" @click="${
|
|
540
|
+
<div class="p-4 text-left text-gray-800" @click="${C(this,Gr,vd)}">
|
|
385
541
|
<p>${this.text}</p>
|
|
386
542
|
</div>
|
|
387
543
|
</div>
|
|
388
|
-
`);this.text="Hello there. How can we help?"}};
|
|
544
|
+
`);this.text="Hello there. How can we help?"}};Gr=new WeakSet,md=function(){this.dispatchEvent(new Ji.CloseEvent)},vd=function(){this.dispatchEvent(new Ji.ClickEvent)},T(Ji,"properties",{text:{type:String}});var or=Ji,el;or.CloseEvent=(el=class extends CustomEvent{constructor(e={}){super(or.CloseEvent.type,{...e})}},T(el,"type","mw:close"),el);var tl;or.ClickEvent=(tl=class extends CustomEvent{constructor(e={}){super(or.ClickEvent.type,{...e})}},T(tl,"type","mw:click"),tl);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",or);var Jr,yd,_d,Xi=class Xi extends G(H){constructor(){super();b(this,Jr);T(this,"render",()=>E`
|
|
389
545
|
<!-- wrapper -->
|
|
390
546
|
<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">
|
|
391
547
|
<!-- close button -->
|
|
392
548
|
<button
|
|
393
549
|
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"
|
|
394
|
-
@click="${
|
|
550
|
+
@click="${C(this,Jr,yd)}"
|
|
395
551
|
aria-label="Close">
|
|
396
552
|
×
|
|
397
553
|
</button>
|
|
398
554
|
|
|
399
555
|
<!-- content -->
|
|
400
|
-
<div class="p-4 text-gray-800" @click="${
|
|
556
|
+
<div class="p-4 text-gray-800" @click="${C(this,Jr,_d)}">
|
|
401
557
|
<h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
|
|
402
558
|
<p class="py-2.5 text-left">${this.text}</p>
|
|
403
559
|
<div class="h-4"></div>
|
|
404
|
-
${this.button&&this.color?
|
|
560
|
+
${this.button&&this.color?E`
|
|
405
561
|
<!-- only visible if button text and color are given -->
|
|
406
562
|
<button class="w-full rounded-full bg-[${this.color}] px-5 py-2.5 text-center text-sm font-medium text-white" type="button">${this.button}</button>
|
|
407
563
|
`:j}
|
|
@@ -410,30 +566,30 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
410
566
|
<!-- can append any other content -->
|
|
411
567
|
<slot name="footer"></slot>
|
|
412
568
|
</div>
|
|
413
|
-
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};
|
|
569
|
+
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Jr=new WeakSet,yd=function(){this.dispatchEvent(new Xi.CloseEvent)},_d=function(){this.dispatchEvent(new Xi.ClickEvent)},T(Xi,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var ar=Xi,rl;ar.CloseEvent=(rl=class extends CustomEvent{constructor(e={}){super(ar.CloseEvent.type,{...e})}},T(rl,"type","mw:close"),rl);var il;ar.ClickEvent=(il=class extends CustomEvent{constructor(e={}){super(ar.ClickEvent.type,{...e})}},T(il,"type","mw:click"),il);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",ar);var Xr,Zi,lr,Ls=class{constructor(e,t){b(this,Xr);b(this,Zi,!1);b(this,lr,()=>{f(this,Zi)||(f(this,Xr).userFirstInteracted?.(),A(this,Zi,!0)),f(this,Xr).userInteracted?.()});A(this,Xr,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",f(this,lr)),window.addEventListener("keydown",f(this,lr))}stopListening(){window.removeEventListener("click",f(this,lr)),window.removeEventListener("keydown",f(this,lr))}};Xr=new WeakMap,Zi=new WeakMap,lr=new WeakMap;var Vm=24*60*60*1e3,Zr,Ve,ur,Ki,cr,Yi,js,bd,Ds=class{constructor(e,t,i=Date){b(this,js);b(this,Zr);b(this,Ve);b(this,ur);b(this,Ki);b(this,cr,!1);b(this,Yi,!1);A(this,Zr,e),A(this,Ve,t),A(this,ur,i),e.addController(this)}get showing(){return f(this,cr)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!f(this,cr)&&(A(this,cr,!0),f(this,Zr).requestUpdate(),e)){f(this,Ve).playPopupSound();let t=f(this,Ve).getPersistedState();f(this,Ve).setPersistedState({...t,playedSoundOnce:!0})}}hide(){A(this,Yi,!0),this.abortAutoShowTimer(),A(this,cr,!1),f(this,Zr).requestUpdate()}abortAutoShowTimer(){clearTimeout(f(this,Ki))}onCloseClick(){let e=f(this,Ve).getPersistedState();f(this,Ve).setPersistedState({...e,userDismissedAt:f(this,ur).now()}),this.hide()}onContentClick(){let e=f(this,Ve).getPersistedState();f(this,Ve).setPersistedState({...e,userDismissedAt:f(this,ur).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),f(this,Yi)||A(this,Ki,setTimeout(()=>C(this,js,bd).call(this),f(this,Ve).getDelayMs()))}};Zr=new WeakMap,Ve=new WeakMap,ur=new WeakMap,Ki=new WeakMap,cr=new WeakMap,Yi=new WeakMap,js=new WeakSet,bd=function(){let e=f(this,Ve).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&f(this,ur).now()-e.userDismissedAt<Vm||this.show({sound:!t})};var Lt,ol,bt,Ns,sl,Us=class Us extends G(H){constructor(){super();b(this,bt);b(this,Lt,new Ds(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,ol,new Ls(this,f(this,Lt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=f(this,Lt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return E`
|
|
414
570
|
<!-- mobile shadow backdrop -->
|
|
415
|
-
<div @click="${
|
|
571
|
+
<div @click="${C(this,bt,Ns)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
|
|
416
572
|
|
|
417
573
|
<!-- mobile overlay -->
|
|
418
574
|
<div class="${t} fixed bottom-0 left-0 right-0 z-[2147483647] sm:hidden">
|
|
419
|
-
<mw-popup-mobile title="${
|
|
420
|
-
${
|
|
575
|
+
<mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${C(this,bt,sl)}" @mw:close="${C(this,bt,Ns)}">
|
|
576
|
+
${i.mobile.poweredBy?E`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:j}
|
|
421
577
|
</mw-popup-mobile>
|
|
422
578
|
</div>
|
|
423
579
|
|
|
424
580
|
<!-- desktop -->
|
|
425
581
|
<div class="${t} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
|
|
426
|
-
<mw-popup-desktop text="${
|
|
582
|
+
<mw-popup-desktop text="${i.desktop.text}" @mw:click="${C(this,bt,sl)}" @mw:close="${C(this,bt,Ns)}"></mw-popup-desktop>
|
|
427
583
|
</div>
|
|
428
|
-
`}hide(){f(this,
|
|
584
|
+
`}hide(){f(this,Lt).hide()}};Lt=new WeakMap,ol=new WeakMap,bt=new WeakSet,Ns=function(){f(this,Lt).onCloseClick()},sl=function(){this.dispatchEvent(new Us.ClickEvent),f(this,Lt).onContentClick()},T(Us,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Qi=Us,nl;Qi.ClickEvent=(nl=class extends CustomEvent{constructor(e={}){super(Qi.ClickEvent.type,{...e})}},T(nl,"type","mw:click"),nl);customElements.get("mw-popup")||customElements.define("mw-popup",Qi);var Bs,wd,qs=class extends G(H){constructor(){super();b(this,Bs);T(this,"render",()=>E`
|
|
429
585
|
<span class="relative inline-flex">
|
|
430
586
|
<slot></slot>
|
|
431
|
-
<span class="${f(this,
|
|
587
|
+
<span class="${f(this,Bs,wd)} pointer-events-none absolute z-10 flex h-3 w-3">
|
|
432
588
|
<span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
|
|
433
589
|
<span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
|
|
434
590
|
</span>
|
|
435
591
|
</span>
|
|
436
|
-
`);this.color="sky-500",this.position="top-right"}};
|
|
592
|
+
`);this.color="sky-500",this.position="top-right"}};Bs=new WeakSet,wd=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(qs,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",qs);var Hs=class extends G(H){constructor(){super();T(this,"render",()=>E`
|
|
437
593
|
<div class="${this.positionClasses} fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base">
|
|
438
594
|
<p class="mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
|
|
439
595
|
|
|
@@ -446,209 +602,76 @@ var Wf=Object.defineProperty;var Zu=i=>{throw TypeError(i)};var Gf=(i,e,t)=>e in
|
|
|
446
602
|
stroke-linecap="round"></path>
|
|
447
603
|
</svg>
|
|
448
604
|
</div>
|
|
449
|
-
`);this.positionClasses="",this.text="Try it out"}};T(bs,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",bs);var lm={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},Va=wr({preflight:{...lm},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},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"}}}},presets:[Jn(),Vn(),Wn(),Xn()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Br=i=>Zn(Va)(i);function ws(i,e){var t={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&e.indexOf(r)<0&&(t[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(i);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(i,r[n])&&(t[r[n]]=i[r[n]]);return t}var xs=function(){},Ui=function(){};var qr=(i,e,t)=>Math.min(Math.max(t,i),e);var Wa=.001,um=.01,Dd=10,cm=.05,dm=1;function jd({duration:i=800,bounce:e=.25,velocity:t=0,mass:r=1}){let n,s;xs(i<=Dd*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=qr(cm,dm,o),i=qr(um,Dd,i/1e3),o<1?(n=c=>{let d=c*o,u=d*i,p=d-t,h=ks(c,o),g=Math.exp(-u);return Wa-p/h*g},s=c=>{let u=c*o*i,p=u*t+t,h=Math.pow(o,2)*Math.pow(c,2)*i,g=Math.exp(-u),v=ks(Math.pow(c,2),o);return(-n(c)+Wa>0?-1:1)*((p-h)*g)/v}):(n=c=>{let d=Math.exp(-c*i),u=(c-t)*i+1;return-Wa+d*u},s=c=>{let d=Math.exp(-c*i),u=(t-c)*(i*i);return d*u});let l=5/i,a=hm(n,s,l);if(i=i*1e3,isNaN(a))return{stiffness:100,damping:10,duration:i};{let c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:i}}}var pm=12;function hm(i,e,t){let r=t;for(let n=1;n<pm;n++)r=r-i(r)/e(r);return r}function ks(i,e){return i*Math.sqrt(1-e*e)}var fm=["duration","bounce"],gm=["stiffness","damping","mass"];function Nd(i,e){return e.some(t=>i[t]!==void 0)}function mm(i){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},i);if(!Nd(i,gm)&&Nd(i,fm)){let t=jd(i);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Es(i){var{from:e=0,to:t=1,restSpeed:r=2,restDelta:n}=i,s=ws(i,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:l,damping:a,mass:c,velocity:d,duration:u,isResolvedFromDuration:p}=mm(s),h=Ud,g=Ud;function v(){let b=d?-(d/1e3):0,w=t-e,_=a/(2*Math.sqrt(l*c)),k=Math.sqrt(l/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(t-e)/100,.4)),_<1){let S=ks(k,_);h=O=>{let q=Math.exp(-_*k*O);return t-q*((b+_*k*w)/S*Math.sin(S*O)+w*Math.cos(S*O))},g=O=>{let q=Math.exp(-_*k*O);return _*k*q*(Math.sin(S*O)*(b+_*k*w)/S+w*Math.cos(S*O))-q*(Math.cos(S*O)*(b+_*k*w)-S*w*Math.sin(S*O))}}else if(_===1)h=S=>t-Math.exp(-k*S)*(w+(b+k*w)*S);else{let S=k*Math.sqrt(_*_-1);h=O=>{let q=Math.exp(-_*k*O),U=Math.min(S*O,300);return t-q*((b+_*k*w)*Math.sinh(U)+S*w*Math.cosh(U))/S}}}return v(),{next:b=>{let w=h(b);if(p)o.done=b>=u;else{let _=g(b)*1e3,k=Math.abs(_)<=r,S=Math.abs(t-w)<=n;o.done=k&&S}return o.value=o.done?t:w,o},flipTarget:()=>{d=-d,[e,t]=[t,e],v()}}}Es.needsInterpolation=(i,e)=>typeof i=="string"||typeof e=="string";var Ud=i=>0;var Ga=(i,e,t)=>{let r=e-i;return r===0?1:(t-i)/r};var Bi=(i,e,t)=>-t*i+t*e+i;var Ss=(i,e)=>t=>Math.max(Math.min(t,e),i),Ot=i=>i%1?Number(i.toFixed(5)):i,qi=/(-)?([\d]*\.?[\d])+/g,Cs=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Bd=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function bt(i){return typeof i=="string"}var Hi={test:i=>typeof i=="number",parse:parseFloat,transform:i=>i},$s=Object.assign(Object.assign({},Hi),{transform:Ss(0,1)}),mb=Object.assign(Object.assign({},Hi),{default:1});var Hr=i=>({test:e=>bt(e)&&e.endsWith(i)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${i}`}),yb=Hr("deg"),zi=Hr("%"),bb=Hr("px"),wb=Hr("vh"),xb=Hr("vw"),kb=Object.assign(Object.assign({},zi),{parse:i=>zi.parse(i)/100,transform:i=>zi.transform(i*100)});var Vi=(i,e)=>t=>!!(bt(t)&&Bd.test(t)&&t.startsWith(i)||e&&Object.prototype.hasOwnProperty.call(t,e)),Is=(i,e,t)=>r=>{if(!bt(r))return r;let[n,s,o,l]=r.match(qi);return{[i]:parseFloat(n),[e]:parseFloat(s),[t]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}};var ut={test:Vi("hsl","hue"),parse:Is("hue","saturation","lightness"),transform:({hue:i,saturation:e,lightness:t,alpha:r=1})=>"hsla("+Math.round(i)+", "+zi.transform(Ot(e))+", "+zi.transform(Ot(t))+", "+Ot($s.transform(r))+")"};var vm=Ss(0,255),As=Object.assign(Object.assign({},Hi),{transform:i=>Math.round(vm(i))}),Xe={test:Vi("rgb","red"),parse:Is("red","green","blue"),transform:({red:i,green:e,blue:t,alpha:r=1})=>"rgba("+As.transform(i)+", "+As.transform(e)+", "+As.transform(t)+", "+Ot($s.transform(r))+")"};function _m(i){let e="",t="",r="",n="";return i.length>5?(e=i.substr(1,2),t=i.substr(3,2),r=i.substr(5,2),n=i.substr(7,2)):(e=i.substr(1,1),t=i.substr(2,1),r=i.substr(3,1),n=i.substr(4,1),e+=e,t+=t,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(r,16),alpha:n?parseInt(n,16)/255:1}}var Wi={test:Vi("#"),parse:_m,transform:Xe.transform};var Ft={test:i=>Xe.test(i)||Wi.test(i)||ut.test(i),parse:i=>Xe.test(i)?Xe.parse(i):ut.test(i)?ut.parse(i):Wi.parse(i),transform:i=>bt(i)?i:i.hasOwnProperty("red")?Xe.transform(i):ut.transform(i)};var qd="${c}",Hd="${n}";function ym(i){var e,t,r,n;return isNaN(i)&&bt(i)&&((t=(e=i.match(qi))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((n=(r=i.match(Cs))===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0)>0}function zd(i){typeof i=="number"&&(i=`${i}`);let e=[],t=0,r=i.match(Cs);r&&(t=r.length,i=i.replace(Cs,qd),e.push(...r.map(Ft.parse)));let n=i.match(qi);return n&&(i=i.replace(qi,Hd),e.push(...n.map(Hi.parse))),{values:e,numColors:t,tokenised:i}}function Vd(i){return zd(i).values}function Wd(i){let{values:e,numColors:t,tokenised:r}=zd(i),n=e.length;return s=>{let o=r;for(let l=0;l<n;l++)o=o.replace(l<t?qd:Hd,l<t?Ft.transform(s[l]):Ot(s[l]));return o}}var bm=i=>typeof i=="number"?0:i;function wm(i){let e=Vd(i);return Wd(i)(e.map(bm))}var Ts={test:ym,parse:Vd,createTransformer:Wd,getAnimatableNone:wm};function Ja(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function Xa({hue:i,saturation:e,lightness:t,alpha:r}){i/=360,e/=100,t/=100;let n=0,s=0,o=0;if(!e)n=s=o=t;else{let l=t<.5?t*(1+e):t+e-t*e,a=2*t-l;n=Ja(a,l,i+1/3),s=Ja(a,l,i),o=Ja(a,l,i-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}var xm=(i,e,t)=>{let r=i*i,n=e*e;return Math.sqrt(Math.max(0,t*(n-r)+r))},km=[Wi,Xe,ut],Gd=i=>km.find(e=>e.test(i)),Jd=i=>`'${i}' is not an animatable color. Use the equivalent color code instead.`,Ps=(i,e)=>{let t=Gd(i),r=Gd(e);Ui(!!t,Jd(i)),Ui(!!r,Jd(e));let n=t.parse(i),s=r.parse(e);t===ut&&(n=Xa(n),t=Xe),r===ut&&(s=Xa(s),r=Xe);let o=Object.assign({},n);return l=>{for(let a in o)a!=="alpha"&&(o[a]=xm(n[a],s[a],l));return o.alpha=Bi(n.alpha,s.alpha,l),t.transform(o)}};var Xd=i=>typeof i=="number";var Em=(i,e)=>t=>e(i(t)),Rs=(...i)=>i.reduce(Em);function Yd(i,e){return Xd(i)?t=>Bi(i,e,t):Ft.test(i)?Ps(i,e):Ya(i,e)}var Za=(i,e)=>{let t=[...i],r=t.length,n=i.map((s,o)=>Yd(s,e[o]));return s=>{for(let o=0;o<r;o++)t[o]=n[o](s);return t}},Kd=(i,e)=>{let t=Object.assign(Object.assign({},i),e),r={};for(let n in t)i[n]!==void 0&&e[n]!==void 0&&(r[n]=Yd(i[n],e[n]));return n=>{for(let s in r)t[s]=r[s](n);return t}};function Zd(i){let e=Ts.parse(i),t=e.length,r=0,n=0,s=0;for(let o=0;o<t;o++)r||typeof e[o]=="number"?r++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:r,numRGB:n,numHSL:s}}var Ya=(i,e)=>{let t=Ts.createTransformer(e),r=Zd(i),n=Zd(e);return r.numHSL===n.numHSL&&r.numRGB===n.numRGB&&r.numNumbers>=n.numNumbers?Rs(Za(r.parsed,n.parsed),t):(xs(!0,`Complex values '${i}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:i}`)};var Sm=(i,e)=>t=>Bi(i,e,t);function Cm(i){if(typeof i=="number")return Sm;if(typeof i=="string")return Ft.test(i)?Ps:Ya;if(Array.isArray(i))return Za;if(typeof i=="object")return Kd}function $m(i,e,t){let r=[],n=t||Cm(i[0]),s=i.length-1;for(let o=0;o<s;o++){let l=n(i[o],i[o+1]);if(e){let a=Array.isArray(e)?e[o]:e;l=Rs(a,l)}r.push(l)}return r}function Im([i,e],[t]){return r=>t(Ga(i,e,r))}function Am(i,e){let t=i.length,r=t-1;return n=>{let s=0,o=!1;if(n<=i[0]?o=!0:n>=i[r]&&(s=r-1,o=!0),!o){let a=1;for(;a<t&&!(i[a]>n||a===r);a++);s=a-1}let l=Ga(i[s],i[s+1],n);return e[s](l)}}function Ms(i,e,{clamp:t=!0,ease:r,mixer:n}={}){let s=i.length;Ui(s===e.length,"Both input and output ranges must be the same length"),Ui(!r||!Array.isArray(r)||r.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),i[0]>i[s-1]&&(i=[].concat(i),e=[].concat(e),i.reverse(),e.reverse());let o=$m(e,r,n),l=s===2?Im(i,o):Am(i,o);return t?a=>l(qr(i[0],i[s-1],a)):l}var zr=i=>e=>1-i(1-e),Os=i=>e=>e<=.5?i(2*e)/2:(2-i(2*(1-e)))/2,Qd=i=>e=>Math.pow(e,i),Ka=i=>e=>e*e*((i+1)*e-i),ep=i=>{let e=Ka(i);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))};var tp=1.525,Tm=4/11,Pm=8/11,Rm=9/10;var ip=Qd(2),Cw=zr(ip),rp=Os(ip),Mm=i=>1-Math.sin(Math.acos(i)),Om=zr(Mm),$w=Os(Om),np=Ka(tp),Iw=zr(np),Aw=Os(np),Tw=ep(tp),Fm=4356/361,Lm=35442/1805,Dm=16061/1805,jm=i=>{if(i===1||i===0)return i;let e=i*i;return i<Tm?7.5625*e:i<Pm?9.075*e-9.9*i+3.4:i<Rm?Fm*e-Lm*i+Dm:10.8*i*i-20.52*i+10.72},Pw=zr(jm);function Nm(i,e){return i.map(()=>e||rp).splice(0,i.length-1)}function Um(i){let e=i.length;return i.map((t,r)=>r!==0?r/(e-1):0)}function Bm(i,e){return i.map(t=>t*e)}function Vr({from:i=0,to:e=1,ease:t,offset:r,duration:n=300}){let s={done:!1,value:i},o=Array.isArray(e)?e:[i,e],l=Bm(r&&r.length===o.length?r:Um(o),n);function a(){return Ms(l,o,{ease:Array.isArray(t)?t:Nm(o,t)})}let c=a();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=a()}}}function sp({velocity:i=0,from:e=0,power:t=.8,timeConstant:r=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},l=t*i,a=e+l,c=s===void 0?a:s(a);return c!==a&&(l=c-e),{next:d=>{let u=-l*Math.exp(-d/r);return o.done=!(u>n||u<-n),o.value=o.done?c:c+u,o},flipTarget:()=>{}}}var op={keyframes:Vr,spring:Es,decay:sp};function ap(i){if(Array.isArray(i.to))return Vr;if(op[i.type])return op[i.type];let e=new Set(Object.keys(i));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Vr:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Es:Vr}var Qa=16.666666666666668,qm=typeof performance<"u"?()=>performance.now():()=>Date.now(),el=typeof window<"u"?i=>window.requestAnimationFrame(i):i=>setTimeout(()=>i(qm()),Qa);function lp(i){let e=[],t=[],r=0,n=!1,s=!1,o=new WeakSet,l={schedule:(a,c=!1,d=!1)=>{let u=d&&n,p=u?e:t;return c&&o.add(a),p.indexOf(a)===-1&&(p.push(a),u&&n&&(r=e.length)),a},cancel:a=>{let c=t.indexOf(a);c!==-1&&t.splice(c,1),o.delete(a)},process:a=>{if(n){s=!0;return}if(n=!0,[e,t]=[t,e],t.length=0,r=e.length,r)for(let c=0;c<r;c++){let d=e[c];d(a),o.has(d)&&(l.schedule(d),i())}n=!1,s&&(s=!1,l.process(a))}};return l}var Hm=40,tl=!0,Gr=!1,il=!1,Wr={delta:0,timestamp:0},Jr=["read","update","preRender","render","postRender"],Fs=Jr.reduce((i,e)=>(i[e]=lp(()=>Gr=!0),i),{}),zm=Jr.reduce((i,e)=>{let t=Fs[e];return i[e]=(r,n=!1,s=!1)=>(Gr||Wm(),t.schedule(r,n,s)),i},{}),up=Jr.reduce((i,e)=>(i[e]=Fs[e].cancel,i),{}),Vw=Jr.reduce((i,e)=>(i[e]=()=>Fs[e].process(Wr),i),{}),Vm=i=>Fs[i].process(Wr),cp=i=>{Gr=!1,Wr.delta=tl?Qa:Math.max(Math.min(i-Wr.timestamp,Hm),1),Wr.timestamp=i,il=!0,Jr.forEach(Vm),il=!1,Gr&&(tl=!1,el(cp))},Wm=()=>{Gr=!0,tl=!0,il||el(cp)};var dp=zm;function rl(i,e,t=0){return i-e-t}function pp(i,e,t=0,r=!0){return r?rl(e+-i,e,t):e-(i-e)+t}function hp(i,e,t,r){return r?i>=e+t:i<=-t}var Gm=i=>{let e=({delta:t})=>i(t);return{start:()=>dp.update(e,!0),stop:()=>up.update(e)}};function nl(i){var e,t,{from:r,autoplay:n=!0,driver:s=Gm,elapsed:o=0,repeat:l=0,repeatType:a="loop",repeatDelay:c=0,onPlay:d,onStop:u,onComplete:p,onRepeat:h,onUpdate:g}=i,v=ws(i,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=v,w,_=0,k=v.duration,S,O=!1,q=!0,U,R=ap(v);!((t=(e=R).needsInterpolation)===null||t===void 0)&&t.call(e,r,b)&&(U=Ms([0,100],[r,b],{clamp:!1}),r=0,b=100);let B=R(Object.assign(Object.assign({},v),{from:r,to:b}));function V(){_++,a==="reverse"?(q=_%2===0,o=pp(o,k,c,q)):(o=rl(o,k,c),a==="mirror"&&B.flipTarget()),O=!1,h&&h()}function we(){w.stop(),p&&p()}function ce(J){if(q||(J=-J),o+=J,!O){let Y=B.next(Math.max(0,o));S=Y.value,U&&(S=U(S)),O=q?Y.done:o<=0}g?.(S),O&&(_===0&&(k??(k=o)),_<l?hp(o,k,c,q)&&V():we())}function Fe(){d?.(),w=s(ce),w.start()}return n&&Fe(),{stop:()=>{u?.(),w.stop()}}}var rt,fp,gp,mp,ol,Gi=class extends Br(H){constructor(){super();y(this,rt);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(t){t.has("product")&&x(this,rt,fp).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return A`
|
|
450
|
-
<div class="my-2 w-full rounded-3xl border bg-white p-3">
|
|
451
|
-
<div class="flex gap-4">
|
|
452
|
-
<div class="relative aspect-[3/4] w-full max-w-[100px] flex-shrink-0">
|
|
453
|
-
<div class="h-full w-full animate-pulse rounded-lg bg-gray-200"></div>
|
|
454
|
-
</div>
|
|
455
|
-
<div class="flex flex-1 flex-col">
|
|
456
|
-
<div class="mb-1 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
457
|
-
<div class="mb-2 flex items-center justify-between">
|
|
458
|
-
<div class="h-4 w-20 animate-pulse rounded bg-gray-200"></div>
|
|
459
|
-
<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>
|
|
460
|
-
</div>
|
|
461
|
-
<div class="h-8 w-3/4 animate-pulse rounded bg-gray-200"></div>
|
|
462
|
-
</div>
|
|
463
|
-
</div>
|
|
464
|
-
</div>
|
|
465
|
-
`;let{name:t,description:r,price:n,category:s}=this.product;return A`
|
|
466
|
-
<div class="my-4 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-3 transition-all hover:shadow-sm">
|
|
467
|
-
<div class="flex cursor-pointer gap-2" @click="${x(this,rt,gp)}">
|
|
468
|
-
<div class="relative aspect-[3/4] w-full max-w-[100px] flex-shrink-0">
|
|
469
|
-
<div class="group relative h-full w-full overflow-hidden p-2">
|
|
470
|
-
<div
|
|
471
|
-
class="image-slider z-0 flex h-full w-full overflow-hidden rounded-lg transition-transform duration-300 ease-in-out"
|
|
472
|
-
style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
473
|
-
${this.images.length>0?this.images.map((o,l)=>A`<img src="${o}" alt="${t}" class="h-full w-auto flex-shrink-0 rounded-lg object-cover" @error="${x(this,rt,mp)}" loading="lazy" />`):x(this,rt,ol).call(this)}
|
|
474
|
-
</div>
|
|
475
|
-
</div>
|
|
476
|
-
</div>
|
|
477
|
-
|
|
478
|
-
<div class="flex flex-1 flex-col justify-between">
|
|
479
|
-
<div>
|
|
480
|
-
<!-- ${s?A`<span class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600"> ${s} </span>`:A`<span class="inline-block h-4 w-20 animate-pulse rounded bg-gray-200"></span>`} -->
|
|
481
|
-
<h3 class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 mt-1 line-clamp-2 cursor-pointer text-lg/3 font-medium transition-all hover:underline">
|
|
482
|
-
${t||A`<span class="inline-block h-5 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
483
|
-
</h3>
|
|
484
|
-
|
|
485
|
-
${r?A`<p class="line-clamp-2 text-xs text-gray-500">${r}</p>`:A`<div class="h-8 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
486
|
-
</div>
|
|
487
|
-
<span class="text-md font-semibold text-gray-900"> ${n||A`<span class="inline-block h-4 w-14 animate-pulse rounded bg-gray-200"></span>`} </span>
|
|
488
|
-
</div>
|
|
489
|
-
</div>
|
|
490
|
-
</div>
|
|
491
|
-
`}};rt=new WeakSet,fp=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let t=new URL(this.product.url);this._isValidUrl=t.protocol==="http:"||t.protocol==="https:"}catch{this._isValidUrl=!1}},gp=function(t){t.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},mp=function(t){t.target&&t.target instanceof HTMLImageElement&&t.target.replaceWith(x(this,rt,ol).call(this))},ol=function(){let t=document.createElement("div");t.setAttribute("class","h-full w-full flex-shrink-0 object-scale-down");let r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("viewBox","0 0 100 133"),r.setAttribute("class","rounded-lg"),r.setAttribute("fill","none"),r.innerHTML=`
|
|
492
|
-
<rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)"/>
|
|
493
|
-
<g transform="matrix(0.6458070278167725, 0, 0, 0.5434090495109558, -19.74715805053711, -14.242161750793464)">
|
|
494
|
-
<rect x="92" y="135.169" width="32" height="26.831" rx="2" stroke-width="4" style="isolation: isolate; stroke: rgb(187, 187, 187); fill: none;"/>
|
|
495
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M 109.142 156.857 L 104 149 L 94 160 L 108 160 L 114 160 L 122 160 L 115 153 L 109.142 156.857 Z" fill="#BBBBBB" style=""/>
|
|
496
|
-
<circle cx="110" cy="146" r="3" fill="#BBBBBB" style=""/>
|
|
497
|
-
</g>
|
|
498
|
-
`,t.appendChild(r),t},T(Gi,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var sl;Gi.AddToCartEvent=(sl=class extends CustomEvent{constructor(e,t={}){super(Gi.AddToCartEvent.type,{detail:{product:e},...t})}},T(sl,"type","mw-product-card-horizontal:add-to-cart"),sl);customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Gi);var Z,vp,Ls,_p,yp,ll,Ds,bp,wp,xp,js,Ns=class Ns extends Br(H){constructor(){super();y(this,Z);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(t){t.has("product")&&x(this,Z,vp).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return A`
|
|
499
|
-
<div class="my-2 w-full rounded-3xl border bg-white p-4">
|
|
500
|
-
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
501
|
-
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
|
|
502
|
-
</div>
|
|
503
|
-
<div class="mb-2 flex items-end justify-between">
|
|
504
|
-
<div>
|
|
505
|
-
<div class="mb-1 h-4 w-20 animate-pulse rounded bg-gray-200"></div>
|
|
506
|
-
<div class="h-6 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
507
|
-
</div>
|
|
508
|
-
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
509
|
-
</div>
|
|
510
|
-
<div class="mb-4 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>
|
|
511
|
-
<div class="my-4 border-t border-gray-200"></div>
|
|
512
|
-
<div class="flex items-end justify-between gap-3">
|
|
513
|
-
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
514
|
-
<div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
|
|
515
|
-
</div>
|
|
516
|
-
</div>
|
|
517
|
-
`;if(this.product.layout==="horizontal")return A` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:t,description:r,price:n,category:s}=this.product;return A`
|
|
518
|
-
<div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
|
|
519
|
-
<div class="pointer-events-auto mx-auto mb-4">
|
|
520
|
-
<div class="group relative overflow-hidden rounded-2xl">
|
|
521
|
-
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
522
|
-
${this.images.length>0?this.images.map((o,l)=>A`<img src="${o}" alt="${t}" class="h-auto w-full flex-shrink-0 object-scale-down" @error="${x(this,Z,yp)}" loading="lazy" />`):x(this,Z,ll).call(this)}
|
|
523
|
-
</div>
|
|
524
|
-
${Sr(this.images.length>1,()=>A`
|
|
525
|
-
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
526
|
-
<button
|
|
527
|
-
@click="${x(this,Z,wp)}"
|
|
528
|
-
class="absolute left-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
|
|
529
|
-
<hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
|
|
530
|
-
</button>
|
|
531
|
-
<button
|
|
532
|
-
@click="${x(this,Z,bp)}"
|
|
533
|
-
class="absolute right-2 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white bg-opacity-80 shadow transition-all hover:bg-opacity-100">
|
|
534
|
-
<hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
|
|
535
|
-
</button>
|
|
536
|
-
</div>
|
|
537
|
-
`)}
|
|
538
|
-
${Sr(this.images?.length>1,()=>A`
|
|
539
|
-
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
540
|
-
${this.images.map((o,l)=>A`
|
|
541
|
-
<button
|
|
542
|
-
@click="${()=>x(this,Z,xp).call(this,l)}"
|
|
543
|
-
class="${l===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} h-1.5 w-1.5 rounded-full bg-white transition-all hover:bg-opacity-80"></button>
|
|
544
|
-
`)}
|
|
545
|
-
</div>
|
|
546
|
-
`)}
|
|
547
|
-
</div>
|
|
548
|
-
</div>
|
|
549
|
-
<div @click="${x(this,Z,Ls)}" class="cursor-pointer">
|
|
550
|
-
${s?A`<a @click="${x(this,Z,Ls)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:A`<span class="inline-block h-4 w-20 animate-pulse rounded bg-gray-200"></span>`}
|
|
551
|
-
|
|
552
|
-
<h3
|
|
553
|
-
@click="${x(this,Z,Ls)}"
|
|
554
|
-
class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
|
|
555
|
-
${t||A`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
556
|
-
</h3>
|
|
557
|
-
${r?A`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${r}</p>`:A`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
558
|
-
<span class="text-lg font-bold"> ${n||A`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
|
|
559
|
-
|
|
560
|
-
<!-- <div class="my-4 border-t border-gray-200"></div> -->
|
|
561
|
-
|
|
562
|
-
<!-- <button
|
|
563
|
-
@click="${x(this,Z,_p)}"
|
|
564
|
-
?disabled="${!this._isValidUrl}"
|
|
565
|
-
class="${this._isValidUrl?"bg-gray-900 hover:bg-gray-800":"bg-gray-900/80 cursor-default"} w-full rounded-xl px-4 py-1.5 text-sm text-white">
|
|
566
|
-
${this.labels.addToCart}
|
|
567
|
-
</button> -->
|
|
568
|
-
</div>
|
|
569
|
-
</div>
|
|
570
|
-
`}};Z=new WeakSet,vp=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let t=new URL(this.product.url);this._isValidUrl=t.protocol==="http:"||t.protocol==="https:"}catch{this._isValidUrl=!1}},Ls=function(t){t.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},_p=function(t){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new Ns.AddToCartEvent(this.product)))},yp=function(t){t.target&&t.target instanceof HTMLImageElement&&t.target.replaceWith(x(this,Z,ll).call(this))},ll=function(){let t=document.createElement("div");t.setAttribute("class","h-auto w-full flex-shrink-0 object-scale-down");let r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("viewBox","0 0 240 144"),r.setAttribute("fill","none"),r.innerHTML=`
|
|
571
|
-
<g clip-path="url(#clip0_426_295)">
|
|
572
|
-
<rect width="240" height="144" rx="2" fill="#EEEEEE" />
|
|
573
|
-
<rect x="112" y="66" width="16" height="12" rx="1" stroke="#BBBBBB" stroke-width="2" />
|
|
574
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M121.571 75.4286L118 71.5L113 77H120H123H127L123.5 73.5L121.571 75.4286Z" fill="#BBBBBB" />
|
|
575
|
-
<circle cx="121.5" cy="70" r="1.5" fill="#BBBBBB" />
|
|
576
|
-
</g>
|
|
577
|
-
<defs>
|
|
578
|
-
<clipPath id="clip0_426_295">
|
|
579
|
-
<rect width="240" height="144" rx="2" fill="white" />
|
|
580
|
-
</clipPath>
|
|
581
|
-
</defs>
|
|
582
|
-
`,t.appendChild(r),t},Ds=function(t,r){f(this,Z,js)&&nl({from:t,to:r,duration:300,onUpdate:n=>{f(this,Z,js)&&(f(this,Z,js).style.transform=`translateX(${n}%)`)}})},bp=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,r=(t+1)%this.product.images.length,n=-(t*100),s=-(r*100);x(this,Z,Ds).call(this,n,s),this._currentImageIndex=r},wp=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,r=(t-1+this.product.images.length)%this.product.images.length,n=-(t*100),s=-(r*100);x(this,Z,Ds).call(this,n,s),this._currentImageIndex=r},xp=function(t){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=Math.max(0,Math.min(t,this.product.images.length-1)),s=-(r*100),o=-(n*100);x(this,Z,Ds).call(this,s,o),this._currentImageIndex=n},js=function(){return this.renderRoot.querySelector(".image-slider")},T(Ns,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Xr=Ns,al;Xr.AddToCartEvent=(al=class extends CustomEvent{constructor(e,t={}){super(Xr.AddToCartEvent.type,{detail:{product:e},...t})}},T(al,"type","mw-product-card:add-to-cart"),al);customElements.get("mw-product-card")||customElements.define("mw-product-card",Xr);window.__INIT_MOLIN_SHOP_AI=function(e){if(Jm(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 Jm(i){window.__INIT_MOLIN_SHOP_AI_OPTIONS=i}function kp(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Te,wt,Bs,Zr,Ji,ul=class{constructor(){y(this,Te,[]);y(this,wt);y(this,Bs,10);y(this,Zr,5e3);y(this,Ji,!1)}async add(e,t){if(f(this,Te).push({event:e,properties:Object.assign({},t,Cp()),distinct_id:Sp(t.distinct_id),timestamp:new Date().toISOString()}),f(this,Te).length>=f(this,Bs))return this.flush();f(this,wt)||I(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Zr)))}async flush(){if(f(this,Ji)||f(this,Te).length===0)return;let e=[...f(this,Te)];try{I(this,Ji,!0),clearTimeout(f(this,wt)),I(this,wt,void 0),I(this,Te,[]);let t=new AbortController,r=setTimeout(()=>t.abort(),5e3),n=new FormData;n.append("events",JSON.stringify(e));let s=await fetch(new URL("/widgets/data/collect",cl()).href,{method:"POST",body:n,signal:t.signal});if(clearTimeout(r),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s}catch(t){if(t.name==="AbortError")console.error("Request timed out, retrying events"),I(this,Te,[...e,...f(this,Te)]);else{console.error("Failed to send events to backend:",t);let r=e.filter(n=>n.event.includes("error"));I(this,Te,[...r,...f(this,Te)])}}finally{I(this,Ji,!1),f(this,Te).length>0&&!f(this,wt)&&I(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,Zr)))}}async flushBeforeUnload(){if(f(this,Te).length>0)try{let e=new FormData;e.append("events",JSON.stringify(f(this,Te))),navigator.sendBeacon(new URL("/widgets/data/collect",cl()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};Te=new WeakMap,wt=new WeakMap,Bs=new WeakMap,Zr=new WeakMap,Ji=new WeakMap;var Ep=new ul;window.addEventListener("beforeunload",()=>{Ep.flushBeforeUnload().catch(console.error)});async function pe(i,e){try{if(e.immediate){let t=new FormData;t.append("events",JSON.stringify([{event:i,properties:Object.assign({},e,Cp()),distinct_id:Sp(e.distinct_id),timestamp:new Date().toISOString()}]));let r=await fetch(new URL("/widgets/data/collect",cl()).href,{method:"POST",body:t});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}return Ep.add(i,e)}catch(t){console.error("Failed to send event:",t)}}function Sp(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 Cp(){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 Us;function cl(){if(Us)return Us;let i=new URL(import.meta.url).hostname;return Us=new Map([["localhost","http://localhost:8787"],["widget.molin.foo","https://molin.foo"],["widget.molin.ai","https://molin.ai"],["molin.foo","https://molin.foo"]]).get(i)||"https://molin.ai",Us}var ci,Yr,Lt,di,Hs,Ip,qs=class{constructor(e,t,r){y(this,Hs);y(this,ci);y(this,Yr);y(this,Lt);y(this,di);T(this,"isLoading",!1);T(this,"data");I(this,ci,e),I(this,Yr,t),I(this,Lt,r),e.addController(this)}fetch(){if(this.isLoading)return;f(this,di)?.abort();let e=new AbortController;I(this,di,e),this.isLoading=!0,this.data=void 0,f(this,ci).requestUpdate(),(async()=>{let t=x(this,Hs,Ip).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,Lt)?.transform=="function"?await f(this,Lt).transform(t):t,f(this,ci).requestUpdate()}).catch(t=>{f(this,Lt)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,ci).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,Lt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,di)?.abort(),I(this,di,void 0)}};ci=new WeakMap,Yr=new WeakMap,Lt=new WeakMap,di=new WeakMap,Hs=new WeakSet,Ip=function(){let e=f(this,Yr);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ct,Kr,Xi,Zi,Dt=class{constructor(e,t){y(this,ct);y(this,Kr);y(this,Xi);y(this,Zi);I(this,ct,e),I(this,Kr,t),e.addController(this)}get data(){return f(this,Zi)||f(this,Xi)?.data}hostConnected(){if(f(this,Xi)||f(this,Zi))return;let e=kp();e&&e.widgetId===f(this,ct).widgetId?I(this,Zi,e.config):I(this,Xi,new qs(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,Kr)?.onError}))}};ct=new WeakMap,Kr=new WeakMap,Xi=new WeakMap,Zi=new WeakMap;function Ap(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 E(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ap(Object(t),!0).forEach(function(r){P(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Ap(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function P(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ch(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}var ot,Ut={DEBUG:!1,LIB_VERSION:"1.195.0"},m=typeof window<"u"?window:void 0,Ne=typeof globalThis<"u"?globalThis:m,$h=Array.prototype,Tp=$h.forEach,Pp=$h.indexOf,Ve=Ne?.navigator,M=Ne?.document,je=Ne?.location,xl=Ne?.fetch,kl=Ne!=null&&Ne.XMLHttpRequest&&"withCredentials"in new Ne.XMLHttpRequest?Ne.XMLHttpRequest:void 0,Rp=Ne?.AbortController,be=Ve?.userAgent,N=m??{},dl="$copy_autocapture",Xm=["$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"})(ot||(ot={}));var Zm=Array.isArray,Ih=Object.prototype,Ah=Ih.hasOwnProperty,Eo=Ih.toString,le=Zm||function(i){return Eo.call(i)==="[object Array]"},Ze=i=>typeof i=="function",he=i=>i===Object(i)&&!le(i),Ki=i=>{if(he(i)){for(var e in i)if(Ah.call(i,e))return!1;return!0}return!1},F=i=>i===void 0,Ee=i=>Eo.call(i)=="[object String]",Mp=i=>Ee(i)&&i.trim().length===0,Wt=i=>i===null,ee=i=>F(i)||Wt(i),ze=i=>Eo.call(i)=="[object Number]",vi=i=>Eo.call(i)==="[object Boolean]",Ym=i=>i instanceof FormData,Km=i=>z(Xm,i),Th=i=>{var e={_log:function(t){if(m&&(Ut.DEBUG||N.POSTHOG_DEBUG)&&!F(m.console)&&m.console){for(var r=("__rrweb_original__"in m.console[t])?m.console[t].__rrweb_original__:m.console[t],n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];r(i,...s)}},info:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("log",...r)},warn:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("warn",...r)},error:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e._log("error",...r)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(i,...r)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling ".concat(t))},createLogger:t=>Th("".concat(i," ").concat(t))};return e},D=Th("[PostHog.js]"),Ue=D.createLogger,no={},So=function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function tr(i,e,t){if(le(i)){if(Tp&&i.forEach===Tp)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)===no)return}}}function K(i,e,t){if(!ee(i)){if(le(i))return tr(i,e,t);if(Ym(i)){for(var r of i.entries())if(e.call(t,r[1],r[0])===no)return}else for(var n in i)if(Ah.call(i,n)&&e.call(t,i[n],n)===no)return}}var Re=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 tr(t,function(n){for(var s in n)n[s]!==void 0&&(i[s]=n[s])}),i};function z(i,e){return i.indexOf(e)!==-1}function to(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 Op=function(i){try{return i()}catch{return}},Qm=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){D.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),D.critical(n)}}},so=function(i){var e={};return K(i,function(t,r){Ee(t)&&t.length>0&&(e[r]=t)}),e},El=function(i){return i.replace(/^\$/,"")};function e0(i,e){return t=i,r=s=>Ee(s)&&!Wt(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),le(o)?(a=[],tr(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 t0=function(i){var e,t,r,n,s="";for(e=t=0,r=(i=(i+"").replace(/\r\n/g,`
|
|
605
|
+
`);this.positionClasses="",this.text="Try it out"}};T(Hs,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Hs);window.__INIT_MOLIN_SHOP_AI=function(e){if(Wm(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 Wm(r){window.__INIT_MOLIN_SHOP_AI_OPTIONS=r}function xd(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Pe,wt,Vs,en,Kr,al=class{constructor(){b(this,Pe,[]);b(this,wt);b(this,Vs,10);b(this,en,5e3);b(this,Kr,!1)}async add(e,t){if(f(this,Pe).push({event:e,properties:Object.assign({},t,Ed()),distinct_id:Sd(t.distinct_id),timestamp:new Date().toISOString()}),f(this,Pe).length>=f(this,Vs))return this.flush();f(this,wt)||A(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,en)))}async flush(){if(f(this,Kr)||f(this,Pe).length===0)return;let e=[...f(this,Pe)];try{A(this,Kr,!0),clearTimeout(f(this,wt)),A(this,wt,void 0),A(this,Pe,[]);let t=new AbortController,i=setTimeout(()=>t.abort(),5e3),n=new FormData;n.append("events",JSON.stringify(e));let s=await fetch(new URL("/widgets/data/collect",ll()).href,{method:"POST",body:n,signal:t.signal});if(clearTimeout(i),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s}catch(t){if(t.name==="AbortError")console.error("Request timed out, retrying events"),A(this,Pe,[...e,...f(this,Pe)]);else{console.error("Failed to send events to backend:",t);let i=e.filter(n=>n.event.includes("error"));A(this,Pe,[...i,...f(this,Pe)])}}finally{A(this,Kr,!1),f(this,Pe).length>0&&!f(this,wt)&&A(this,wt,setTimeout(()=>{this.flush().catch(console.error)},f(this,en)))}}async flushBeforeUnload(){if(f(this,Pe).length>0)try{let e=new FormData;e.append("events",JSON.stringify(f(this,Pe))),navigator.sendBeacon(new URL("/widgets/data/collect",ll()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};Pe=new WeakMap,wt=new WeakMap,Vs=new WeakMap,en=new WeakMap,Kr=new WeakMap;var kd=new al;window.addEventListener("beforeunload",()=>{kd.flushBeforeUnload().catch(console.error)});async function he(r,e){try{if(e.immediate){let t=new FormData;t.append("events",JSON.stringify([{event:r,properties:Object.assign({},e,Ed()),distinct_id:Sd(e.distinct_id),timestamp:new Date().toISOString()}]));let i=await fetch(new URL("/widgets/data/collect",ll()).href,{method:"POST",body:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return await i.json()}return kd.add(r,e)}catch(t){console.error("Failed to send event:",t)}}function Sd(r=crypto.randomUUID()){let e="molin_shop_assistant_distinct_id";try{let t=localStorage.getItem(e);return t||(t=r,localStorage.setItem(e,t)),t}catch(t){console.error("Failed to handle distinct ID:",t);try{localStorage.setItem(e,r)}catch(i){console.error("Failed to store new distinct ID:",i)}return r}}function Ed(){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 zs;function ll(){if(zs)return zs;let r=new URL(import.meta.url).hostname;return zs=new Map([["localhost","http://localhost:8787"],["widget.molin.foo","https://molin.foo"],["widget.molin.ai","https://molin.ai"],["molin.foo","https://molin.foo"]]).get(r)||"https://molin.ai",zs}var pr,tn,Dt,dr,Gs,$d,Ws=class{constructor(e,t,i){b(this,Gs);b(this,pr);b(this,tn);b(this,Dt);b(this,dr);T(this,"isLoading",!1);T(this,"data");A(this,pr,e),A(this,tn,t),A(this,Dt,i),e.addController(this)}fetch(){if(this.isLoading)return;f(this,dr)?.abort();let e=new AbortController;A(this,dr,e),this.isLoading=!0,this.data=void 0,f(this,pr).requestUpdate(),(async()=>{let t=C(this,Gs,$d).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,Dt)?.transform=="function"?await f(this,Dt).transform(t):t,f(this,pr).requestUpdate()}).catch(t=>{f(this,Dt)?.onError?.(t),this.isLoading=!1,this.data=void 0,f(this,pr).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||f(this,Dt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){f(this,dr)?.abort(),A(this,dr,void 0)}};pr=new WeakMap,tn=new WeakMap,Dt=new WeakMap,dr=new WeakMap,Gs=new WeakSet,$d=function(){let e=f(this,tn);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var pt,rn,Yr,Qr,jt=class{constructor(e,t){b(this,pt);b(this,rn);b(this,Yr);b(this,Qr);A(this,pt,e),A(this,rn,t),e.addController(this)}get data(){return f(this,Qr)||f(this,Yr)?.data}hostConnected(){if(f(this,Yr)||f(this,Qr))return;let e=xd();e&&e.widgetId===f(this,pt).widgetId?A(this,Qr,e.config):A(this,Yr,new Ws(f(this,pt),()=>{if(f(this,pt).cdn&&f(this,pt).widgetId)return`${f(this,pt).cdn}/config?w=${f(this,pt).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:f(this,rn)?.onError}))}};pt=new WeakMap,rn=new WeakMap,Yr=new WeakMap,Qr=new WeakMap;function Id(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function k(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Id(Object(t),!0).forEach(function(i){P(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Id(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function P(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Eh(r,e){if(r==null)return{};var t,i,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}(r,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}var at,qt={DEBUG:!1,LIB_VERSION:"1.195.0"},v=typeof window<"u"?window:void 0,Ue=typeof globalThis<"u"?globalThis:v,Ch=Array.prototype,Ad=Ch.forEach,Td=Ch.indexOf,Ge=Ue?.navigator,O=Ue?.document,Ne=Ue?.location,bl=Ue?.fetch,wl=Ue!=null&&Ue.XMLHttpRequest&&"withCredentials"in new Ue.XMLHttpRequest?Ue.XMLHttpRequest:void 0,Pd=Ue?.AbortController,we=Ge?.userAgent,N=v??{},ul="$copy_autocapture",Gm=["$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(r){r.GZipJS="gzip-js",r.Base64="base64"})(at||(at={}));var Jm=Array.isArray,$h=Object.prototype,Ih=$h.hasOwnProperty,Io=$h.toString,le=Jm||function(r){return Io.call(r)==="[object Array]"},Ye=r=>typeof r=="function",fe=r=>r===Object(r)&&!le(r),ti=r=>{if(fe(r)){for(var e in r)if(Ih.call(r,e))return!1;return!0}return!1},F=r=>r===void 0,Ee=r=>Io.call(r)=="[object String]",Rd=r=>Ee(r)&&r.trim().length===0,Gt=r=>r===null,Q=r=>F(r)||Gt(r),We=r=>Io.call(r)=="[object Number]",yr=r=>Io.call(r)==="[object Boolean]",Xm=r=>r instanceof FormData,Zm=r=>z(Gm,r),Ah=r=>{var e={_log:function(t){if(v&&(qt.DEBUG||N.POSTHOG_DEBUG)&&!F(v.console)&&v.console){for(var i=("__rrweb_original__"in v.console[t])?v.console[t].__rrweb_original__:v.console[t],n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(r,...s)}},info:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];e._log("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];console.error(r,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling ".concat(t))},createLogger:t=>Ah("".concat(r," ").concat(t))};return e},D=Ah("[PostHog.js]"),qe=D.createLogger,lo={},Ao=function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function ni(r,e,t){if(le(r)){if(Ad&&r.forEach===Ad)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,n=r.length;i<n;i++)if(i in r&&e.call(t,r[i],i)===lo)return}}}function K(r,e,t){if(!Q(r)){if(le(r))return ni(r,e,t);if(Xm(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===lo)return}else for(var n in r)if(Ih.call(r,n)&&e.call(t,r[n],n)===lo)return}}var Oe=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ni(t,function(n){for(var s in n)n[s]!==void 0&&(r[s]=n[s])}),r};function z(r,e){return r.indexOf(e)!==-1}function so(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var Od=function(r){try{return r()}catch{return}},Km=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(n){D.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),D.critical(n)}}},uo=function(r){var e={};return K(r,function(t,i){Ee(t)&&t.length>0&&(e[i]=t)}),e},xl=function(r){return r.replace(/^\$/,"")};function Ym(r,e){return t=r,i=s=>Ee(s)&&!Gt(e)?s.slice(0,e):s,n=new Set,function s(o,l){return o!==Object(o)?i?i(o,l):o:n.has(o)?void 0:(n.add(o),le(o)?(a=[],ni(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,i,n}var Qm=function(r){var e,t,i,n,s="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,`
|
|
583
606
|
`).replace(/\r/g,`
|
|
584
|
-
`)).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),Wt(l)||(t>e&&(s+=i.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=i.substring(e,i.length)),s},Ct=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(m?.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 D.error("No valid element provided to register_event")}}();function Ph(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}var Rh="$people_distinct_id",nn="__alias",sn="__timers",Fp="$autocapture_disabled_server_side",Sl="$heatmaps_enabled_server_side",Lp="$exception_capture_enabled_server_side",Dp="$web_vitals_enabled_server_side",Mh="$dead_clicks_enabled_server_side",jp="$web_vitals_allowed_metrics",Cl="$session_recording_enabled_server_side",Np="$console_log_recording_enabled_server_side",Up="$session_recording_network_payload_capture",Bp="$session_recording_canvas_recording",qp="$replay_sample_rate",Hp="$replay_minimum_duration",zp="$replay_script_config",oo="$sesid",on="$session_is_sampled",pl="$session_recording_url_trigger_activated_session",hl="$session_recording_event_trigger_activated_session",Qi="$enabled_feature_flags",$l="$early_access_features",er="$stored_person_properties",Bt="$stored_group_properties",Il="$surveys",zs="$surveys_activated",ao="$flag_call_reported",kt="$user_state",Al="$client_session_props",Tl="$capture_rate_limit",Pl="$initial_campaign_params",Rl="$initial_referrer_info",Ml="$initial_person_info",lo="$epp",Oh="__POSTHOG_TOOLBAR__",i0=[Rh,nn,"__cmpns",sn,Cl,Sl,oo,Qi,kt,$l,Bt,er,Il,ao,Al,Tl,Pl,Rl,lo],Vs=Ue("[FeatureFlags]"),fl="$active_feature_flags",Ws="$override_feature_flags",Vp="$feature_flag_payloads",Wp=i=>{var e={};for(var[t,r]of to(i||{}))r&&(e[t]=r);return e},Ol=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(Ws);if(!t)return e||{};for(var r=Re({},e),n=Object.keys(t),s=0;s<n.length;s++)r[n[s]]=t[n[s]];return this._override_warning||(Vs.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){return this.instance.get_property(Vp)||{}}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(er),r=this.instance.get_property(Bt),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:ot.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(ao)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(le(o[e])?o[e].push(s):o[e]=[s],(r=this.instance.persistence)===null||r===void 0||r.register({[ao]:o}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}Vs.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);Vs.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(le(c)){var u={};if(c)for(var p=0;p<c.length;p++)u[c[p]]=!0;o&&o.register({[fl]:c,[Qi]:u})}else{var h=c,g=d;s.errorsWhileComputingFlags&&(h=E(E({},l),h),g=E(E({},a),g)),o&&o.register({[fl]:Object.keys(Wp(h)),[Qi]:h||{},[Vp]: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 Vs.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(Ws);else if(le(e)){for(var r={},n=0;n<e.length;n++)r[e[n]]=!0;this.instance.persistence.register({[Ws]:r})}else this.instance.persistence.register({[Ws]: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=E(E({},this.getFlagVariants()),{},{[e]:t});(r=this.instance.persistence)===null||r===void 0||r.register({[fl]:Object.keys(Wp(s)),[Qi]:s}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property($l);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({[$l]: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(er)||{};this.instance.register({[er]:E(E({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(er)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Bt)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(n=>{r[n]=E(E({},r[n]),e[n]),delete e[n]}),this.instance.register({[Bt]:E(E({},r),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(Bt)||{};this.instance.register({[Bt]:E(E({},t),{},{[e]:{}})})}else this.instance.unregister(Bt)}};Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return ze(i)&&isFinite(i)&&Math.floor(i)===i});var Gp="0123456789abcdef",Fl=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+Gp.charAt(this.bytes[t]>>>4)+Gp.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}},Ll=class{constructor(){P(this,"timestamp",0),P(this,"counter",0),P(this,"random",new Dl)}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 Fl.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())}},Jp,Fh=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};m&&!F(m.crypto)&&crypto.getRandomValues&&(Fh=i=>crypto.getRandomValues(i));var Dl=class{constructor(){P(this,"buffer",new Uint32Array(8)),P(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(Fh(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},Ht=()=>r0().toString(),r0=()=>(Jp||(Jp=new Ll)).generate(),n0="Thu, 01 Jan 1970 00:00:00 GMT",Qr="",s0=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function o0(i,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M;if(Qr)return Qr;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var o=n.split("."),l=Math.min(o.length,8),a="dmn_chk_"+Ht(),c=new RegExp("(^|;)\\s*"+a+"=1");!Qr&&l--;){var d=o.slice(l).join("."),u=a+"=1;domain=."+d;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+n0,Qr=d)}return Qr}(i);if(!t){var r=(n=>{var s=n.match(s0);return s?s[0]:""})(i);r!==t&&D.info("Warning: cookie subdomain discovery mismatch",r,t),t=r}return t?"; domain=."+t:""}return""}var $t={is_supported:()=>!!M,error:function(i){D.error("cookieStore error: "+i)},get:function(i){if(M){try{for(var e=i+"=",t=M.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($t.get(i))||{}}catch{}return e},set:function(i,e,t,r,n){if(M)try{var s="",o="",l=o0(M.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&&D.warn("cookieStore warning: large cookie, len="+c.length),M.cookie=c,c}catch{return}},remove:function(i,e){try{$t.set(i,"",-1,e)}catch{return}}},gl=null,ve={is_supported:function(){if(!Wt(gl))return gl;var i=!0;if(F(m))i=!1;else try{var e="__mplssupport__";ve.set(e,"xyz"),ve.get(e)!=='"xyz"'&&(i=!1),ve.remove(e)}catch{i=!1}return i||D.error("localStorage unsupported; falling back to cookie store"),gl=i,i},error:function(i){D.error("localStorage error: "+i)},get:function(i){try{return m?.localStorage.getItem(i)}catch(e){ve.error(e)}return null},parse:function(i){try{return JSON.parse(ve.get(i))||{}}catch{}return null},set:function(i,e){try{m?.localStorage.setItem(i,JSON.stringify(e))}catch(t){ve.error(t)}},remove:function(i){try{m?.localStorage.removeItem(i)}catch(e){ve.error(e)}}},a0=["distinct_id",oo,on,lo,Ml],Gs=E(E({},ve),{},{parse:function(i){try{var e={};try{e=$t.parse(i)||{}}catch{}var t=Re(e,JSON.parse(ve.get(i)||"{}"));return ve.set(i,t),t}catch{}return null},set:function(i,e,t,r,n,s){try{ve.set(i,e,void 0,void 0,s);var o={};a0.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&$t.set(i,o,t,r,n,s)}catch(l){ve.error(l)}},remove:function(i,e){try{m?.localStorage.removeItem(i),$t.remove(i,e)}catch(t){ve.error(t)}}}),Js={},l0={is_supported:function(){return!0},error:function(i){D.error("memoryStorage error: "+i)},get:function(i){return Js[i]||null},parse:function(i){return Js[i]||null},set:function(i,e){Js[i]=e},remove:function(i){delete Js[i]}},pi=null,ke={is_supported:function(){if(!Wt(pi))return pi;if(pi=!0,F(m))pi=!1;else try{var i="__support__";ke.set(i,"xyz"),ke.get(i)!=='"xyz"'&&(pi=!1),ke.remove(i)}catch{pi=!1}return pi},error:function(i){D.error("sessionStorage error: ",i)},get:function(i){try{return m?.sessionStorage.getItem(i)}catch(e){ke.error(e)}return null},parse:function(i){try{return JSON.parse(ke.get(i))||null}catch{}return null},set:function(i,e){try{m?.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){ke.error(t)}},remove:function(i){try{m?.sessionStorage.removeItem(i)}catch(e){ke.error(e)}}},u0=["localhost","127.0.0.1"],ir=i=>{var e=M?.createElement("a");return F(e)?null:(e.href=i,e)},sr=function(i,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(i)},c0=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)},uo=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(!le(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{D.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},co=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Ye="Mobile",po="iOS",dt="Android",pn="Tablet",Lh=dt+" "+pn,Dh="iPad",jh="Apple",Nh=jh+" Watch",hn="Safari",or="BlackBerry",Uh="Samsung",Bh=Uh+"Browser",qh=Uh+" Internet",yi="Chrome",d0=yi+" OS",Hh=yi+" "+po,$u="Internet Explorer",zh=$u+" "+Ye,Iu="Opera",p0=Iu+" Mini",Au="Edge",Vh="Microsoft "+Au,rr="Firefox",Wh=rr+" "+po,fn="Nintendo",gn="PlayStation",nr="Xbox",Gh=dt+" "+Ye,Jh=Ye+" "+hn,an="Windows",jl=an+" Phone",Xp="Nokia",Nl="Ouya",Xh="Generic",h0=Xh+" "+Ye.toLowerCase(),Zh=Xh+" "+pn.toLowerCase(),Ul="Konqueror",Pe="(\\d+(\\.\\d+)?)",ml=new RegExp("Version/"+Pe),f0=new RegExp(nr,"i"),g0=new RegExp(gn+" \\w+","i"),m0=new RegExp(fn+" \\w+","i"),Tu=new RegExp(or+"|PlayBook|BB10","i"),v0={"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"},_0=(i,e)=>e&&z(e,jh)||function(t){return z(t,hn)&&!z(t,yi)&&!z(t,dt)}(i),Zp=function(i,e){return e=e||"",z(i," OPR/")&&z(i,"Mini")?p0:z(i," OPR/")?Iu:Tu.test(i)?or:z(i,"IE"+Ye)||z(i,"WPDesktop")?zh:z(i,Bh)?qh:z(i,Au)||z(i,"Edg/")?Vh:z(i,"FBIOS")?"Facebook "+Ye:z(i,"UCWEB")||z(i,"UCBrowser")?"UC Browser":z(i,"CriOS")?Hh:z(i,"CrMo")||z(i,yi)?yi:z(i,dt)&&z(i,hn)?Gh:z(i,"FxiOS")?Wh:z(i.toLowerCase(),Ul.toLowerCase())?Ul:_0(i,e)?z(i,Ye)?Jh:hn:z(i,rr)?rr:z(i,"MSIE")||z(i,"Trident/")?$u:z(i,"Gecko")?rr:""},y0={[zh]:[new RegExp("rv:"+Pe)],[Vh]:[new RegExp(Au+"?\\/"+Pe)],[yi]:[new RegExp("("+yi+"|CrMo)\\/"+Pe)],[Hh]:[new RegExp("CriOS\\/"+Pe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Pe)],[hn]:[ml],[Jh]:[ml],[Iu]:[new RegExp("(Opera|OPR)\\/"+Pe)],[rr]:[new RegExp(rr+"\\/"+Pe)],[Wh]:[new RegExp("FxiOS\\/"+Pe)],[Ul]:[new RegExp("Konqueror[:/]?"+Pe,"i")],[or]:[new RegExp(or+" "+Pe),ml],[Gh]:[new RegExp("android\\s"+Pe,"i")],[qh]:[new RegExp(Bh+"\\/"+Pe)],[$u]:[new RegExp("(rv:|MSIE )"+Pe)],Mozilla:[new RegExp("rv:"+Pe)]},Yp=[[new RegExp(nr+"; "+nr+" (.*?)[);]","i"),i=>[nr,i&&i[1]||""]],[new RegExp(fn,"i"),[fn,""]],[new RegExp(gn,"i"),[gn,""]],[Tu,[or,""]],[new RegExp(an,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[jl,""];if(new RegExp(Ye).test(e)&&!/IEMobile\b/.test(e))return[an+" "+Ye,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=t[1],n=v0[r]||"";return/arm/i.test(e)&&(n="RT"),[an,n]}return[an,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[po,e.join(".")]}return[po,""]}],[/(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/,[d0,""]],[/Linux|debian/i,["Linux",""]]],Kp=function(i){return m0.test(i)?fn:g0.test(i)?gn:f0.test(i)?nr:new RegExp(Nl,"i").test(i)?Nl:new RegExp("("+jl+"|WPDesktop)","i").test(i)?jl:/iPad/.test(i)?Dh:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?Nh:Tu.test(i)?or:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(Xp,"i").test(i)?Xp:/(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(Ye).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:Lh:dt:new RegExp("(pda|"+Ye+")","i").test(i)?h0:new RegExp(pn,"i").test(i)&&!new RegExp(pn+" pc","i").test(i)?Zh:""},Xs="https?://(.*)",b0=["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"],se={campaignParams:function(i){return M?this._campaignParamsFromUrl(M.URL,i):{}},_campaignParamsFromUrl:function(i,e){var t=b0.concat(e||[]),r={};return K(t,function(n){var s=uo(i,n);r[n]=s||null}),r},_searchEngine:function(i){return i?i.search(Xs+"google.([^/?]*)")===0?"google":i.search(Xs+"bing.com")===0?"bing":i.search(Xs+"yahoo.com")===0?"yahoo":i.search(Xs+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(i){var e=se._searchEngine(i),t=e!="yahoo"?"q":"p",r={};if(!Wt(e)){r.$search_engine=e;var n=M?uo(M.referrer,t):"";n.length&&(r.ph_keyword=n)}return r},searchInfo:function(){var i=M?.referrer;return i?this._searchInfoFromReferrer(i):{}},browser:Zp,browserVersion:function(i,e){var t=Zp(i,e),r=y0[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},browserLanguagePrefix:function(){var i=this.browserLanguage();return typeof i=="string"?i.split("-")[0]:void 0},os:function(i){for(var e=0;e<Yp.length;e++){var[t,r]=Yp[e],n=t.exec(i),s=n&&(Ze(r)?r(n,i):r);if(s)return s}return["",""]},device:Kp,deviceType:function(i){var e=Kp(i);return e===Dh||e===Lh||e==="Kobo"||e==="Kindle Fire"||e===Zh?pn:e===fn||e===nr||e===gn||e===Nl?"Console":e===Nh?"Wearable":e?Ye:"Desktop"},referrer:function(){return M?.referrer||"$direct"},referringDomain:function(){var i;return M!=null&&M.referrer&&((i=ir(M.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().substring(0,1e3),u:je?.href.substring(0,1e3)}},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=ir(t))===null||e===void 0?void 0:e.host};if(r){n.$initial_current_url=r;var s=ir(r);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,K(this._campaignParamsFromUrl(r),function(o,l){n["$initial_"+El(l)]=o})}return t&&K(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+El(l)]=o}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){if(!be)return{};var[i,e]=se.os(be);return Re(so({$os:i,$os_version:e,$browser:se.browser(be,navigator.vendor),$device:se.device(be),$device_type:se.deviceType(be),$timezone:se.timezone(),$timezone_offset:se.timezoneOffset()}),{$current_url:je?.href,$host:je?.host,$pathname:je?.pathname,$raw_user_agent:be.length>1e3?be.substring(0,997)+"...":be,$browser_version:se.browserVersion(be,navigator.vendor),$browser_language:se.browserLanguage(),$browser_language_prefix:se.browserLanguagePrefix(),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:"web",$lib_version:Ut.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(!be)return{};var[i,e]=se.os(be);return Re(so({$os:i,$os_version:e,$browser:se.browser(be,navigator.vendor)}),{$browser_version:se.browserVersion(be,navigator.vendor)})}},w0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ln=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&&D.info("Persistence loaded",e.persistence,E({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){w0.indexOf(e.persistence.toLowerCase())===-1&&(D.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&ve.is_supported()?ve:t==="localstorage+cookie"&&Gs.is_supported()?Gs:t==="sessionstorage"&&ke.is_supported()?ke:t==="memory"?l0:t==="cookie"?$t:Gs.is_supported()?Gs:$t}properties(){var e={};return K(this.props,function(t,r){if(r===Qi&&he(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,(Wt(o=i0)?a:Pp&&o.indexOf===Pp?o.indexOf(l)!=-1:(K(o,function(c){if(a||(a=c===l))return no}),a))||(e[r]=t);var o,l,a}),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Re({},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(he(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(he(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=se.campaignParams(this.config.custom_campaign_params);Ki(so(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(se.searchInfo())}update_referrer_info(){this.register_once(se.referrerInfo(),void 0)}set_initial_person_info(){this.props[Pl]||this.props[Rl]||this.register_once({[Ml]:se.initialPersonInfo()},void 0)}get_referrer_info(){return so({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};K([Rl,Pl],n=>{var s=this.props[n];s&&K(s,function(o,l){e["$initial_"+El(l)]=o})});var t=this.props[Ml];if(t){var r=se.initialPersonPropsFromInfo(t);Re(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[sn]||{};r[e]=t,this.props[sn]=r,this.save()}remove_event_timer(e){var t=(this.props[sn]||{})[e];return F(t)||(delete this.props[sn][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function ho(i){var e,t;return((e=JSON.stringify(i,(t=[],function(r,n){if(he(n)){for(;t.length>0&&t[t.length-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 Bl(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[Bl({size:ho(r),data:r,sessionId:i.sessionId,windowId:i.windowId}),Bl({size:ho(n),data:n,sessionId:i.sessionId,windowId:i.windowId})].flatMap(s=>s)}return[i]}var Et=(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))(Et||{}),st=(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))(st||{});function Qp(i){var e;return i.id===Oh||!((e=i.closest)===null||e===void 0||!e.call(i,".toolbar-global-fade-container"))}function Co(i){return!!i&&i.nodeType===1}function Vt(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function Yh(i){return!!i&&i.nodeType===3}function Kh(i){return!!i&&i.nodeType===11}function Pu(i){return i?So(i).split(/\s+/):[]}function eh(i){var e=m?.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function fo(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 Pu(e)}function Qh(i){return ee(i)?null:So(i).split(/(\s+)/).filter(e=>ar(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function $o(i){var e="";return Hl(i)&&!rf(i)&&i.childNodes&&i.childNodes.length&&K(i.childNodes,function(t){var r;Yh(t)&&t.textContent&&(e+=(r=Qh(t.textContent))!==null&&r!==void 0?r:"")}),So(e)}function ef(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 ql=["a","button","form","input","select","textarea","label"];function tf(i){var e=i.parentNode;return!(!e||!Co(e))&&e}function x0(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(!m||!i||Vt(i,"html")||!Co(i)||t!=null&&t.url_allowlist&&!eh(t.url_allowlist)||t!=null&&t.url_ignorelist&&eh(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&&!Vt(c,"body");)if(Kh(c.parentNode))l.push(c.parentNode.host),c=c.parentNode.host;else{if(!(a=tf(c)))break;if(r||ql.indexOf(a.tagName.toLowerCase())>-1)o=!0;else{var d=m.getComputedStyle(a);d&&d.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(a),c=a}if(!function(h,g){var v=g?.element_allowlist;if(F(v))return!0;var b=function(k){if(v.some(S=>k.tagName.toLowerCase()===S))return{v:!0}};for(var w of h){var _=b(w);if(typeof _=="object")return _.v}return!1}(l,t)||!function(h,g){var v=g?.css_selector_allowlist;if(F(v))return!0;var b=function(k){if(v.some(S=>k.matches(S)))return{v:!0}};for(var w of h){var _=b(w);if(typeof _=="object")return _.v}return!1}(l,t))return!1;var u=m.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&&(ql.indexOf(p)>-1||i.getAttribute("contenteditable")==="true")}}function Hl(i){for(var e=i;e.parentNode&&!Vt(e,"body");e=e.parentNode){var t=fo(e);if(z(t,"ph-sensitive")||z(t,"ph-no-capture"))return!1}if(z(fo(i),"ph-include"))return!0;var r=i.type||"";if(Ee(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=i.name||i.id||"";return!(Ee(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 rf(i){return!!(Vt(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Vt(i,"select")||Vt(i,"textarea")||i.getAttribute("contenteditable")==="true")}var nf="(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})",k0=new RegExp("^(?:".concat(nf,")$")),E0=new RegExp(nf),sf="\\d{3}-?\\d{2}-?\\d{4}",S0=new RegExp("^(".concat(sf,")$")),C0=new RegExp("(".concat(sf,")"));function ar(i){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(ee(i)||Ee(i)&&(i=So(i),(e?k0:E0).test((i||"").replace(/[- ]/g,""))||(e?S0:C0).test(i)))}function of(i){var e=$o(i);return ar(e="".concat(e," ").concat(af(i)).trim())?e:""}function af(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=$o(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(af(t)).trim())}catch(s){D.error("[AutoCapture]",s)}}),e}function $0(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=E(E(E(E({},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 to(a).sort((d,u)=>{var[p]=d,[h]=u;return p.localeCompare(h)}).forEach(d=>{var[u,p]=d;return c[th(u.toString())]=th(p.toString())}),o+=":",o+=to(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:I0(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return to(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 th(i){return i.replace(/"|\\"/g,'\\"')}function I0(i){var e=i.attr__class;return e?le(e)?e:Pu(e):void 0}var zl="[SessionRecording]",Vl="redacted",Zs={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"]},A0=["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"],T0=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],P0=["/s/","/e/","/i/"];function ih(i,e,t,r){if(ee(i))return i;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(i);return Ee(n)&&(n=parseInt(n)),n>t?zl+" ".concat(r," body too large to record (").concat(n," bytes)"):i}function rh(i,e){if(ee(i))return i;var t=i;return ar(t,!1)||(t=zl+" "+e+" body "+Vl),K(T0,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=zl+" "+e+" body "+Vl+" as might contain: "+r)}),t}var R0=(i,e)=>{var t,r,n,s={payloadSizeLimitBytes:Zs.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Zs.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Zs.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=ih(p.requestBody,p.requestHeaders,n,"Request")),p!=null&&p.responseBody&&(p.responseBody=ih(p.responseBody,p.responseHeaders,n,"Response")),p)),d=p=>{return c(((v,b)=>{var w,_=ir(v.name),k=b.indexOf("http")===0?(w=ir(b))===null||w===void 0?void 0:w.pathname:b;k==="/"&&(k="");var S=_?.pathname.replace(k||"","");if(!(_&&S&&P0.some(O=>S.indexOf(O)===0)))return v})((g=(h=p).requestHeaders,ee(g)||K(Object.keys(g??{}),v=>{A0.includes(v.toLowerCase())&&(g[v]=Vl)}),h),i.api_host));var h,g},u=Ze(i.session_recording.maskNetworkRequestFn);return u&&Ze(i.session_recording.maskCapturedNetworkRequestFn)&&D.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 E(E({},p),{},{name:h?.url})}),s.maskRequestFn=Ze(i.session_recording.maskCapturedNetworkRequestFn)?p=>{var h,g,v,b=d(p);return b&&(h=(g=(v=i.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(v,b))!==null&&h!==void 0?h:void 0}:p=>function(h){if(!F(h))return h.requestBody=rh(h.requestBody,"Request"),h.responseBody=rh(h.responseBody,"Response"),h}(d(p)),E(E(E({},Zs),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function pt(i,e,t,r,n){return e>t&&(D.warn("min cannot be greater than max."),e=t),ze(i)?i>t?(r&&D.warn(r+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(r&&D.warn(r+" cannot be less than min: "+e+". Using min value instead."),e):i:(r&&D.warn(r+" must be a number. using max or fallback. max: "+t+", fallback: "+n),pt(n||t,e,t,r))}var Wl=class{constructor(e){var t,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};P(this,"bucketSize",100),P(this,"refillRate",10),P(this,"mutationBuckets",{}),P(this,"loggedTracker",{}),P(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]})}),P(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]}),P(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)}),P(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=pt((t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=pt((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},Ke=Uint8Array,Me=Uint16Array,lr=Uint32Array,Ru=new Ke([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]),Mu=new Ke([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]),nh=new Ke([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lf=function(i,e){for(var t=new Me(31),r=0;r<31;++r)t[r]=e+=1<<i[r-1];var n=new lr(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]},uf=lf(Ru,2),M0=uf[0],Gl=uf[1];M0[28]=258,Gl[258]=28;for(Jl=lf(Mu,0)[1],go=new Me(32768),te=0;te<32768;++te)jt=(43690&te)>>>1|(21845&te)<<1,jt=(61680&(jt=(52428&jt)>>>2|(13107&jt)<<2))>>>4|(3855&jt)<<4,go[te]=((65280&jt)>>>8|(255&jt)<<8)>>>1;var jt,Jl,go,te,un=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[go[u]>>>a]=c}else for(o=new Me(r),n=0;n<r;++n)o[n]=go[l[i[n]-1]++]>>>15-i[n];return o},bi=new Ke(288);for(te=0;te<144;++te)bi[te]=8;for(te=144;te<256;++te)bi[te]=9;for(te=256;te<280;++te)bi[te]=7;for(te=280;te<288;++te)bi[te]=8;var mo=new Ke(32);for(te=0;te<32;++te)mo[te]=5;var O0=un(bi,9,0),F0=un(mo,5,0),cf=function(i){return(i/8>>0)+(7&i&&1)},df=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var r=new(i instanceof Me?Me:i instanceof lr?lr:Ke)(t-e);return r.set(i.subarray(e,t)),r},xt=function(i,e,t){t<<=7&e;var r=e/8>>0;i[r]|=t,i[r+1]|=t>>>8},en=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},vl=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 Ke(0),0];if(n==1){var o=new Ke(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(O,q){return O.f-q.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=Xl(t[d-1],h,0);if(g>e){r=0;var v=0,b=g-e,w=1<<b;for(s.sort(function(O,q){return h[q.s]-h[O.s]||O.f-q.f});r<n;++r){var _=s[r].s;if(!(h[_]>e))break;v+=w-(1<<g-h[_]),h[_]=e}for(v>>>=b;v>0;){var k=s[r].s;h[k]<e?v-=1<<e-h[k]++-1:++r}for(;r>=0&&v;--r){var S=s[r].s;h[S]==e&&(--h[S],++v)}g=e}return[new Ke(h),g]},Xl=function(i,e,t){return i.s==-1?Math.max(Xl(i.l,e,t+1),Xl(i.r,e,t+1)):e[i.s]=t},sh=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]},tn=function(i,e){for(var t=0,r=0;r<e.length;++r)t+=i[r]*e[r];return t},Zl=function(i,e,t){var r=t.length,n=cf(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)},oh=function(i,e,t,r,n,s,o,l,a,c,d){xt(e,d++,t),++n[256];for(var u=vl(n,15),p=u[0],h=u[1],g=vl(s,15),v=g[0],b=g[1],w=sh(p),_=w[0],k=w[1],S=sh(v),O=S[0],q=S[1],U=new Me(19),R=0;R<_.length;++R)U[31&_[R]]++;for(R=0;R<O.length;++R)U[31&O[R]]++;for(var B=vl(U,7),V=B[0],we=B[1],ce=19;ce>4&&!V[nh[ce-1]];--ce);var Fe,J,Y,de,Le=c+5<<3,Be=tn(n,bi)+tn(s,mo)+o,ae=tn(n,p)+tn(s,v)+o+14+3*ce+tn(U,V)+(2*U[16]+3*U[17]+7*U[18]);if(Le<=Be&&Le<=ae)return Zl(e,d,i.subarray(a,a+c));if(xt(e,d,1+(ae<Be)),d+=2,ae<Be){Fe=un(p,h,0),J=p,Y=un(v,b,0),de=v;var Se=un(V,we,0);for(xt(e,d,k-257),xt(e,d+5,q-1),xt(e,d+10,ce-4),d+=14,R=0;R<ce;++R)xt(e,d+3*R,V[nh[R]]);d+=3*ce;for(var Ce=[_,O],re=0;re<2;++re){var _e=Ce[re];for(R=0;R<_e.length;++R){var Ae=31&_e[R];xt(e,d,Se[Ae]),d+=V[Ae],Ae>15&&(xt(e,d,_e[R]>>>5&127),d+=_e[R]>>>12)}}}else Fe=O0,J=bi,Y=F0,de=mo;for(R=0;R<l;++R)if(r[R]>255){Ae=r[R]>>>18&31,en(e,d,Fe[Ae+257]),d+=J[Ae+257],Ae>7&&(xt(e,d,r[R]>>>23&31),d+=Ru[Ae]);var xi=31&r[R];en(e,d,Y[xi]),d+=de[xi],xi>3&&(en(e,d,r[R]>>>5&8191),d+=Mu[xi])}else en(e,d,Fe[r[R]]),d+=J[r[R]];return en(e,d,Fe[256]),d+J[256]},L0=new lr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),D0=function(){for(var i=new lr(256),e=0;e<256;++e){for(var t=e,r=9;--r;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),j0=function(){var i=4294967295;return{p:function(e){for(var t=i,r=0;r<e.length;++r)t=D0[255&t^e[r]]^t>>>8;i=t},d:function(){return 4294967295^i}}},N0=function(i,e,t,r,n){return function(s,o,l,a,c,d){var u=s.length,p=new Ke(a+u+5*(1+Math.floor(u/7e3))+c),h=p.subarray(a,p.length-c),g=0;if(!o||u<8)for(var v=0;v<=u;v+=65535){var b=v+65535;b<u?g=Zl(h,g,s.subarray(v,b)):(h[v]=d,g=Zl(h,g,s.subarray(v,u)))}else{for(var w=L0[o-1],_=w>>>13,k=8191&w,S=(1<<l)-1,O=new Me(32768),q=new Me(S+1),U=Math.ceil(l/3),R=2*U,B=function(Lo){return(s[Lo]^s[Lo+1]<<U^s[Lo+2]<<R)&S},V=new lr(25e3),we=new Me(288),ce=new Me(32),Fe=0,J=0,Y=(v=0,0),de=0,Le=0;v<u;++v){var Be=B(v),ae=32767&v,Se=q[Be];if(O[ae]=Se,q[Be]=ae,de<=v){var Ce=u-v;if((Fe>7e3||Y>24576)&&Ce>423){g=oh(s,h,0,V,we,ce,J,Y,Le,v-Le,g),Y=Fe=J=0,Le=v;for(var re=0;re<286;++re)we[re]=0;for(re=0;re<30;++re)ce[re]=0}var _e=2,Ae=0,xi=k,It=ae-Se&32767;if(Ce>2&&Be==B(v-It))for(var qf=Math.min(_,Ce)-1,Hf=Math.min(32767,v),zf=Math.min(258,Ce);It<=Hf&&--xi&&ae!=Se;){if(s[v+_e]==s[v+_e-It]){for(var At=0;At<zf&&s[v+At]==s[v+At-It];++At);if(At>_e){if(_e=At,Ae=It,At>qf)break;var Vf=Math.min(It,At-2),Wu=0;for(re=0;re<Vf;++re){var Fo=v-It+re+32768&32767,Gu=Fo-O[Fo]+32768&32767;Gu>Wu&&(Wu=Gu,Se=Fo)}}}It+=(ae=Se)-(Se=O[ae])+32768&32767}if(Ae){V[Y++]=268435456|Gl[_e]<<18|Jl[Ae];var Ju=31&Gl[_e],Xu=31&Jl[Ae];J+=Ru[Ju]+Mu[Xu],++we[257+Ju],++ce[Xu],de=v+_e,++Fe}else V[Y++]=s[v],++we[s[v]]}}g=oh(s,h,d,V,we,ce,J,Y,Le,v-Le,g)}return df(p,0,a+cf(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)},Yl=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},U0=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&&Yl(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)}},B0=function(i){return 10+(i.filename&&i.filename.length+1||0)};function pf(i,e){e===void 0&&(e={});var t=j0(),r=i.length;t.p(i);var n=N0(i,e,B0(e),8),s=n.length;return U0(n,e),Yl(n,s-8,t.d()),Yl(n,s-4,r),n}function hf(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var r=new Ke(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 Ke(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 df(r,0,n)}var io="[SessionRecording]",Ie=Ue(io),q0=3e5,H0=[st.MouseMove,st.MouseInteraction,st.Scroll,st.ViewportResize,st.Input,st.TouchMove,st.MediaInteraction,st.Drag],ah=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1});function hi(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}(pf(hf(JSON.stringify(i))),!0)}function lh(i){return i.type===Et.Custom&&i.data.tag==="sessionIdle"}function uh(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}var Kl=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return N==null||(e=N.__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(io+" 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:q0}get isSampled(){var e=this.instance.get_property(on);return vi(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(Cl),t=!this.instance.config.disable_session_recording;return m&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(Np),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(Bp),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:pt(d,0,12,"canvas recording fps"),quality:pt(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(Up),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=he(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(vi(l)?l:r?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(qp);return ze(e)?e:null}get minimumDuration(){var e=this.instance.get_property(Hp);return ze(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":ee(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":vi(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(pl))===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(hl))===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(P(this,"queuedRRWebEvents",[]),P(this,"isIdle",!1),P(this,"_linkedFlagSeen",!1),P(this,"_lastActivityTimestamp",Date.now()),P(this,"_linkedFlag",null),P(this,"_removePageViewCaptureHook",void 0),P(this,"_onSessionIdListener",void 0),P(this,"_persistDecideOnSessionListener",void 0),P(this,"_samplingSessionListener",void 0),P(this,"_urlTriggers",[]),P(this,"_urlBlocklist",[]),P(this,"_urlBlocked",!1),P(this,"_eventTriggers",[]),P(this,"_removeEventTriggerCaptureHook",void 0),P(this,"_forceAllowLocalhostNetworkCapture",!1),P(this,"_onBeforeUnload",()=>{this._flushBuffer()}),P(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),P(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),P(this,"_onVisibilityChange",()=>{if(M!=null&&M.visibilityState){var n="window "+M.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Ie.error("started without valid sessionManager"),new Error(io+" 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&&Ie.warn("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),m?.addEventListener("beforeunload",this._onBeforeUnload),m?.addEventListener("offline",this._onOffline),m?.addEventListener("online",this._onOnline),m?.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),ee(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var r=t!=null&&t.properties.$current_url?this._maskUrl(t?.properties.$current_url):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(n){Ie.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(hl),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(pl))}))):this.stopRecording()}stopRecording(){var e,t,r,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,m?.removeEventListener("beforeunload",this._onBeforeUnload),m?.removeEventListener("offline",this._onOffline),m?.removeEventListener("online",this._onOnline),m?.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,Ie.info("stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if(ze(n)){var s,o=this.isSampled,l=r||!vi(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):Ie.warn("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({[on]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[on]:null})}}onRemoteConfig(e){var t,r,n,s,o,l;if(this._persistRemoteConfig(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=Ee(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,c=Ee(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((d,u)=>{var p=he(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(){ze(this.sampleRate)&&ee(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistRemoteConfig(e){if(this.instance.persistence){var t,r=this.instance.persistence,n=()=>{var s,o,l,a,c,d,u,p,h=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,g=ee(h)?null:parseFloat(h),v=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;r.register({[Cl]:!!e.sessionRecording,[Np]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[Up]:E({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[Bp]:{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},[qp]:g,[Hp]:F(v)?null:v,[zp]:(p=e.sessionRecording)===null||p===void 0?void 0:p.scriptConfig})};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=N.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,this.scriptName,n=>{if(n)return Ie.error("could not load recorder",n);this._onScriptLoaded()}),Ie.info("starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,r;return((e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0||(r=t.get_property(zp))===null||r===void 0?void 0:r.script)||"recorder"}isInteractiveEvent(e){var t;return e.type===3&&H0.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}):Ie.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(ah(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(ah(()=>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=E({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 Wl(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");Ie.info(c,{node:a}),this.log(io+" "+c,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(E({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 Ie.error("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=N.__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=N.__PosthogExtensions__)===null||r===void 0||(n=r.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ze(l)&&(!u0.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(R0(this.instance.config,this.networkPayloadCapture))):Ie.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&he(e)){if(e.type===Et.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===Et.Custom&&u.data.tag==="recording paused"}(e)){e.type===Et.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Et.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&&he(p)&&p.type===6&&he(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||lh(s)){if(lh(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(ho(u)<1024)return u;try{if(u.type===Et.FullSnapshot)return E(E({},u),{},{data:hi(u.data),cv:"2024-10"});if(u.type===Et.IncrementalSnapshot&&u.data.source===st.Mutation)return E(E({},u),{},{cv:"2024-10",data:E(E({},u.data),{},{texts:hi(u.data.texts),attributes:hi(u.data.attributes),removes:hi(u.data.removes),adds:hi(u.data.adds)})});if(u.type===Et.IncrementalSnapshot&&u.data.source===st.StyleSheetRule)return E(E({},u),{},{cv:"2024-10",data:E(E({},u.data),{},{adds:hi(u.data.adds),removes:hi(u.data.removes)})})}catch(p){Ie.error("could not compress event - will use uncompressed event",p)}return u}(s):s,d={$snapshot_bytes:ho(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&&m){var e=this._maskUrl(m.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=ze(t)&&t>=0,n=ze(e)&&r&&t<e;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Bl(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(m!==void 0&&m.location.href){var e=m.location.href,t=this.status==="paused",r=uh(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),uh(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"?pl:hl]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;this.status!=="paused"&&(this._urlBlocked=!0,M==null||(e=M.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout(()=>{this._flushBuffer()},100),Ie.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;this.status==="paused"&&(this._urlBlocked=!1,M==null||(e=M.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"}),Ie.info("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){Ie.error("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({[on]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Ie.info(e.replace("_"," "),t),z(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},Nt=Ue("[Decide]"),Ql=class{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}_loadRemoteConfigJs(e){var t,r,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.loadExternalDependency?(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"remote-config",()=>e(N._POSTHOG_CONFIG)):(Nt.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}call(){var e=!!this.instance.config.advanced_disable_decide;if(e||this.instance.featureFlags.resetRequestQueue(),this.instance.config.__preview_remote_config)return N._POSTHOG_CONFIG?(Nt.info("Using preloaded remote config",N._POSTHOG_CONFIG),void this.onRemoteConfig(N._POSTHOG_CONFIG)):e?void Nt.warn("Remote config is disabled. Falling back to local config."):void this._loadRemoteConfigJs(r=>{if(!r)return Nt.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(n=>{this.onRemoteConfig(n)});this.onRemoteConfig(r)});if(!e){var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(er),group_properties:this.instance.get_property(Bt),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:t,compression:this.instance.config.disable_compression?void 0:ot.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:r=>this.parseDecideResponse(r.json)})}}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},t),!t)return M&&M.body?void this.instance._onRemoteConfig(e):(Nt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500));Nt.error("Failed to fetch feature flags from PostHog.")}onRemoteConfig(e){if(e){if(!M||!M.body)return Nt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.onRemoteConfig(e)},500);this.instance._onRemoteConfig(e),e.hasFeatureFlags!==!1&&(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags.reloadFeatureFlags())}else Nt.error("Failed to fetch remote config from PostHog.")}},St,z0=m!=null&&m.location?co(m.location.hash,"__posthog")||co(location.hash,"state"):null,ch="_postHogToolbarParams";(function(i){i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED"})(St||(St={}));var eu=class{constructor(e){this.instance=e}setToolbarState(e){N.ph_toolbar_state=e}getToolbarState(){var e;return(e=N.ph_toolbar_state)!==null&&e!==void 0?e:St.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(!m||!M)return!1;r=(e=r)!==null&&e!==void 0?e:m.location,s=(t=s)!==null&&t!==void 0?t:m.history;try{if(!n){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}n=m?.localStorage}var o,l=z0||co(r.hash,"__posthog")||co(r.hash,"state"),a=l?Op(()=>JSON.parse(atob(decodeURIComponent(l))))||Op(()=>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(ch)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){(N.ph_load_toolbar||N.ph_load_editor)(e,this.instance)}loadToolbar(e){var t=!(M==null||!M.getElementById(Oh));if(!m||t)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=E(E({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(m.localStorage.setItem(ch,JSON.stringify(E(E({},n),{},{source:void 0}))),this.getToolbarState()===St.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===St.UNINITIALIZED){var s,o;this.setToolbarState(St.LOADING),(s=N.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return D.error("[Toolbar] Failed to load",l),void this.setToolbarState(St.UNINITIALIZED);this.setToolbarState(St.LOADED),this._callLoadToolbar(n)}),Ct(m,"turbolinks:load",()=>{this.setToolbarState(St.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)}},tu=class{constructor(e){P(this,"isPaused",!0),P(this,"queue",[]),P(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(E(E({},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&&le(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]=E(E({},n),{},{data:[]})),(r=e[s].data)===null||r===void 0||r.push(n.data)}),this.queue=[],e}},V0=!!kl||!!xl,dh="text/plain",vo=(i,e)=>{var[t,r]=i.split("?"),n=E({},e);r?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=c0(n);return s=s?(r?r+"&":"")+s:r,"".concat(t,"?").concat(s)},Ys=(i,e)=>JSON.stringify(i,(t,r)=>typeof r=="bigint"?r.toString():r,e),_l=i=>{var{data:e,compression:t}=i;if(e){if(t===ot.GZipJS){var r=pf(hf(Ys(e)),{mtime:0}),n=new Blob([r],{type:dh});return{contentType:dh,body:n,estimatedSize:n.size}}if(t===ot.Base64){var s=function(a){var c,d,u,p,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",v=0,b=0,w="",_=[];if(!a)return a;a=t0(a);do c=(h=a.charCodeAt(v++)<<16|a.charCodeAt(v++)<<8|a.charCodeAt(v++))>>18&63,d=h>>12&63,u=h>>6&63,p=63&h,_[b++]=g.charAt(c)+g.charAt(d)+g.charAt(u)+g.charAt(p);while(v<a.length);switch(w=_.join(""),a.length%3){case 1:w=w.slice(0,-2)+"==";break;case 2:w=w.slice(0,-1)+"="}return w}(Ys(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Ys(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=Ys(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},cn=[];kl&&cn.push({transport:"XHR",method:i=>{var e,t=new kl;t.open(i.method||"GET",i.url,!0);var{contentType:r,body:n}=(e=_l(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)}}),xl&&cn.push({transport:"fetch",method:i=>{var e,t,{contentType:r,body:n,estimatedSize:s}=(e=_l(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(Rp){var c=new Rp;a={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}xl(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){D.error(g)}(p=i.callback)===null||p===void 0||p.call(i,h)})).catch(d=>{var u;D.error(d),(u=i.callback)===null||u===void 0||u.call(i,{statusCode:0,text:d})}).finally(()=>a?clearTimeout(a.timeout):null)}}),Ve!=null&&Ve.sendBeacon&&cn.push({transport:"sendBeacon",method:i=>{var e=vo(i.url,{beacon:"1"});try{var t,{contentType:r,body:n}=(t=_l(i))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:r}):n;Ve.sendBeacon(e,s)}catch{}}});var W0=["retriesPerformedSoFar"],iu=class{constructor(e){P(this,"isPolling",!1),P(this,"pollIntervalMs",3e3),P(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!F(m)&&"onLine"in m.navigator&&(this.areWeOnline=m.navigator.onLine,m.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),m.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){var{retriesPerformedSoFar:t}=e,r=Ch(e,W0);ze(t)&&t>0&&(r.url=vo(r.url,{retry_count:t})),this.instance._send_request(E(E({},r),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(E({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)"),D.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(E(E({},e),{},{transport:"sendBeacon"}))}catch(t){D.error(t)}this.queue=[]}},_i,ph=Ue("[SessionId]"),ru=class{constructor(e,t,r){var n;if(P(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Ht,this._windowIdGenerator=r||Ht;var s=this.config.persistence_name||this.config.token,o=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pt(o,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var l=ke.parse(this._window_id_storage_key),a=ke.parse(this._primary_window_exists_storage_key);l&&!a?this._windowId=l:ke.remove(this._window_id_storage_key),ke.set(this._primary_window_exists_storage_key,!0)}if((n=this.config.bootstrap)!==null&&n!==void 0&&n.sessionID)try{var c=(d=>{var u=d.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(d){ph.error("Invalid sessionID in bootstrap",d)}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&&ke.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ke.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?ke.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({[oo]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[oo];return le(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){m?.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&ke.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=ze(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(),ph.info("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"})(_i||(_i={}));var hh="i.posthog.com",nu=class{constructor(e){P(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(hh),".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]=_i.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=_i.EU:this._regionCache[this.apiHost]=_i.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===_i.CUSTOM)return this.apiHost+t;var r=hh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}},ff="posthog-js";function gf(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};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 su=class{constructor(e,t,r,n,s){this.name=ff,this.setupOnce=function(o){o(gf(e,{organization:t,projectId:r,prefix:n,severityAllowList:s}))}}},fh,_o,nt,yl=Ue("[SegmentIntegration]");function G0(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()||Ht();r.config.get_device_id=c,a.id()&&(r.register({distinct_id:a.id(),$device_id:c()}),r.persistence.set_property(kt,"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||yl.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()||(yl.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(yl.info("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 ou=class{constructor(e){this._instance=e}doPageView(e){var t,r=this._previousPageViewProperties(e);return this._currentPath=(t=m?.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:pt(l/o,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:o<=1?1:pt(a/o,0,1),$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:c<=1?1:pt(d/c,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:c<=1?1:pt(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"})(fh||(fh={})),function(i){i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link"}(_o||(_o={})),function(i){i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question"}(nt||(nt={}));var yo=class{constructor(){P(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)}},au=class i{constructor(e){P(this,"_debugEventEmitter",new yo),P(this,"checkStep",(t,r)=>this.checkStepEvent(t,r)&&this.checkStepUrl(t,r)&&this.checkStepElement(t,r)),P(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!!m&&sr(e,t);case"exact":return t===e;case"contains":var n=i.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return sr(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}},mn=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 au(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 v=this.actionToSurveys.get(g.name);v&&v.push(r.id),this.actionToSurveys.set(g.name,v||[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[zs])||[];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[zs])||[];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({[zs]:[...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[zs];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};P(mn,"SURVEY_SHOWN_EVENT_NAME","survey shown");var mf,oe,vf,mi,gh,_f,lu,yf,uu={},bf=[],J0=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ou=Array.isArray;function zt(i,e){for(var t in e)i[t]=e[t];return i}function wf(i){var e=i.parentNode;e&&e.removeChild(i)}function bl(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??++vf,__i:-1,__u:0};return n==null&&oe.vnode!=null&&oe.vnode(s),s}function Fu(i){return i.children}function ro(i,e){this.props=i,this.context=e}function ur(i,e){if(e==null)return i.__?ur(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"?ur(i):null}function xf(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 xf(i)}}function cu(i){(!i.__d&&(i.__d=!0)&&mi.push(i)&&!bo.__r++||gh!==oe.debounceRendering)&&((gh=oe.debounceRendering)||_f)(bo)}function bo(){var i,e,t,r,n,s,o,l,a;for(mi.sort(lu);i=mi.shift();)i.__d&&(e=mi.length,r=void 0,s=(n=(t=i).__v).__e,l=[],a=[],(o=t.__P)&&((r=zt({},n)).__v=n.__v+1,oe.vnode&&oe.vnode(r),Sf(o,r,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??ur(n),!!(32&n.__u),a),r.__.__k[r.__i]=r,Y0(l,r,a),r.__e!=s&&xf(r)),mi.length>e&&mi.sort(lu));bo.__r=0}function kf(i,e,t,r,n,s,o,l,a,c,d){var u,p,h,g,v,b=r&&r.__k||bf,w=e.length;for(t.__d=a,X0(t,e,b),a=t.__d,u=0;u<w;u++)(h=t.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(p=h.__i===-1?uu:b[h.__i]||uu,h.__i=u,Sf(i,h,p,n,s,o,l,a,c,d),g=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Lu(p.ref,null,h),d.push(h.ref,h.__c||g,h)),v==null&&g!=null&&(v=g),65536&h.__u||p.__k===h.__k?a=Ef(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=v}function X0(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?bl(null,n,null,null,n):Ou(n)?bl(Fu,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?bl(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=i,n.__b=i.__b+1,l=Z0(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=ur(s)),du(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=ur(s)),du(s,s))}function Ef(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=Ef(r[n],e,t));return e}return i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e),e&&e.nextSibling}function Z0(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 mh(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||J0.test(e)?t:t+"px"}function Ks(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||mh(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||mh(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?_h:vh,s)):i.removeEventListener(e,s?_h:vh,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 vh(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 _h(i){return this.l[i.type+!0](oe.event?oe.event(i):i)}function Sf(i,e,t,r,n,s,o,l,a,c){var d,u,p,h,g,v,b,w,_,k,S,O,q,U,R,B=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 B=="function")try{if(w=e.props,_=(d=B.contextType)&&r[d.__c],k=d?_?_.props.value:d.__:r,t.__c?b=(u=e.__c=t.__c).__=u.__E:("prototype"in B&&B.prototype.render?e.__c=u=new B(w,k):(e.__c=u=new ro(w,k),u.constructor=B,u.render=Q0),_&&_.sub(u),u.props=w,u.state||(u.state={}),u.context=k,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),B.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=zt({},u.__s)),zt(u.__s,B.getDerivedStateFromProps(w,u.__s))),h=u.props,g=u.state,u.__v=e,p)B.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(B.getDerivedStateFromProps==null&&w!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,k),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,k)===!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(V){V&&(V.__=e)}),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,k),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,v)})}if(u.context=k,u.props=w,u.__P=i,u.__e=!1,O=oe.__r,q=0,"prototype"in B&&B.prototype.render){for(u.state=u.__s,u.__d=!1,O&&O(e),d=u.render(u.props,u.state,u.context),U=0;U<u._sb.length;U++)u.__h.push(u._sb[U]);u._sb=[]}else do u.__d=!1,O&&O(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++q<25);u.state=u.__s,u.getChildContext!=null&&(r=zt(zt({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(v=u.getSnapshotBeforeUpdate(h,g)),kf(i,Ou(R=d!=null&&d.type===Fu&&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),b&&(u.__E=u.__=null)}catch(V){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(V,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=K0(t.__e,e,t,r,n,s,o,a,c);(d=oe.diffed)&&d(e)}function Y0(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)Lu(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 K0(i,e,t,r,n,s,o,l,a){var c,d,u,p,h,g,v,b=t.props,w=e.props,_=e.type;if(_==="svg"&&(n=!0),s!=null){for(c=0;c<s.length;c++)if((h=s[c])&&"setAttribute"in h==!!_&&(_?h.localName===_:h.nodeType===3)){i=h,s[c]=null;break}}if(i==null){if(_===null)return document.createTextNode(w);i=n?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,w.is&&w),s=null,l=!1}if(_===null)b===w||l&&i.data===w||(i.data=w);else{if(s=s&&mf.call(i.childNodes),b=t.props||uu,!l&&s!=null)for(b={},c=0;c<i.attributes.length;c++)b[(h=i.attributes[c]).name]=h.value;for(c in b)h=b[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=h:c==="key"||c in w||Ks(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"?v=h:c==="key"||l&&typeof h!="function"||b[c]===h||Ks(i,c,h,b[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=""),kf(i,Ou(p)?p:[p],e,t,r,n&&_!=="foreignObject",s,o,s?s[0]:t.__k&&ur(t,0),l,a),s!=null)for(c=s.length;c--;)s[c]!=null&&wf(s[c]);l||(c="value",g!==void 0&&(g!==i[c]||_==="progress"&&!g||_==="option"&&g!==b[c])&&Ks(i,c,g,b[c],!1),c="checked",v!==void 0&&v!==i[c]&&Ks(i,c,v,b[c],!1))}return i}function Lu(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){oe.__e(r,t)}}function du(i,e,t){var r,n;if(oe.unmount&&oe.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||Lu(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]&&du(r[n],e,t||typeof i.type!="function");t||i.__e==null||wf(i.__e),i.__=i.__e=i.__d=void 0}function Q0(i,e,t){return this.constructor(i,t)}mf=bf.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}},vf=0,ro.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=zt({},this.state),typeof i=="function"&&(i=i(zt({},t),this.props)),i&&zt(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),cu(this))},ro.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),cu(this))},ro.prototype.render=Fu,mi=[],_f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,lu=function(i,e){return i.__v.__b-e.__v.__b},bo.__r=0,yf=0;(function(i,e){var t={__c:e="__cC"+yf++,__: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,cu(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 rn=Ue("[Surveys]"),ev={icontains:i=>!!m&&m.location.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:i=>!!m&&m.location.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:i=>!!m&&sr(m.location.href,i),not_regex:i=>!!m&&!sr(m.location.href,i),exact:i=>m?.location.href===i,is_not:i=>m?.location.href!==i},pu=class{constructor(e){this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(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=N==null||(e=N.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new mn(this.instance)),(t=N.__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 rn.error("Could not load surveys script",s);this._surveyManager=(o=N.__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 mn(this.instance));var r=this.instance.get_property(Il);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,v,b,w,_,k,S,O;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||(v=g.values)===null||v===void 0?void 0:v.length)>0||((b=c.conditions)===null||b===void 0?void 0:b.actions)&&((w=c.conditions)===null||w===void 0||(_=w.actions)===null||_===void 0?void 0:_.values)&&((k=c.conditions)===null||k===void 0||(S=k.actions)===null||S===void 0||(O=S.values)===null||O===void 0?void 0:O.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({[Il]: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||ev[(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||M?.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,v,b,w,_,k;if(!(a.linked_flag_key||a.targeting_flag_key||a.internal_targeting_flag_key||(c=a.feature_flag_keys)!==null&&c!==void 0&&c.length))return!0;var S=!a.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),O=!a.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key),q=((d=a.conditions)===null||d===void 0?void 0:d.events)&&((u=a.conditions)===null||u===void 0||(p=u.events)===null||p===void 0?void 0:p.values)&&((h=a.conditions)===null||h===void 0||(g=h.events)===null||g===void 0?void 0:g.values.length)>0,U=((v=a.conditions)===null||v===void 0?void 0:v.actions)&&((b=a.conditions)===null||b===void 0||(w=b.actions)===null||w===void 0?void 0:w.values)&&((_=a.conditions)===null||_===void 0||(k=_.actions)===null||k===void 0?void 0:k.values.length)>0,R=!q&&!U||o?.includes(a.id),B=this._canActivateRepeatedly(a),V=!(a.internal_targeting_flag_key&&!B)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key),we=this.checkFlags(a);return S&&O&&V&&R&&we});return e(l)},t)}checkFlags(e){var t;return(t=e.feature_flag_keys)===null||t===void 0||!t.length||e.feature_flag_keys.every(r=>{var{key:n,value:s}=r;return!n||!s||this.instance.featureFlags.isFeatureEnabled(s)})}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?nt.End:o;if(s.branching.type===nt.End)return nt.End;if(s.branching.type===nt.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===nt.ResponseBased){if(s.type===_o.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===nt.End?nt.End:o}}else if(s.type===_o.Rating){var u,p;if(typeof r!="number"||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(v,b){if(b===3){if(v<1||v>3)throw new Error("The response must be in range 1-3");return v===1?"negative":v===2?"neutral":"positive"}if(b===5){if(v<1||v>5)throw new Error("The response must be in range 1-5");return v<=2?"negative":v===3?"neutral":"positive"}if(b===7){if(v<1||v>7)throw new Error("The response must be in range 1-7");return v<=3?"negative":v===4?"neutral":"positive"}if(b===10){if(v<0||v>10)throw new Error("The response must be in range 0-10");return v<=6?"detractors":v<=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===nt.End?nt.End:o}}return o}return rn.warn("Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return ee((t=N.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(rn.warn("init was not called"),!1):N.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){ee(this._surveyManager)?rn.warn("init was not called"):this.getSurveys(t=>{var r=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(r)})}renderSurvey(e,t){ee(this._surveyManager)?rn.warn("init was not called"):this.getSurveys(r=>{var n=r.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,M?.querySelector(t))})}},yh=Ue("[RateLimiter]"),hu=class{constructor(e){var t,r;P(this,"serverLimits",{}),P(this,"lastEventRateLimited",!1),P(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{yh.info("".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void yh.warn('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(Tl))!==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(Tl,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},tv=()=>E({initialPathName:je?.pathname||"",referringDomain:se.referringDomain()},se.campaignParams()),fu=class{constructor(e,t,r){P(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[Al]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=r||tv,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[Al]}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}:{}}},iv=["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;"],bh=function(i,e){if(!i)return!1;var t=i.toLowerCase();return iv.concat(e||[]).some(r=>{var n=r.toLowerCase();return t.indexOf(n)!==-1})},Cf=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&bh(t,e))return!0;try{var r=i?.userAgentData;if(r!=null&&r.brands&&r.brands.some(n=>bh(n?.brand,e)))return!0}catch{}return!!i.webdriver},wo=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}},Qs=Ue("[Dead Clicks]"),rv=()=>!0,nv=i=>{var e,t=!((e=i.instance.persistence)===null||e===void 0||!e.get_property(Mh)),r=i.instance.config.capture_dead_clicks;return vi(r)?r:t},xo=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Mh]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,r,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"dead-clicks-autocapture",s=>{s?Qs.error("failed to load script",s):e()})}start(){var e;if(M){if(!this._lazyLoadedDeadClicksAutocapture&&(e=N.__PosthogExtensions__)!==null&&e!==void 0&&e.initDeadClicksAutocapture){var t=he(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=N.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(M),Qs.info("starting...")}}else Qs.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Qs.info("stopping..."))}},sv=Ue("[Heatmaps]"),gu=class{constructor(e){var t;P(this,"rageclicks",new wo),P(this,"_enabledServerSide",!1),P(this,"_initialized",!1),P(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Sl]),m?.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var e=5e3;return he(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;sv.info("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()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Sl]: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(){m&&M&&(Ct(M,"click",e=>this._onClick(e||m?.event),!1,!0),Ct(M,"mousemove",e=>this._onMouseMove(e||m?.event),!1,!0),this.deadClicksCapture=new xo(this.instance,rv,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&&Co(d)&&!Vt(d,"body");){if(d===c)return!1;if(z(a,m?.getComputedStyle(d).position))return!0;d=tf(d)}return!1}(ef(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(!Qp(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(E(E({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){Qp(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(m){var t=m.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!Ki(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},mu=class{constructor(e){P(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(){m?.addEventListener("scroll",this._updateScrollData,!0),m?.addEventListener("scrollend",this._updateScrollData,!0),m?.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return m?.document.documentElement;var e=le(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=m?.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 m&&(m.scrollY||m.pageYOffset||m.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return m&&(m.scrollX||m.pageXOffset||m.document.documentElement.scrollLeft)||0}},wh=Ue("[AutoCapture]");function wl(i,e){return e.length>i?e.slice(0,i)+"...":e}function ov(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!Co(e));return e}function av(i,e,t,r){var n=i.tagName.toLowerCase(),s={tag_name:n};ql.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=wl(1024,of(i)):s.$el_text=wl(1024,$o(i)));var o=fo(i);o.length>0&&(s.classes=o.filter(function(d){return d!==""})),K(i.attributes,function(d){var u;if((!rf(i)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!e&&ar(d.value)&&(u=d.name,!Ee(u)||u.substring(0,10)!=="_ngcontent"&&u.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=Pu(p).join(" ")),s["attr__"+d.name]=wl(1024,p)}});for(var l=1,a=1,c=i;c=ov(c);)l++,c.tagName===i.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function lv(i,e){for(var t,r,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,c=[i],d=i;d.parentNode&&!Vt(d,"body");)Kh(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var u,p=[],h={},g=!1,v=!1;if(K(c,S=>{var O=Hl(S);S.tagName.toLowerCase()==="a"&&(g=S.getAttribute("href"),g=O&&g&&ar(g)&&g),z(fo(S),"ph-no-capture")&&(v=!0),p.push(av(S,s,o,l));var q=function(U){if(!Hl(U))return{};var R={};return K(U.attributes,function(B){if(B.name&&B.name.indexOf("data-ph-capture-attribute")===0){var V=B.name.replace("data-ph-capture-attribute-",""),we=B.value;V&&we&&ar(we)&&(R[V]=we)}}),R}(S);Re(h,q)}),v)return{props:{},explicitNoCapture:v};if(o||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?p[0].$el_text=of(i):p[0].$el_text=$o(i)),g){var b,w;p[0].attr__href=g;var _=(b=ir(g))===null||b===void 0?void 0:b.host,k=m==null||(w=m.location)===null||w===void 0?void 0:w.host;_&&k&&_!==k&&(u=g)}return{props:Re({$event_type:n.type,$ce_version:1},a?{}:{$elements:p},{$elements_chain:$0(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 vu=class{constructor(e){P(this,"_initialized",!1),P(this,"_isDisabledServerSide",null),P(this,"rageclicks",new wo),P(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=he(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(m&&M){var e=r=>{r=r||m?.event;try{this._captureEvent(r)}catch(n){wh.error("Failed to capture event",n)}},t=r=>{r=r||m?.event,this._captureEvent(r,dl)};Ct(M,"submit",e,!1,!0),Ct(M,"change",e,!1,!0),Ct(M,"click",e,!1,!0),this.config.capture_copied_text&&(Ct(M,"copy",t,!1,!0),Ct(M,"cut",t,!1,!0))}}else wh.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Fp]:!!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=M?.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[Fp],n=this._isDisabledServerSide;if(Wt(n)&&!vi(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=ef(e);Yh(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===dl;if(n&&x0(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=lv(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===dl){var c,d=Qh(m==null||(c=m.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(M?.querySelectorAll)}},uv=Ue("[TracingHeaders]"),_u=class{constructor(e){P(this,"_restoreXHRPatch",void 0),P(this,"_restoreFetchPatch",void 0),P(this,"_startCapturing",()=>{var t,r,n,s;F(this._restoreXHRPatch)&&((t=N.__PosthogExtensions__)===null||t===void 0||(r=t.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),F(this._restoreFetchPatch)&&((n=N.__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=N.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"tracing-headers",s=>{if(s)return uv.error("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)}},qt;(function(i){i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED"})(qt||(qt={}));var yu=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?qt.DENIED:this.storedConsent}isOptedOut(){return this.consent===qt.DENIED||this.consent===qt.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"?qt.GRANTED:e==="0"?qt.DENIED:qt.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?ve:$t;var t=e==="localStorage"?$t:ve;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&&!!Ph([Ve?.doNotTrack,Ve?.msDoNotTrack,N.doNotTrack],e=>z([!0,1,"1","yes"],e))}},eo=Ue("[ExceptionAutocapture]"),bu=class{constructor(e){var t;P(this,"originalOnUnhandledRejectionHandler",void 0),P(this,"startCapturing",()=>{var r,n,s,o;if(m&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=N.__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){eo.error("failed to start",c),this.stopCapturing()}else eo.error("failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[Lp]),this.startIfEnabled()}get isEnabled(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}get isCapturing(){var e;return!(m==null||(e=m.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(eo.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,r;this.hasHandlers&&e(),(t=N.__PosthogExtensions__)===null||t===void 0||(r=t.loadExternalDependency)===null||r===void 0||r.call(t,this.instance,"exception-autocapture",n=>{if(n)return eo.error("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)}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[Lp]: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)}},fi=Ue("[Web Vitals]"),xh=9e5,wu=class{constructor(e){var t;P(this,"_enabledServerSide",!1),P(this,"_initialized",!1),P(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),P(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((r,n)=>E(E({},r),{},{["$web_vitals_".concat(n.name,"_event")]:E({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),P(this,"_addToBuffer",r=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(F(s))fi.error("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)?fi.error("Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?fi.error("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(E(E({},r),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),P(this,"_startCapturing",()=>{var r,n,s,o,l=N.__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):fi.error("web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Dp]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=he(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[jp])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(he(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=he(this.instance.config.capture_performance)&&ze(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:xh;return 0<e&&e<=6e4?xh:e}get isEnabled(){var e=he(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return vi(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(fi.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=he(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=he(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Dp]:t}),this.instance.persistence.register({[jp]:r})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,r,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(r=N.__PosthogExtensions__)===null||r===void 0||(n=r.loadExternalDependency)===null||n===void 0||n.call(r,this.instance,"web-vitals",s=>{s?fi.error("failed to load script",s):e()})}_currentURL(){var e=m?m.location.href:void 0;return e||fi.error("Could not determine current URL"),e}},cv={icontains:(i,e)=>!!m&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!m&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!m&&sr(e.href,i),not_regex:(i,e)=>!!m&&!sr(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i},xu=class i{constructor(e){var t=this;P(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){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.instance.getFeatureFlag(s.feature_flag_key);Ee(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(r=>{this.onFeatureFlags(r)})}onFeatureFlags(e){if(this._is_bot())i.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(ee(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();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)}})}}previewWebExperiment(){var e=i.getWindowLocation();if(e!=null&&e.search){var t=uo(e?.search,"__experiment_id"),r=uo(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||cv[(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 m?.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=se.campaignParams();if(r.utm_source){var n,s,o,l,a,c,d,u,p,h,g,v,b,w,_,k,S=(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,O=(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,q=(p=e.conditions)===null||p===void 0||(h=p.utm)===null||h===void 0||!h.utm_medium||((g=e.conditions)===null||g===void 0||(v=g.utm)===null||v===void 0?void 0:v.utm_medium)==r.utm_medium,U=(b=e.conditions)===null||b===void 0||(w=b.utm)===null||w===void 0||!w.utm_term||((_=e.conditions)===null||_===void 0||(k=_.utm)===null||k===void 0?void 0:k.utm_term)==r.utm_term;return S&&q&&U&&O}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];D.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 Ve&&this.instance?Cf(Ve,this.instance.config.custom_blocked_useragents):void 0}},ku=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},dv=["$set_once","$set"],gi=Ue("[SiteApps]"),Eu=class{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var t,r,n,s,o,l,a;if(!e)throw new Error("Event payload is required");var c={},d=this.instance.get_property("$groups")||[],u=this.instance.get_property("$stored_group_properties")||{};for(var[p,h]of Object.entries(u))c[p]={id:d[p],type:p,properties:h};var{$set_once:g,$set:v}=e;return{event:E(E({},Ch(e,dv)),{},{properties:E(E(E({},e.properties),v?{$set:E(E({},(t=(r=e.properties)===null||r===void 0?void 0:r.$set)!==null&&t!==void 0?t:{}),v)}:{}),g?{$set_once:E(E({},(n=(s=e.properties)===null||s===void 0?void 0:s.$set_once)!==null&&n!==void 0?n:{}),g)}:{}),elements_chain:(o=(l=e.properties)===null||l===void 0?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var r=s=>{var o;for(var l of(this.apps[e.id].errored=!s,this.apps[e.id].loaded=!0,gi.info("Site app with id ".concat(e.id," ").concat(s?"loaded":"errored")),s&&this.bufferedInvocations.length&&(gi.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach(a=>{var c;return(c=t.processEvent)===null||c===void 0?void 0:c.call(t,a)})),Object.values(this.apps)))if(!l.loaded)return;(o=this.stopBuffering)===null||o===void 0||o.call(this)};try{var{processEvent:n}=e.init({posthog:this.instance,callback:s=>{r(s)}});n&&(t.processEvent=n)}catch(s){gi.error("Error while initializing PostHog app with config id ".concat(e.id),s),r(!1)}}onCapturedEvent(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{var n;(n=r.processEvent)===null||n===void 0||n.call(r,t)}catch(s){gi.error("Error while processing event ".concat(e.event," for site app ").concat(r.id),s)}}}onRemoteConfig(e){var t,r,n=this;if(le(N._POSTHOG_JS_APPS)){if(!this.isEnabled)return void gi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var s of N._POSTHOG_JS_APPS)this.setupSiteApp(s);var o;N._POSTHOG_JS_APPS.length?this.instance.on("eventCaptured",d=>this.onCapturedEvent(d)):(o=this.stopBuffering)===null||o===void 0||o.call(this)}else if((t=this.stopBuffering)===null||t===void 0||t.call(this),(r=e.siteApps)!==null&&r!==void 0&&r.length)if(this.isEnabled){var l=function(d,u){var p,h;N["__$$ph_site_app_".concat(d)]=n.instance,(p=N.__PosthogExtensions__)===null||p===void 0||(h=p.loadSiteApp)===null||h===void 0||h.call(p,n.instance,u,g=>{if(g)return gi.error("Error while initializing PostHog app with config id ".concat(d),g)})};for(var{id:a,url:c}of e.siteApps)l(a,c)}else gi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},dn={},Su=()=>{},Yi="posthog",$f=!V0&&be?.indexOf("MSIE")===-1&&be?.indexOf("Mozilla")===-1,kh=()=>{var i,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=M?.location,t=e?.hostname,!!Ee(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Su,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:je&&Ee(je?.search)&&je.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:(m==null||(i=m.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;D.error(n)},get_device_id:r=>r,_onCapture:Su,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}},Eh=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=Re({},e,i);return le(i.property_blacklist)&&(F(i.property_denylist)?t.property_denylist=i.property_blacklist:le(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:D.error("Invalid value for property_denylist config: "+i.property_denylist)),t},Cu=class{constructor(){P(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){D.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},ko=class i{constructor(){P(this,"webPerformance",new Cu),P(this,"version",Ut.LIB_VERSION),P(this,"_internalEventEmitter",new yo),this.config=kh(),this.decideEndpointWasHit=!1,this.SentryIntegration=su,this.sentryIntegration=e=>function(t,r){var n=gf(t,r);return{name:ff,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new Ol(this),this.toolbar=new eu(this),this.scrollManager=new mu(this),this.pageViewManager=new ou(this),this.surveys=new pu(this),this.experiments=new xu(this),this.exceptions=new ku(this),this.rateLimiter=new hu(this),this.requestRouter=new nu(this),this.consent=new yu(this),this.people={set:(e,t,r)=>{var n=Ee(e)?{[e]:t}:e;this.setPersonProperties(n),r?.({})},set_once:(e,t,r)=>{var n=Ee(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),r?.({})}},this.on("eventCaptured",e=>D.info('send "'.concat(e?.event,'"'),e))}init(e,t,r){if(r&&r!==Yi){var n,s=(n=dn[r])!==null&&n!==void 0?n:new i;return s._init(e,t,r),dn[r]=s,dn[Yi][r]=s,s}return this._init(e,t,r)}_init(e){var t,r,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(F(e)||Mp(e))return D.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 D.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],s.person_profiles&&(this._initialPersonProfilesConfig=s.person_profiles),this.set_config(Re({},kh(),Eh(s),{name:o,token:e})),this.config.on_xhr_error&&D.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:ot.GZipJS,this.persistence=new ln(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ln(E(E({},this.config),{},{persistence:"sessionStorage"}));var l=E({},this.persistence.props),a=E({},this.sessionPersistence.props);if(this._requestQueue=new tu(_=>this._send_retriable_request(_)),this._retryQueue=new iu(this),this.__request_queue=[],this.sessionManager=new ru(this),this.sessionPropsManager=new fu(this.sessionManager,this.persistence),new _u(this).startIfEnabledOrStop(),this.siteApps=new Eu(this),(t=this.siteApps)===null||t===void 0||t.init(),this.sessionRecording=new Kl(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new vu(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new gu(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new wu(this),this.exceptionObserver=new bu(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new xo(this,nv),this.deadClicksAutocapture.startIfEnabled(),Ut.DEBUG=Ut.DEBUG||this.config.debug,Ut.DEBUG&&D.info("Starting in debug mode",{this:this,config:s,thisC:E({},this.config),p:l,s:a}),this._sync_opt_out_with_persistence(),((r=s.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var c,d,u=this.config.get_device_id(Ht()),p=(c=s.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?u:s.bootstrap.distinctID;this.persistence.set_property(kt,(d=s.bootstrap)!==null&&d!==void 0&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var h,g,v=Object.keys(((h=s.bootstrap)===null||h===void 0?void 0:h.featureFlags)||{}).filter(_=>{var k,S;return!((k=s.bootstrap)===null||k===void 0||(S=k.featureFlags)===null||S===void 0||!S[_])}).reduce((_,k)=>{var S,O;return _[k]=((S=s.bootstrap)===null||S===void 0||(O=S.featureFlags)===null||O===void 0?void 0:O[k])||!1,_},{}),b=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(_=>v[_]).reduce((_,k)=>{var S,O,q,U;return(S=s.bootstrap)!==null&&S!==void 0&&(O=S.featureFlagPayloads)!==null&&O!==void 0&&O[k]&&(_[k]=(q=s.bootstrap)===null||q===void 0||(U=q.featureFlagPayloads)===null||U===void 0?void 0:U[k]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:b})}if(!this.get_distinct_id()){var w=this.config.get_device_id(Ht());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(kt,"anonymous")}return m==null||(n=m.addEventListener)===null||n===void 0||n.call(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?G0(this,()=>this._loaded()):this._loaded(),Ze(this.config._onCapture)&&this.config._onCapture!==Su&&(D.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this}_onRemoteConfig(e){var t,r,n,s,o,l,a,c,d;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=z(e.supportedCompression,ot.GZipJS)?ot.GZipJS:z(e.supportedCompression,ot.Base64)?ot.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.siteApps)===null||r===void 0||r.onRemoteConfig(e),(n=this.sessionRecording)===null||n===void 0||n.onRemoteConfig(e),(s=this.autocapture)===null||s===void 0||s.onRemoteConfig(e),(o=this.heatmaps)===null||o===void 0||o.onRemoteConfig(e),(l=this.surveys)===null||l===void 0||l.onRemoteConfig(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.onRemoteConfig(e),(c=this.exceptionObserver)===null||c===void 0||c.onRemoteConfig(e),(d=this.deadClicksAutocapture)===null||d===void 0||d.onRemoteConfig(e)}_loaded(){this.config.advanced_disable_decide||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){D.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new Ql(this).call()}_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()||tr(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&&($f?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=vo(e.url,{ip:this.config.ip?1:0}),e.headers=E({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(t=>{var r,n,s,o=E({},t);o.timeout=o.timeout||6e4,o.url=vo(o.url,{_:new Date().getTime().toString(),ver:Ut.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"XHR",a=(n=(s=Ph(cn,c=>c.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:cn[0].method;if(!a)throw new Error("No available transport method");a(o)})(E(E({},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=[];tr(e,l=>{l&&(t=l[0],le(t)?s.push(l):Ze(l)?l.call(this):le(l)&&t==="alias"?r.push(l):le(l)&&t.indexOf("capture")!==-1&&Ze(this[t])?s.push(l):n.push(l))});var o=function(l,a){tr(l,function(c){if(le(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)&&Ee(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:Ht(),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=e0(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=E(E({},a.properties.$set),a.$set);if(Ki(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}D.critical("This capture call is ignored due to client rate limiting.")}}else D.error("No event name provided to posthog.capture")}else D.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=E({},t);if(s.token=this.config.token,e==="$snapshot"){var o=E(E({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ee(s.distinct_id)&&!ze(s.distinct_id)||Mp(s.distinct_id))&&D.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l=se.properties();if(this.sessionManager){var{sessionId:a,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=a,s.$window_id=c}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===_i.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=Re(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=Re(s,u)}if(e==="$pageview"&&M&&(s.title=M.title),!F(n)){var p=r.getTime()-n;s.$duration=parseFloat((p/1e3).toFixed(3))}be&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Re({},l,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),le(this.config.property_denylist)?K(this.config.property_denylist,function(v){delete s[v]}):D.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=Re({},this.persistence.get_initial_props(),e||{}),r=this.config.sanitize_properties;return r&&(t=r(t,"$set_once")),Ki(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 D.uninitializedWarning("posthog.identify");if(ze(e)&&(e=e.toString(),D.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()))D.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(nn)&&(this.unregister(nn),this.register({distinct_id:e}));var o=(this.persistence.get_property(kt)||"anonymous")==="anonymous";e!==n&&o?(this.persistence.set_property(kt,"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(ao))}}else D.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:E(E({},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 D.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(D.info("reset"),!this.__loaded)return D.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(kt,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId();var a=this.config.get_device_id(Ht());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(Rh)?(D.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(nn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(D.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,r,n,s,o=E({},this.config);he(e)&&(Re(this.config,Eh(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 ln(E(E({},this.config),{},{persistence:"sessionStorage"})),ve.is_supported()&&ve.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Ut.DEBUG=!0,D.info("set_config",{config:e,oldConfig:o,newConfig:E({},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=N.__PosthogExtensions__)===null||r===void 0?void 0:r.parseErrorAsProperties)?N.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):E({$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:Yi;return t!==Yi&&(t=Yi+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(kt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(kt))==="identified"}_hasPersonProcessing(){var e,t,r,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ki(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[nn])&&((r=this.persistence)===null||r===void 0||(n=r.props)===null||n===void 0||!n[lo]))}_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"?(D.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(lo,!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?Cf(Ve,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){M&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:M.title},{send_instantly:!0}))}debug(e){e===!1?(m?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(m?.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=le(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 Km(e.event)?D.warn("".concat(s,". This can cause unexpected behavior.")):D.info(s),null}r.properties&&!Ki(r.properties)||D.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]]=Qm(i.prototype[e[t]])})(ko,["identify"]);var Sh,If=(Sh=dn[Yi]=new ko,function(){function i(){i.done||(i.done=!0,$f=!1,K(dn,function(e){e._dom_loaded()}))}M!=null&&M.addEventListener&&(M.readyState==="complete"?i():M.addEventListener("DOMContentLoaded",i,!1)),m&&Ct(m,"load",i,!0)}(),Sh);var Af=If.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 Oe(i,e){if(!Af)throw new Error("Failed to initialize PostHog");Af.capture(i,e)}var Ao,yn,To,Gt,Pf,Io,vn=class vn extends G(H){constructor(){super();y(this,Gt);y(this,Ao,new Dt(this,{onError:console.error}));y(this,yn);y(this,To,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Oe("ShopAssistant: error",t),pe("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Oe("ShopAssistant: user received bot message (streaming started)",t),pe("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Oe("ShopAssistant: user received bot message (streaming ended)",t),pe("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Oe("ShopAssistant: user canceled streaming",t),pe("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Oe("ShopAssistant: user clicked link",t),pe("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Oe("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,yn)||f(this,Ao).data}render(){return this.config?A`
|
|
607
|
+
`)).length,n=0;n<i;n++){var o=r.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),Gt(l)||(t>e&&(s+=r.substring(e,t)),s+=l,e=t=n+1)}return t>e&&(s+=r.substring(e,r.length)),s},Ct=function(){function r(e){return e&&(e.preventDefault=r.preventDefault,e.stopPropagation=r.stopPropagation),e}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(t,i,!!s);else{var o="on"+t,l=e[o];e[o]=function(a,c,p){return function(u){if(u=u||r(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,i,l)}else D.error("No valid element provided to register_event")}}();function Th(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}var Ph="$people_distinct_id",ln="__alias",un="__timers",Md="$autocapture_disabled_server_side",kl="$heatmaps_enabled_server_side",Fd="$exception_capture_enabled_server_side",Ld="$web_vitals_enabled_server_side",Rh="$dead_clicks_enabled_server_side",Dd="$web_vitals_allowed_metrics",Sl="$session_recording_enabled_server_side",jd="$console_log_recording_enabled_server_side",Nd="$session_recording_network_payload_capture",Ud="$session_recording_canvas_recording",qd="$replay_sample_rate",Bd="$replay_minimum_duration",Hd="$replay_script_config",co="$sesid",cn="$session_is_sampled",cl="$session_recording_url_trigger_activated_session",pl="$session_recording_event_trigger_activated_session",ri="$enabled_feature_flags",El="$early_access_features",ii="$stored_person_properties",Bt="$stored_group_properties",Cl="$surveys",Js="$surveys_activated",po="$flag_call_reported",kt="$user_state",$l="$client_session_props",Il="$capture_rate_limit",Al="$initial_campaign_params",Tl="$initial_referrer_info",Pl="$initial_person_info",ho="$epp",Oh="__POSTHOG_TOOLBAR__",e0=[Ph,ln,"__cmpns",un,Sl,kl,co,ri,kt,El,Bt,ii,Cl,po,$l,Il,Al,Tl,ho],Xs=qe("[FeatureFlags]"),dl="$active_feature_flags",Zs="$override_feature_flags",zd="$feature_flag_payloads",Vd=r=>{var e={};for(var[t,i]of so(r||{}))i&&(e[t]=i);return e},Rl=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(ri),t=this.instance.get_property(Zs);if(!t)return e||{};for(var i=Oe({},e),n=Object.keys(t),s=0;s<n.length;s++)i[n[s]]=t[n[s]];return this._override_warning||(Xs.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}getFlagPayloads(){return this.instance.get_property(zd)||{}}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(ii),i=this.instance.get_property(Bt),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:i,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 i,n=this.getFlagVariants()[e],s="".concat(n),o=this.instance.get_property(po)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(le(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register({[po]:o}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}Xs.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);Xs.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 i=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(le(c)){var u={};if(c)for(var d=0;d<c.length;d++)u[c[d]]=!0;o&&o.register({[dl]:c,[ri]:u})}else{var h=c,g=p;s.errorsWhileComputingFlags&&(h=k(k({},l),h),g=k(k({},a),g)),o&&o.register({[dl]:Object.keys(Vd(h)),[ri]:h||{},[zd]:g||{}})}})(e,this.instance.persistence,i,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 Xs.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,e===!1)this.instance.persistence.unregister(Zs);else if(le(e)){for(var i={},n=0;n<e.length;n++)i[e[n]]=!0;this.instance.persistence.register({[Zs]:i})}else this.instance.persistence.register({[Zs]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,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=k(k({},this.getFlagVariants()),{},{[e]:t});(i=this.instance.persistence)===null||i===void 0||i.register({[dl]:Object.keys(Vd(s)),[ri]:s}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(El);if(i&&!t)return e(i);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({[El]:o}),e(o)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,n)=>(i[n]=t[n],i),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:i}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(n=>n(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(ii)||{};this.instance.register({[ii]:k(k({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(ii)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Bt)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(n=>{i[n]=k(k({},i[n]),e[n]),delete e[n]}),this.instance.register({[Bt]:k(k({},i),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(Bt)||{};this.instance.register({[Bt]:k(k({},t),{},{[e]:{}})})}else this.instance.unregister(Bt)}};Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return We(r)&&isFinite(r)&&Math.floor(r)===r});var Wd="0123456789abcdef",Ol=class r{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(n)||e<0||t<0||i<0||n<0||e>0xffffffffffff||t>4095||i>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|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new r(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Wd.charAt(this.bytes[t]>>>4)+Wd.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 r(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}},Ml=class{constructor(){P(this,"timestamp",0),P(this,"counter",0),P(this,"random",new Fl)}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 Ol.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())}},Gd,Mh=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};v&&!F(v.crypto)&&crypto.getRandomValues&&(Mh=r=>crypto.getRandomValues(r));var Fl=class{constructor(){P(this,"buffer",new Uint32Array(8)),P(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(Mh(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},zt=()=>t0().toString(),t0=()=>(Gd||(Gd=new Ml)).generate(),r0="Thu, 01 Jan 1970 00:00:00 GMT",nn="",i0=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function n0(r,e){if(e){var t=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:O;if(nn)return nn;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var o=n.split("."),l=Math.min(o.length,8),a="dmn_chk_"+zt(),c=new RegExp("(^|;)\\s*"+a+"=1");!nn&&l--;){var p=o.slice(l).join("."),u=a+"=1;domain=."+p;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+r0,nn=p)}return nn}(r);if(!t){var i=(n=>{var s=n.match(i0);return s?s[0]:""})(r);i!==t&&D.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var $t={is_supported:()=>!!O,error:function(r){D.error("cookieStore error: "+r)},get:function(r){if(O){try{for(var e=r+"=",t=O.cookie.split(";").filter(s=>s.length),i=0;i<t.length;i++){for(var n=t[i];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(r){var e;try{e=JSON.parse($t.get(r))||{}}catch{}return e},set:function(r,e,t,i,n){if(O)try{var s="",o="",l=n0(O.location.hostname,i);if(t){var a=new Date;a.setTime(a.getTime()+24*t*60*60*1e3),s="; expires="+a.toUTCString()}n&&(o="; secure");var c=r+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&D.warn("cookieStore warning: large cookie, len="+c.length),O.cookie=c,c}catch{return}},remove:function(r,e){try{$t.set(r,"",-1,e)}catch{return}}},hl=null,ye={is_supported:function(){if(!Gt(hl))return hl;var r=!0;if(F(v))r=!1;else try{var e="__mplssupport__";ye.set(e,"xyz"),ye.get(e)!=='"xyz"'&&(r=!1),ye.remove(e)}catch{r=!1}return r||D.error("localStorage unsupported; falling back to cookie store"),hl=r,r},error:function(r){D.error("localStorage error: "+r)},get:function(r){try{return v?.localStorage.getItem(r)}catch(e){ye.error(e)}return null},parse:function(r){try{return JSON.parse(ye.get(r))||{}}catch{}return null},set:function(r,e){try{v?.localStorage.setItem(r,JSON.stringify(e))}catch(t){ye.error(t)}},remove:function(r){try{v?.localStorage.removeItem(r)}catch(e){ye.error(e)}}},s0=["distinct_id",co,cn,ho,Pl],Ks=k(k({},ye),{},{parse:function(r){try{var e={};try{e=$t.parse(r)||{}}catch{}var t=Oe(e,JSON.parse(ye.get(r)||"{}"));return ye.set(r,t),t}catch{}return null},set:function(r,e,t,i,n,s){try{ye.set(r,e,void 0,void 0,s);var o={};s0.forEach(l=>{e[l]&&(o[l]=e[l])}),Object.keys(o).length&&$t.set(r,o,t,i,n,s)}catch(l){ye.error(l)}},remove:function(r,e){try{v?.localStorage.removeItem(r),$t.remove(r,e)}catch(t){ye.error(t)}}}),Ys={},o0={is_supported:function(){return!0},error:function(r){D.error("memoryStorage error: "+r)},get:function(r){return Ys[r]||null},parse:function(r){return Ys[r]||null},set:function(r,e){Ys[r]=e},remove:function(r){delete Ys[r]}},hr=null,Se={is_supported:function(){if(!Gt(hr))return hr;if(hr=!0,F(v))hr=!1;else try{var r="__support__";Se.set(r,"xyz"),Se.get(r)!=='"xyz"'&&(hr=!1),Se.remove(r)}catch{hr=!1}return hr},error:function(r){D.error("sessionStorage error: ",r)},get:function(r){try{return v?.sessionStorage.getItem(r)}catch(e){Se.error(e)}return null},parse:function(r){try{return JSON.parse(Se.get(r))||null}catch{}return null},set:function(r,e){try{v?.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){Se.error(t)}},remove:function(r){try{v?.sessionStorage.removeItem(r)}catch(e){Se.error(e)}}},a0=["localhost","127.0.0.1"],si=r=>{var e=O?.createElement("a");return F(e)?null:(e.href=r,e)},li=function(r,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(r)},l0=function(r){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",n=[];return K(r,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(i)},fo=function(r,e){for(var t,i=((r.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){t=s;break}}if(!le(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{D.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},go=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Qe="Mobile",mo="iOS",dt="Android",mn="Tablet",Fh=dt+" "+mn,Lh="iPad",Dh="Apple",jh=Dh+" Watch",vn="Safari",ui="BlackBerry",Nh="Samsung",Uh=Nh+"Browser",qh=Nh+" Internet",br="Chrome",u0=br+" OS",Bh=br+" "+mo,Eu="Internet Explorer",Hh=Eu+" "+Qe,Cu="Opera",c0=Cu+" Mini",$u="Edge",zh="Microsoft "+$u,oi="Firefox",Vh=oi+" "+mo,yn="Nintendo",_n="PlayStation",ai="Xbox",Wh=dt+" "+Qe,Gh=Qe+" "+vn,pn="Windows",Ll=pn+" Phone",Jd="Nokia",Dl="Ouya",Jh="Generic",p0=Jh+" "+Qe.toLowerCase(),Xh=Jh+" "+mn.toLowerCase(),jl="Konqueror",Re="(\\d+(\\.\\d+)?)",fl=new RegExp("Version/"+Re),d0=new RegExp(ai,"i"),h0=new RegExp(_n+" \\w+","i"),f0=new RegExp(yn+" \\w+","i"),Iu=new RegExp(ui+"|PlayBook|BB10","i"),g0={"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"},m0=(r,e)=>e&&z(e,Dh)||function(t){return z(t,vn)&&!z(t,br)&&!z(t,dt)}(r),Xd=function(r,e){return e=e||"",z(r," OPR/")&&z(r,"Mini")?c0:z(r," OPR/")?Cu:Iu.test(r)?ui:z(r,"IE"+Qe)||z(r,"WPDesktop")?Hh:z(r,Uh)?qh:z(r,$u)||z(r,"Edg/")?zh:z(r,"FBIOS")?"Facebook "+Qe:z(r,"UCWEB")||z(r,"UCBrowser")?"UC Browser":z(r,"CriOS")?Bh:z(r,"CrMo")||z(r,br)?br:z(r,dt)&&z(r,vn)?Wh:z(r,"FxiOS")?Vh:z(r.toLowerCase(),jl.toLowerCase())?jl:m0(r,e)?z(r,Qe)?Gh:vn:z(r,oi)?oi:z(r,"MSIE")||z(r,"Trident/")?Eu:z(r,"Gecko")?oi:""},v0={[Hh]:[new RegExp("rv:"+Re)],[zh]:[new RegExp($u+"?\\/"+Re)],[br]:[new RegExp("("+br+"|CrMo)\\/"+Re)],[Bh]:[new RegExp("CriOS\\/"+Re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Re)],[vn]:[fl],[Gh]:[fl],[Cu]:[new RegExp("(Opera|OPR)\\/"+Re)],[oi]:[new RegExp(oi+"\\/"+Re)],[Vh]:[new RegExp("FxiOS\\/"+Re)],[jl]:[new RegExp("Konqueror[:/]?"+Re,"i")],[ui]:[new RegExp(ui+" "+Re),fl],[Wh]:[new RegExp("android\\s"+Re,"i")],[qh]:[new RegExp(Uh+"\\/"+Re)],[Eu]:[new RegExp("(rv:|MSIE )"+Re)],Mozilla:[new RegExp("rv:"+Re)]},Zd=[[new RegExp(ai+"; "+ai+" (.*?)[);]","i"),r=>[ai,r&&r[1]||""]],[new RegExp(yn,"i"),[yn,""]],[new RegExp(_n,"i"),[_n,""]],[Iu,[ui,""]],[new RegExp(pn,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ll,""];if(new RegExp(Qe).test(e)&&!/IEMobile\b/.test(e))return[pn+" "+Qe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],n=g0[i]||"";return/arm/i.test(e)&&(n="RT"),[pn,n]}return[pn,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[mo,e.join(".")]}return[mo,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=F(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+dt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+dt+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[dt,e.join(".")]}return[dt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[u0,""]],[/Linux|debian/i,["Linux",""]]],Kd=function(r){return f0.test(r)?yn:h0.test(r)?_n:d0.test(r)?ai:new RegExp(Dl,"i").test(r)?Dl:new RegExp("("+Ll+"|WPDesktop)","i").test(r)?Ll:/iPad/.test(r)?Lh:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?jh:Iu.test(r)?ui:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(Jd,"i").test(r)?Jd:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(Qe).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?dt:Fh:dt:new RegExp("(pda|"+Qe+")","i").test(r)?p0:new RegExp(mn,"i").test(r)&&!new RegExp(mn+" pc","i").test(r)?Xh:""},Qs="https?://(.*)",y0=["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"],se={campaignParams:function(r){return O?this._campaignParamsFromUrl(O.URL,r):{}},_campaignParamsFromUrl:function(r,e){var t=y0.concat(e||[]),i={};return K(t,function(n){var s=fo(r,n);i[n]=s||null}),i},_searchEngine:function(r){return r?r.search(Qs+"google.([^/?]*)")===0?"google":r.search(Qs+"bing.com")===0?"bing":r.search(Qs+"yahoo.com")===0?"yahoo":r.search(Qs+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(r){var e=se._searchEngine(r),t=e!="yahoo"?"q":"p",i={};if(!Gt(e)){i.$search_engine=e;var n=O?fo(O.referrer,t):"";n.length&&(i.ph_keyword=n)}return i},searchInfo:function(){var r=O?.referrer;return r?this._searchInfoFromReferrer(r):{}},browser:Xd,browserVersion:function(r,e){var t=Xd(r,e),i=v0[t];if(F(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=r.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var r=this.browserLanguage();return typeof r=="string"?r.split("-")[0]:void 0},os:function(r){for(var e=0;e<Zd.length;e++){var[t,i]=Zd[e],n=t.exec(r),s=n&&(Ye(i)?i(n,r):i);if(s)return s}return["",""]},device:Kd,deviceType:function(r){var e=Kd(r);return e===Lh||e===Fh||e==="Kobo"||e==="Kindle Fire"||e===Xh?mn:e===yn||e===ai||e===_n||e===Dl?"Console":e===jh?"Wearable":e?Qe:"Desktop"},referrer:function(){return O?.referrer||"$direct"},referringDomain:function(){var r;return O!=null&&O.referrer&&((r=si(O.referrer))===null||r===void 0?void 0:r.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:Ne?.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(r){var e,{r:t,u:i}=r,n={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=si(t))===null||e===void 0?void 0:e.host};if(i){n.$initial_current_url=i;var s=si(i);n.$initial_host=s?.host,n.$initial_pathname=s?.pathname,K(this._campaignParamsFromUrl(i),function(o,l){n["$initial_"+xl(l)]=o})}return t&&K(this._searchInfoFromReferrer(t),function(o,l){n["$initial_"+xl(l)]=o}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){if(!we)return{};var[r,e]=se.os(we);return Oe(uo({$os:r,$os_version:e,$browser:se.browser(we,navigator.vendor),$device:se.device(we),$device_type:se.deviceType(we),$timezone:se.timezone(),$timezone_offset:se.timezoneOffset()}),{$current_url:Ne?.href,$host:Ne?.host,$pathname:Ne?.pathname,$raw_user_agent:we.length>1e3?we.substring(0,997)+"...":we,$browser_version:se.browserVersion(we,navigator.vendor),$browser_language:se.browserLanguage(),$browser_language_prefix:se.browserLanguagePrefix(),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:"web",$lib_version:qt.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[r,e]=se.os(we);return Oe(uo({$os:r,$os_version:e,$browser:se.browser(we,navigator.vendor)}),{$browser_version:se.browserVersion(we,navigator.vendor)})}},_0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],dn=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t=>{var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&D.info("Persistence loaded",e.persistence,k({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){_0.indexOf(e.persistence.toLowerCase())===-1&&(D.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&ye.is_supported()?ye:t==="localstorage+cookie"&&Ks.is_supported()?Ks:t==="sessionstorage"&&Se.is_supported()?Se:t==="memory"?o0:t==="cookie"?$t:Ks.is_supported()?Ks:$t}properties(){var e={};return K(this.props,function(t,i){if(i===ri&&fe(t))for(var n=Object.keys(t),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=t[n[s]];else l=i,a=!1,(Gt(o=e0)?a:Td&&o.indexOf===Td?o.indexOf(l)!=-1:(K(o,function(c){if(a||(a=c===l))return lo}),a))||(e[i]=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,i){if(fe(e)){F(t)&&(t="None"),this.expire_days=F(i)?this.default_expiry:i;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 i=!1;if(K(e,(n,s)=>{e.hasOwnProperty(s)&&this.props[s]!==n&&(this.props[s]=n,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=se.campaignParams(this.config.custom_campaign_params);ti(uo(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(se.searchInfo())}update_referrer_info(){this.register_once(se.referrerInfo(),void 0)}set_initial_person_info(){this.props[Al]||this.props[Tl]||this.register_once({[Pl]:se.initialPersonInfo()},void 0)}get_referrer_info(){return uo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};K([Tl,Al],n=>{var s=this.props[n];s&&K(s,function(o,l){e["$initial_"+xl(l)]=o})});var t=this.props[Pl];if(t){var i=se.initialPersonPropsFromInfo(t);Oe(e,i)}return e}safe_merge(e){return K(this.props,function(t,i){i in e||(e[i]=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 i=this.buildStorage(e),n=this.props;this.clear(),this.storage=i,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 i=this.props[un]||{};i[e]=t,this.props[un]=i,this.save()}remove_event_timer(e){var t=(this.props[un]||{})[e];return F(t)||(delete this.props[un][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function vo(r){var e,t;return((e=JSON.stringify(r,(t=[],function(i,n){if(fe(n)){for(;t.length>0&&t[t.length-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 Nl(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(r.size>=e&&r.data.length>1){var t=Math.floor(r.data.length/2),i=r.data.slice(0,t),n=r.data.slice(t);return[Nl({size:vo(i),data:i,sessionId:r.sessionId,windowId:r.windowId}),Nl({size:vo(n),data:n,sessionId:r.sessionId,windowId:r.windowId})].flatMap(s=>s)}return[r]}var St=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(St||{}),ot=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(ot||{});function Yd(r){var e;return r.id===Oh||!((e=r.closest)===null||e===void 0||!e.call(r,".toolbar-global-fade-container"))}function To(r){return!!r&&r.nodeType===1}function Wt(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function Zh(r){return!!r&&r.nodeType===3}function Kh(r){return!!r&&r.nodeType===11}function Au(r){return r?Ao(r).split(/\s+/):[]}function Qd(r){var e=v?.location.href;return!!(e&&r&&r.some(t=>e.match(t)))}function yo(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return Au(e)}function Yh(r){return Q(r)?null:Ao(r).split(/(\s+)/).filter(e=>ci(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Po(r){var e="";return ql(r)&&!tf(r)&&r.childNodes&&r.childNodes.length&&K(r.childNodes,function(t){var i;Zh(t)&&t.textContent&&(e+=(i=Yh(t.textContent))!==null&&i!==void 0?i:"")}),Ao(e)}function Qh(r){return F(r.target)?r.srcElement||null:(e=r.target)!==null&&e!==void 0&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var Ul=["a","button","form","input","select","textarea","label"];function ef(r){var e=r.parentNode;return!(!e||!To(e))&&e}function b0(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if(!v||!r||Wt(r,"html")||!To(r)||t!=null&&t.url_allowlist&&!Qd(t.url_allowlist)||t!=null&&t.url_ignorelist&&Qd(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=[r],a=!0,c=r;c.parentNode&&!Wt(c,"body");)if(Kh(c.parentNode))l.push(c.parentNode.host),c=c.parentNode.host;else{if(!(a=ef(c)))break;if(i||Ul.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 _=function(x){if(m.some(S=>x.tagName.toLowerCase()===S))return{v:!0}};for(var w of h){var y=_(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 _=function(x){if(m.some(S=>x.matches(S)))return{v:!0}};for(var w of h){var y=_(w);if(typeof y=="object")return y.v}return!1}(l,t))return!1;var u=v.getComputedStyle(r);if(u&&u.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var d=r.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&&(Ul.indexOf(d)>-1||r.getAttribute("contenteditable")==="true")}}function ql(r){for(var e=r;e.parentNode&&!Wt(e,"body");e=e.parentNode){var t=yo(e);if(z(t,"ph-sensitive")||z(t,"ph-no-capture"))return!1}if(z(yo(r),"ph-include"))return!0;var i=r.type||"";if(Ee(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=r.name||r.id||"";return!(Ee(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 tf(r){return!!(Wt(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||Wt(r,"select")||Wt(r,"textarea")||r.getAttribute("contenteditable")==="true")}var rf="(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})",w0=new RegExp("^(?:".concat(rf,")$")),x0=new RegExp(rf),nf="\\d{3}-?\\d{2}-?\\d{4}",k0=new RegExp("^(".concat(nf,")$")),S0=new RegExp("(".concat(nf,")"));function ci(r){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Q(r)||Ee(r)&&(r=Ao(r),(e?w0:x0).test((r||"").replace(/[- ]/g,""))||(e?k0:S0).test(r)))}function sf(r){var e=Po(r);return ci(e="".concat(e," ").concat(of(r)).trim())?e:""}function of(r){var e="";return r&&r.childNodes&&r.childNodes.length&&K(r.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var n=Po(t);e="".concat(e," ").concat(n).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(of(t)).trim())}catch(s){D.error("[AutoCapture]",s)}}),e}function E0(r){return function(e){var t=e.map(i=>{var n,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class)for(var l of(i.attr_class.sort(),i.attr_class))o+=".".concat(l.replace(/"/g,""));var a=k(k(k(k({},i.text?{text:i.text}:{}),{},{"nth-child":(n=i.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),c={};return so(a).sort((p,u)=>{var[d]=p,[h]=u;return d.localeCompare(h)}).forEach(p=>{var[u,d]=p;return c[eh(u.toString())]=eh(d.toString())}),o+=":",o+=so(a).map(p=>{var[u,d]=p;return"".concat(u,'="').concat(d,'"')}).join("")});return t.join(";")}(function(e){return e.map(t=>{var i,n,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.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:C0(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return so(t).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,a]=o;return s.attributes[l]=a}),s})}(r))}function eh(r){return r.replace(/"|\\"/g,'\\"')}function C0(r){var e=r.attr__class;return e?le(e)?e:Au(e):void 0}var Bl="[SessionRecording]",Hl="redacted",eo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:r=>r,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},$0=["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"],I0=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],A0=["/s/","/e/","/i/"];function th(r,e,t,i){if(Q(r))return r;var n=e?.["content-length"]||function(s){return new Blob([s]).size}(r);return Ee(n)&&(n=parseInt(n)),n>t?Bl+" ".concat(i," body too large to record (").concat(n," bytes)"):r}function rh(r,e){if(Q(r))return r;var t=r;return ci(t,!1)||(t=Bl+" "+e+" body "+Hl),K(I0,i=>{var n,s;(n=t)!==null&&n!==void 0&&n.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=Bl+" "+e+" body "+Hl+" as might contain: "+i)}),t}var T0=(r,e)=>{var t,i,n,s={payloadSizeLimitBytes:eo.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...eo.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...eo.payloadHostDenyList]},o=r.session_recording.recordHeaders!==!1&&e.recordHeaders,l=r.session_recording.recordBody!==!1&&e.recordBody,a=r.capture_performance!==!1&&e.recordPerformance,c=(t=s,n=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),d=>(d!=null&&d.requestBody&&(d.requestBody=th(d.requestBody,d.requestHeaders,n,"Request")),d!=null&&d.responseBody&&(d.responseBody=th(d.responseBody,d.responseHeaders,n,"Response")),d)),p=d=>{return c(((m,_)=>{var w,y=si(m.name),x=_.indexOf("http")===0?(w=si(_))===null||w===void 0?void 0:w.pathname:_;x==="/"&&(x="");var S=y?.pathname.replace(x||"","");if(!(y&&S&&A0.some(M=>S.indexOf(M)===0)))return m})((g=(h=d).requestHeaders,Q(g)||K(Object.keys(g??{}),m=>{$0.includes(m.toLowerCase())&&(g[m]=Hl)}),h),r.api_host));var h,g},u=Ye(r.session_recording.maskNetworkRequestFn);return u&&Ye(r.session_recording.maskCapturedNetworkRequestFn)&&D.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(r.session_recording.maskCapturedNetworkRequestFn=d=>{var h=r.session_recording.maskNetworkRequestFn({url:d.name});return k(k({},d),{},{name:h?.url})}),s.maskRequestFn=Ye(r.session_recording.maskCapturedNetworkRequestFn)?d=>{var h,g,m,_=p(d);return _&&(h=(g=(m=r.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(m,_))!==null&&h!==void 0?h:void 0}:d=>function(h){if(!F(h))return h.requestBody=rh(h.requestBody,"Request"),h.responseBody=rh(h.responseBody,"Response"),h}(p(d)),k(k(k({},eo),s),{},{recordHeaders:o,recordBody:l,recordPerformance:a,recordInitialRequests:a})};function ht(r,e,t,i,n){return e>t&&(D.warn("min cannot be greater than max."),e=t),We(r)?r>t?(i&&D.warn(i+" cannot be greater than max: "+t+". Using max value instead."),t):r<e?(i&&D.warn(i+" cannot be less than min: "+e+". Using min value instead."),e):r:(i&&D.warn(i+" must be a number. using max or fallback. max: "+t+", fallback: "+n),ht(n||t,e,t,i))}var zl=class{constructor(e){var t,i,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};P(this,"bucketSize",100),P(this,"refillRate",10),P(this,"mutationBuckets",{}),P(this,"loggedTracker",{}),P(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]})}),P(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]}),P(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)}),P(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=ht((t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=ht((i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}},et=Uint8Array,Me=Uint16Array,pi=Uint32Array,Tu=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]),Pu=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]),ih=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),af=function(r,e){for(var t=new Me(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var n=new pi(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)n[s]=s-t[i]<<5|i;return[t,n]},lf=af(Tu,2),P0=lf[0],Vl=lf[1];P0[28]=258,Vl[258]=28;for(Wl=af(Pu,0)[1],_o=new Me(32768),ee=0;ee<32768;++ee)Nt=(43690&ee)>>>1|(21845&ee)<<1,Nt=(61680&(Nt=(52428&Nt)>>>2|(13107&Nt)<<2))>>>4|(3855&Nt)<<4,_o[ee]=((65280&Nt)>>>8|(255&Nt)<<8)>>>1;var Nt,Wl,_o,ee,hn=function(r,e,t){for(var i=r.length,n=0,s=new Me(e);n<i;++n)++s[r[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<i;++n)if(r[n])for(var c=n<<4|r[n],p=e-r[n],u=l[r[n]-1]++<<p,d=u|(1<<p)-1;u<=d;++u)o[_o[u]>>>a]=c}else for(o=new Me(i),n=0;n<i;++n)o[n]=_o[l[r[n]-1]++]>>>15-r[n];return o},wr=new et(288);for(ee=0;ee<144;++ee)wr[ee]=8;for(ee=144;ee<256;++ee)wr[ee]=9;for(ee=256;ee<280;++ee)wr[ee]=7;for(ee=280;ee<288;++ee)wr[ee]=8;var bo=new et(32);for(ee=0;ee<32;++ee)bo[ee]=5;var R0=hn(wr,9,0),O0=hn(bo,5,0),uf=function(r){return(r/8>>0)+(7&r&&1)},cf=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof Me?Me:r instanceof pi?pi:et)(t-e);return i.set(r.subarray(e,t)),i},xt=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},sn=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},gl=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});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(M,B){return M.f-B.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(i=1;i<n;++i)s[i].s>d&&(d=s[i].s);var h=new Me(d+1),g=Gl(t[p-1],h,0);if(g>e){i=0;var m=0,_=g-e,w=1<<_;for(s.sort(function(M,B){return h[B.s]-h[M.s]||M.f-B.f});i<n;++i){var y=s[i].s;if(!(h[y]>e))break;m+=w-(1<<g-h[y]),h[y]=e}for(m>>>=_;m>0;){var x=s[i].s;h[x]<e?m-=1<<e-h[x]++-1:++i}for(;i>=0&&m;--i){var S=s[i].s;h[S]==e&&(--h[S],++m)}g=e}return[new et(h),g]},Gl=function(r,e,t){return r.s==-1?Math.max(Gl(r.l,e,t+1),Gl(r.r,e,t+1)):e[r.s]=t},nh=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Me(++e),i=0,n=r[0],s=1,o=function(a){t[i++]=a},l=1;l<=e;++l)if(r[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=r[l]}return[t.subarray(0,i),e]},on=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},Jl=function(r,e,t){var i=t.length,n=uf(e+2);r[n]=255&i,r[n+1]=i>>>8,r[n+2]=255^r[n],r[n+3]=255^r[n+1];for(var s=0;s<i;++s)r[n+s+4]=t[s];return 8*(n+4+i)},sh=function(r,e,t,i,n,s,o,l,a,c,p){xt(e,p++,t),++n[256];for(var u=gl(n,15),d=u[0],h=u[1],g=gl(s,15),m=g[0],_=g[1],w=nh(d),y=w[0],x=w[1],S=nh(m),M=S[0],B=S[1],U=new Me(19),R=0;R<y.length;++R)U[31&y[R]]++;for(R=0;R<M.length;++R)U[31&M[R]]++;for(var q=gl(U,7),V=q[0],xe=q[1],ce=19;ce>4&&!V[ih[ce-1]];--ce);var Le,J,Z,pe,De=c+5<<3,Be=on(n,wr)+on(s,bo)+o,ae=on(n,d)+on(s,m)+o+14+3*ce+on(U,V)+(2*U[16]+3*U[17]+7*U[18]);if(De<=Be&&De<=ae)return Jl(e,p,r.subarray(a,a+c));if(xt(e,p,1+(ae<Be)),p+=2,ae<Be){Le=hn(d,h,0),J=d,Z=hn(m,_,0),pe=m;var Ce=hn(V,xe,0);for(xt(e,p,x-257),xt(e,p+5,B-1),xt(e,p+10,ce-4),p+=14,R=0;R<ce;++R)xt(e,p+3*R,V[ih[R]]);p+=3*ce;for(var $e=[y,M],ie=0;ie<2;++ie){var _e=$e[ie];for(R=0;R<_e.length;++R){var Te=31&_e[R];xt(e,p,Ce[Te]),p+=V[Te],Te>15&&(xt(e,p,_e[R]>>>5&127),p+=_e[R]>>>12)}}}else Le=R0,J=wr,Z=O0,pe=bo;for(R=0;R<l;++R)if(i[R]>255){Te=i[R]>>>18&31,sn(e,p,Le[Te+257]),p+=J[Te+257],Te>7&&(xt(e,p,i[R]>>>23&31),p+=Tu[Te]);var kr=31&i[R];sn(e,p,Z[kr]),p+=pe[kr],kr>3&&(sn(e,p,i[R]>>>5&8191),p+=Pu[kr])}else sn(e,p,Le[i[R]]),p+=J[i[R]];return sn(e,p,Le[256]),p+J[256]},M0=new pi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F0=function(){for(var r=new pi(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r}(),L0=function(){var r=4294967295;return{p:function(e){for(var t=r,i=0;i<e.length;++i)t=F0[255&t^e[i]]^t>>>8;r=t},d:function(){return 4294967295^r}}},D0=function(r,e,t,i,n){return function(s,o,l,a,c,p){var u=s.length,d=new et(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 _=m+65535;_<u?g=Jl(h,g,s.subarray(m,_)):(h[m]=p,g=Jl(h,g,s.subarray(m,u)))}else{for(var w=M0[o-1],y=w>>>13,x=8191&w,S=(1<<l)-1,M=new Me(32768),B=new Me(S+1),U=Math.ceil(l/3),R=2*U,q=function(Uo){return(s[Uo]^s[Uo+1]<<U^s[Uo+2]<<R)&S},V=new pi(25e3),xe=new Me(288),ce=new Me(32),Le=0,J=0,Z=(m=0,0),pe=0,De=0;m<u;++m){var Be=q(m),ae=32767&m,Ce=B[Be];if(M[ae]=Ce,B[Be]=ae,pe<=m){var $e=u-m;if((Le>7e3||Z>24576)&&$e>423){g=sh(s,h,0,V,xe,ce,J,Z,De,m-De,g),Z=Le=J=0,De=m;for(var ie=0;ie<286;++ie)xe[ie]=0;for(ie=0;ie<30;++ie)ce[ie]=0}var _e=2,Te=0,kr=x,It=ae-Ce&32767;if($e>2&&Be==q(m-It))for(var Uf=Math.min(y,$e)-1,qf=Math.min(32767,m),Bf=Math.min(258,$e);It<=qf&&--kr&&ae!=Ce;){if(s[m+_e]==s[m+_e-It]){for(var At=0;At<Bf&&s[m+At]==s[m+At-It];++At);if(At>_e){if(_e=At,Te=It,At>Uf)break;var Hf=Math.min(It,At-2),zu=0;for(ie=0;ie<Hf;++ie){var No=m-It+ie+32768&32767,Vu=No-M[No]+32768&32767;Vu>zu&&(zu=Vu,Ce=No)}}}It+=(ae=Ce)-(Ce=M[ae])+32768&32767}if(Te){V[Z++]=268435456|Vl[_e]<<18|Wl[Te];var Wu=31&Vl[_e],Gu=31&Wl[Te];J+=Tu[Wu]+Pu[Gu],++xe[257+Wu],++ce[Gu],pe=m+_e,++Le}else V[Z++]=s[m],++xe[s[m]]}}g=sh(s,h,p,V,xe,ce,J,Z,De,m-De,g)}return cf(d,0,a+uf(g)+c)}(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!n)},Xl=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},j0=function(r,e){var t=e.filename;if(r[0]=31,r[1]=139,r[2]=8,r[8]=e.level<2?4:e.level==9?2:0,r[9]=3,e.mtime!=0&&Xl(r,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){r[3]=8;for(var i=0;i<=t.length;++i)r[i+10]=t.charCodeAt(i)}},N0=function(r){return 10+(r.filename&&r.filename.length+1||0)};function pf(r,e){e===void 0&&(e={});var t=L0(),i=r.length;t.p(r);var n=D0(r,e,N0(e),8),s=n.length;return j0(n,e),Xl(n,s-8,t.d()),Xl(n,s-4,i),n}function df(r,e){var t=r.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var i=new et(r.length+(r.length>>>1)),n=0,s=function(c){i[n++]=c},o=0;o<t;++o){if(n+5>i.length){var l=new et(n+8+(t-o<<1));l.set(i),i=l}var a=r.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&r.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 cf(i,0,n)}var oo="[SessionRecording]",Ae=qe(oo),U0=3e5,q0=[ot.MouseMove,ot.MouseInteraction,ot.Scroll,ot.ViewportResize,ot.Input,ot.TouchMove,ot.MediaInteraction,ot.Drag],oh=r=>({rrwebMethod:r,enqueuedAt:Date.now(),attempt:1});function fr(r){return function(e,t){for(var i="",n=0;n<e.length;){var s=e[n++];s<128||t?i+=String.fromCharCode(s):s<224?i+=String.fromCharCode((31&s)<<6|63&e[n++]):s<240?i+=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,i+=String.fromCharCode(55296|s>>10,56320|1023&s))}return i}(pf(df(JSON.stringify(r))),!0)}function ah(r){return r.type===St.Custom&&r.data.tag==="sessionIdle"}function lh(r,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(r))}var Zl=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return N==null||(e=N.__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(oo+" 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:U0}get isSampled(){var e=this.instance.get_property(cn);return yr(e)?e:null}get sessionDuration(){var e,t,i=(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 i?i.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(Sl),t=!this.instance.config.disable_session_recording;return v&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(jd),t=this.instance.config.enable_recording_console_log;return t??e}get canvasRecording(){var e,t,i,n,s,o,l=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(Ud),c=(e=(t=l?.recordCanvas)!==null&&t!==void 0?t:a?.enabled)!==null&&e!==void 0&&e,p=(i=(n=l?.canvasFps)!==null&&n!==void 0?n:a?.fps)!==null&&i!==void 0?i:0,u=(s=(o=l?.canvasQuality)!==null&&o!==void 0?o:a?.quality)!==null&&s!==void 0?s:0;return{enabled:c,fps:ht(p,0,12,"canvas recording fps"),quality:ht(u,0,1,"canvas recording quality")}}get networkPayloadCapture(){var e,t,i=this.instance.get_property(Nd),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||i?.recordHeaders,o=n?.recordBody||i?.recordBody,l=fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(yr(l)?l:i?.capturePerformance);return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(qd);return We(e)?e:null}get minimumDuration(){var e=this.instance.get_property(Bd);return We(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":Q(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":yr(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(cl))===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(pl))===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(P(this,"queuedRRWebEvents",[]),P(this,"isIdle",!1),P(this,"_linkedFlagSeen",!1),P(this,"_lastActivityTimestamp",Date.now()),P(this,"_linkedFlag",null),P(this,"_removePageViewCaptureHook",void 0),P(this,"_onSessionIdListener",void 0),P(this,"_persistDecideOnSessionListener",void 0),P(this,"_samplingSessionListener",void 0),P(this,"_urlTriggers",[]),P(this,"_urlBlocklist",[]),P(this,"_urlBlocked",!1),P(this,"_eventTriggers",[]),P(this,"_removeEventTriggerCaptureHook",void 0),P(this,"_forceAllowLocalhostNetworkCapture",!1),P(this,"_onBeforeUnload",()=>{this._flushBuffer()}),P(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),P(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),P(this,"_onVisibilityChange",()=>{if(O!=null&&O.visibilityState){var n="window "+O.visibilityState;this._tryAddCustomEvent(n,{})}}),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Ae.error("started without valid sessionManager"),new Error(oo+" started without valid sessionManager. This is a bug.");var{sessionId:t,windowId:i}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=i,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Ae.warn("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(),Q(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var i=t!=null&&t.properties.$current_url?this._maskUrl(t?.properties.$current_url):"";if(!i)return;this._tryAddCustomEvent("$pageview",{href:i})}}catch(n){Ae.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((t,i,n)=>{var s,o,l,a;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:t,windowId:i,changeReason:n}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(pl),(l=this.instance)===null||l===void 0||(a=l.persistence)===null||a===void 0||a.unregister(cl))}))):this.stopRecording()}stopRecording(){var e,t,i,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,(i=this._onSessionIdListener)===null||i===void 0||i.call(this),this._onSessionIdListener=void 0,(n=this._samplingSessionListener)===null||n===void 0||n.call(this),this._samplingSessionListener=void 0,Ae.info("stopped"))}makeSamplingDecision(e){var t,i=this.sessionId!==e,n=this.sampleRate;if(We(n)){var s,o=this.isSampled,l=i||!yr(o);l?s=Math.random()<n:s=o,l&&(s?this._reportStarted("sampled"):Ae.warn("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({[cn]:s})}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register({[cn]:null})}}onRemoteConfig(e){var t,i,n,s,o,l;if(this._persistRemoteConfig(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(l=e.sessionRecording)===null||l===void 0?void 0:l.endpoint),this._setupSampling(),!Q(this._linkedFlag)&&!this._linkedFlagSeen){var a=Ee(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,c=Ee(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((p,u)=>{var d=fe(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)&&Q(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistRemoteConfig(e){if(this.instance.persistence){var t,i=this.instance.persistence,n=()=>{var s,o,l,a,c,p,u,d,h=(s=e.sessionRecording)===null||s===void 0?void 0:s.sampleRate,g=Q(h)?null:parseFloat(h),m=(o=e.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;i.register({[Sl]:!!e.sessionRecording,[jd]:(l=e.sessionRecording)===null||l===void 0?void 0:l.consoleLogRecordingEnabled,[Nd]:k({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture),[Ud]:{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},[qd]:g,[Bd]:F(m)?null:m,[Hd]:(d=e.sessionRecording)===null||d===void 0?void 0:d.scriptConfig})};n(),(t=this._persistDecideOnSessionListener)===null||t===void 0||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(n)}}log(e){var t,i=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:i,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,i;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=N.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,this.scriptName,n=>{if(n)return Ae.error("could not load recorder",n);this._onScriptLoaded()}),Ae.info("starting"),this.status==="active"&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,i;return((e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0||(i=t.get_property(Hd))===null||i===void 0?void 0:i.script)||"recorder"}isInteractiveEvent(e){var t;return e.type===3&&q0.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 i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!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")):i&&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}):Ae.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(oh(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(oh(()=>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},i=this.instance.config.session_recording;for(var[n,s]of Object.entries(i||{}))n in t&&(n==="maskInputOptions"?t.maskInputOptions=k({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 zl(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");Ae.info(c,{node:a}),this.log(oo+" "+c,"warn")}});var o=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(k({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 Ae.error("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,i,n,s=[],o=(e=N.__PosthogExtensions__)===null||e===void 0||(t=e.rrwebPlugins)===null||t===void 0?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var l=(i=N.__PosthogExtensions__)===null||i===void 0||(n=i.rrwebPlugins)===null||n===void 0?void 0:n.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ye(l)&&(!a0.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(l(T0(this.instance.config,this.networkPayloadCapture))):Ae.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&fe(e)){if(e.type===St.Meta){var i=this._maskUrl(e.data.href);if(this._lastHref=i,!i)return;e.data.href=i}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(u){return u.type===St.Custom&&u.data.tag==="recording paused"}(e)){e.type===St.FullSnapshot&&this._scheduleFullSnapshot(),e.type===St.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&&fe(d)&&d.type===6&&fe(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||ah(s)){if(ah(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(vo(u)<1024)return u;try{if(u.type===St.FullSnapshot)return k(k({},u),{},{data:fr(u.data),cv:"2024-10"});if(u.type===St.IncrementalSnapshot&&u.data.source===ot.Mutation)return k(k({},u),{},{cv:"2024-10",data:k(k({},u.data),{},{texts:fr(u.data.texts),attributes:fr(u.data.attributes),removes:fr(u.data.removes),adds:fr(u.data.adds)})});if(u.type===St.IncrementalSnapshot&&u.data.source===ot.StyleSheetRule)return k(k({},u),{},{cv:"2024-10",data:k(k({},u.data),{},{adds:fr(u.data.adds),removes:fr(u.data.removes)})})}catch(d){Ae.error("could not compress event - will use uncompressed event",d)}return u}(s):s,p={$snapshot_bytes:vo(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 i,n={url:e};return(i=n=t.maskNetworkRequestFn(n))===null||i===void 0?void 0:i.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,i=We(t)&&t>=0,n=We(e)&&i&&t<e;return this.status==="buffering"||n?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&Nl(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,i=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+i>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",i=lh(e,this._urlBlocklist);i&&!t?this._pauseRecording():!i&&t&&this._resumeRecording(),lh(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,i;this.triggerStatus==="trigger_pending"&&((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register({[e==="url"?cl:pl]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){var e,t;this.status!=="paused"&&(this._urlBlocked=!0,O==null||(e=O.body)===null||e===void 0||(t=e.classList)===null||t===void 0||t.add("ph-no-capture"),clearInterval(this._fullSnapshotTimer),setTimeout(()=>{this._flushBuffer()},100),Ae.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){var e,t;this.status==="paused"&&(this._urlBlocked=!1,O==null||(e=O.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"}),Ae.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&Q(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(t){Ae.error("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({[cn]:!0}),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Ae.info(e.replace("_"," "),t),z(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},Ut=qe("[Decide]"),Kl=class{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}_loadRemoteConfigJs(e){var t,i,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.loadExternalDependency?(i=N.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"remote-config",()=>e(N._POSTHOG_CONFIG)):(Ut.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}call(){var e=!!this.instance.config.advanced_disable_decide;if(e||this.instance.featureFlags.resetRequestQueue(),this.instance.config.__preview_remote_config)return N._POSTHOG_CONFIG?(Ut.info("Using preloaded remote config",N._POSTHOG_CONFIG),void this.onRemoteConfig(N._POSTHOG_CONFIG)):e?void Ut.warn("Remote config is disabled. Falling back to local config."):void this._loadRemoteConfigJs(i=>{if(!i)return Ut.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(n=>{this.onRemoteConfig(n)});this.onRemoteConfig(i)});if(!e){var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(ii),group_properties:this.instance.get_property(Bt),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:t,compression:this.instance.config.disable_compression?void 0:at.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:i=>this.parseDecideResponse(i.json)})}}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},t),!t)return O&&O.body?void this.instance._onRemoteConfig(e):(Ut.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500));Ut.error("Failed to fetch feature flags from PostHog.")}onRemoteConfig(e){if(e){if(!O||!O.body)return Ut.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.onRemoteConfig(e)},500);this.instance._onRemoteConfig(e),e.hasFeatureFlags!==!1&&(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags.reloadFeatureFlags())}else Ut.error("Failed to fetch remote config from PostHog.")}},Et,B0=v!=null&&v.location?go(v.location.hash,"__posthog")||go(location.hash,"state"):null,uh="_postHogToolbarParams";(function(r){r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED"})(Et||(Et={}));var Yl=class{constructor(e){this.instance=e}setToolbarState(e){N.ph_toolbar_state=e}getToolbarState(){var e;return(e=N.ph_toolbar_state)!==null&&e!==void 0?e:Et.UNINITIALIZED}maybeLoadToolbar(){var e,t,i=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||!O)return!1;i=(e=i)!==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=B0||go(i.hash,"__posthog")||go(i.hash,"state"),a=l?Od(()=>JSON.parse(atob(decodeURIComponent(l))))||Od(()=>JSON.parse(decodeURIComponent(l))):null;return a&&a.action==="ph_authorize"?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?i.hash=a.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(n.getItem(uh)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(e){(N.ph_load_toolbar||N.ph_load_editor)(e,this.instance)}loadToolbar(e){var t=!(O==null||!O.getElementById(Oh));if(!v||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=k(k({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(v.localStorage.setItem(uh,JSON.stringify(k(k({},n),{},{source:void 0}))),this.getToolbarState()===Et.LOADED)this._callLoadToolbar(n);else if(this.getToolbarState()===Et.UNINITIALIZED){var s,o;this.setToolbarState(Et.LOADING),(s=N.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",l=>{if(l)return D.error("[Toolbar] Failed to load",l),void this.setToolbarState(Et.UNINITIALIZED);this.setToolbarState(Et.LOADED),this._callLoadToolbar(n)}),Ct(v,"turbolinks:load",()=>{this.setToolbarState(Et.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,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}},Ql=class{constructor(e){P(this,"isPaused",!0),P(this,"queue",[]),P(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),i=[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)];i.map(n=>{this.sendRequest(k(k({},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(),i=function(s){var o=t[s],l=new Date().getTime();o.data&&le(o.data)&&K(o.data,a=>{a.offset=Math.abs(a.timestamp-l),delete a.timestamp}),e.sendRequest(o)};for(var n in t)i(n)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return K(this.queue,t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;F(e[s])&&(e[s]=k(k({},n),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(n.data)}),this.queue=[],e}},H0=!!wl||!!bl,ch="text/plain",wo=(r,e)=>{var[t,i]=r.split("?"),n=k({},e);i?.split("&").forEach(o=>{var[l]=o.split("=");delete n[l]});var s=l0(n);return s=s?(i?i+"&":"")+s:i,"".concat(t,"?").concat(s)},to=(r,e)=>JSON.stringify(r,(t,i)=>typeof i=="bigint"?i.toString():i,e),ml=r=>{var{data:e,compression:t}=r;if(e){if(t===at.GZipJS){var i=pf(df(to(e)),{mtime:0}),n=new Blob([i],{type:ch});return{contentType:ch,body:n,estimatedSize:n.size}}if(t===at.Base64){var s=function(a){var c,p,u,d,h,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,_=0,w="",y=[];if(!a)return a;a=Qm(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[_++]=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}(to(e)),o=(a=>"data="+encodeURIComponent(typeof a=="string"?a:to(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=to(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},fn=[];wl&&fn.push({transport:"XHR",method:r=>{var e,t=new wl;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:n}=(e=ml(r))!==null&&e!==void 0?e:{};K(r.headers,function(s,o){t.setRequestHeader(o,s)}),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.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=r.callback)===null||s===void 0||s.call(r,o)}},t.send(n)}}),bl&&fn.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:n,estimatedSize:s}=(e=ml(r))!==null&&e!==void 0?e:{},o=new Headers;K(r.headers,function(p,u){o.append(u,p)}),i&&o.append("Content-Type",i);var l=r.url,a=null;if(Pd){var c=new Pd;a={signal:c.signal,timeout:setTimeout(()=>c.abort(),r.timeout)}}bl(l,{method:r?.method||"GET",headers:o,keepalive:r.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){D.error(g)}(d=r.callback)===null||d===void 0||d.call(r,h)})).catch(p=>{var u;D.error(p),(u=r.callback)===null||u===void 0||u.call(r,{statusCode:0,text:p})}).finally(()=>a?clearTimeout(a.timeout):null)}}),Ge!=null&&Ge.sendBeacon&&fn.push({transport:"sendBeacon",method:r=>{var e=wo(r.url,{beacon:"1"});try{var t,{contentType:i,body:n}=(t=ml(r))!==null&&t!==void 0?t:{},s=typeof n=="string"?new Blob([n],{type:i}):n;Ge.sendBeacon(e,s)}catch{}}});var z0=["retriesPerformedSoFar"],eu=class{constructor(e){P(this,"isPolling",!1),P(this,"pollIntervalMs",3e3),P(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,i=Eh(e,z0);We(t)&&t>0&&(i.url=wo(i.url,{retry_count:t})),this.instance._send_request(k(k({},i),{},{callback:n=>{var s;n.statusCode!==200&&(n.statusCode<400||n.statusCode>=500)&&(t??0)<10?this.enqueue(k({retriesPerformedSoFar:t},i)):(s=i.callback)===null||s===void 0||s.call(i,n)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=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()+i;this.queue.push({retryAt:n,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),D.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=[],i=this.queue.filter(s=>s.retryAt<e||(t.push(s),!1));if(this.queue=t,i.length>0)for(var{requestOptions:n}of i)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(k(k({},e),{},{transport:"sendBeacon"}))}catch(t){D.error(t)}this.queue=[]}},_r,ph=qe("[SessionId]"),tu=class{constructor(e,t,i){var n;if(P(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||zt,this._windowIdGenerator=i||zt;var s=this.config.persistence_name||this.config.token,o=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ht(o,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var l=Se.parse(this._window_id_storage_key),a=Se.parse(this._primary_window_exists_storage_key);l&&!a?this._windowId=l:Se.remove(this._window_id_storage_key),Se.set(this._primary_window_exists_storage_key,!0)}if((n=this.config.bootstrap)!==null&&n!==void 0&&n.sessionID)try{var c=(p=>{var u=p.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(p){ph.error("Invalid sessionID in bootstrap",p)}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,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[co]:[t,e,i]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[co];return le(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(),[i,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-i)>this.sessionTimeoutMs;c||p||l?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),ph.info("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=i===0||!e||l?t:i,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:i}}};(function(r){r.US="us",r.EU="eu",r.CUSTOM="custom"})(_r||(_r={}));var dh="i.posthog.com",ru=class{constructor(e){P(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(dh),".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]=_r.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=_r.EU:this._regionCache[this.apiHost]=_r.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===_r.CUSTOM)return this.apiHost+t;var i=dh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},hf="posthog-js";function ff(r){var{organization:e,projectId:t,prefix:i,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))||!r.__loaded)return s;s.tags||(s.tags={});var u=r.requestRouter.endpointFor("ui","/project/".concat(r.config.token,"/person/").concat(r.get_distinct_id()));s.tags["PostHog Person URL"]=u,r.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=r.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};return e&&t&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+e+"/issues/?project="+t+"&query="+s.event_id),r.exceptions.sendExceptionEvent(h),s}}var iu=class{constructor(e,t,i,n,s){this.name=hf,this.setupOnce=function(o){o(ff(e,{organization:t,projectId:i,prefix:n,severityAllowList:s}))}}},hh,xo,st,vl=qe("[SegmentIntegration]");function V0(r,e){var t=r.config.segment;if(!t)return e();(function(i,n){var s=i.config.segment;if(!s)return n();var o=a=>{var c=()=>a.anonymousId()||zt();i.config.get_device_id=c,a.id()&&(i.register({distinct_id:a.id(),$device_id:c()}),i.persistence.set_property(kt,"identified")),n()},l=s.user();"then"in l&&Ye(l.then)?l.then(a=>o(a)):o(l)})(r,()=>{t.register((i=>{Promise&&Promise.resolve||vl.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===i.get_distinct_id()||(vl.info("No userId set, resetting PostHog"),i.reset()),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(vl.info("UserId set, identifying with PostHog"),i.identify(s.event.userId));var a=i._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")}})(r)).then(()=>{e()})})}var nu=class{constructor(e){this._instance=e}doPageView(e){var t,i=this._previousPageViewProperties(e);return this._currentPath=(t=v?.location.pathname)!==null&&t!==void 0?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,i}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){var t=this._currentPath,i=this._prevPageviewTimestamp,n=this._instance.scrollManager.getContext();if(!i)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:ht(l/o,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:o<=1?1:ht(a/o,0,1),$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:c<=1?1:ht(p/c,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:c<=1?1:ht(u/c,0,1)})}return t&&(s.$prev_pageview_pathname=t),i&&(s.$prev_pageview_duration=(e.getTime()-i.getTime())/1e3),s}};(function(r){r.Popover="popover",r.API="api",r.Widget="widget"})(hh||(hh={})),function(r){r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link"}(xo||(xo={})),function(r){r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question"}(st||(st={}));var ko=class{constructor(){P(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(i=>i!==t)}}emit(e,t){for(var i of this.events[e]||[])i(t);for(var n of this.events["*"]||[])n(e,t)}},su=class r{constructor(e){P(this,"_debugEventEmitter",new ko),P(this,"checkStep",(t,i)=>this.checkStepEvent(t,i)&&this.checkStepUrl(t,i)&&this.checkStepElement(t,i)),P(this,"checkStepEvent",(t,i)=>i==null||!i.event||t?.event===i?.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((i,n)=>{this.on(i,n)})}}register(e){var t,i;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||"")})}),(i=this.instance)!==null&&i!==void 0&&i.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 i;t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&((i=this.actionRegistry)===null||i===void 0?void 0:i.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 i of t.steps)if(this.checkStep(e,i))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(t!=null&&t.url){var i,n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$current_url;if(!n||typeof n!="string"||!r.matchString(n,t?.url,t?.url_matching||"contains"))return!1}return!0}static matchString(e,t,i){switch(i){case"regex":return!!v&&li(e,t);case"exact":return t===e;case"contains":var n=r.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return li(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&&!r.matchString(s.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||s.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!r.matchString(s.text||"",t?.text,t?.text_matching||"exact")&&!r.matchString(s.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var i,n=e==null||(i=e.properties)===null||i===void 0?void 0:i.$element_selectors;if(!n||!n.includes(t?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},bn=class r{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(i=>{var n,s,o,l;return((n=i.conditions)===null||n===void 0?void 0:n.actions)&&((s=i.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 su(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(i=>{this.onAction(i)})),t.forEach(i=>{var n,s,o,l,a,c,p,u,d,h;i.conditions&&(n=i.conditions)!==null&&n!==void 0&&n.actions&&(s=i.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((l=i.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(i.conditions.actions.values),(u=i.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(i.id),this.actionToSurveys.set(g.name,m||[i.id])}}))}))}setupEventBasedSurveys(e){var t;e.filter(i=>{var n,s,o,l;return((n=i.conditions)===null||n===void 0?void 0:n.events)&&((s=i.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((i,n)=>{this.onEvent(i,n)}),e.forEach(i=>{var n,s,o;(n=i.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(i.id),this.eventToSurveys.set(l.name,a||[i.id])}})}))}onEvent(e,t){var i,n,s=((i=this.instance)===null||i===void 0||(n=i.persistence)===null||n===void 0?void 0:n.props[Js])||[];if(r.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,i,n=((t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0?void 0:i.props[Js])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,i;(t=this.instance)===null||t===void 0||(i=t.persistence)===null||i===void 0||i.register({[Js]:[...new Set(e)]})}getSurveys(){var e,t,i=(e=this.instance)===null||e===void 0||(t=e.persistence)===null||t===void 0?void 0:t.props[Js];return i||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};P(bn,"SURVEY_SHOWN_EVENT_NAME","survey shown");var gf,oe,mf,vr,fh,vf,ou,yf,au={},_f=[],W0=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ru=Array.isArray;function Vt(r,e){for(var t in e)r[t]=e[t];return r}function bf(r){var e=r.parentNode;e&&e.removeChild(r)}function yl(r,e,t,i,n){var s={type:r,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++mf,__i:-1,__u:0};return n==null&&oe.vnode!=null&&oe.vnode(s),s}function Ou(r){return r.children}function ao(r,e){this.props=r,this.context=e}function di(r,e){if(e==null)return r.__?di(r.__,r.__i+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?di(r):null}function wf(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return wf(r)}}function lu(r){(!r.__d&&(r.__d=!0)&&vr.push(r)&&!So.__r++||fh!==oe.debounceRendering)&&((fh=oe.debounceRendering)||vf)(So)}function So(){var r,e,t,i,n,s,o,l,a;for(vr.sort(ou);r=vr.shift();)r.__d&&(e=vr.length,i=void 0,s=(n=(t=r).__v).__e,l=[],a=[],(o=t.__P)&&((i=Vt({},n)).__v=n.__v+1,oe.vnode&&oe.vnode(i),Sf(o,i,n,t.__n,o.ownerSVGElement!==void 0,32&n.__u?[s]:null,l,s??di(n),!!(32&n.__u),a),i.__.__k[i.__i]=i,X0(l,i,a),i.__e!=s&&wf(i)),vr.length>e&&vr.sort(ou));So.__r=0}function xf(r,e,t,i,n,s,o,l,a,c,p){var u,d,h,g,m,_=i&&i.__k||_f,w=e.length;for(t.__d=a,G0(t,e,_),a=t.__d,u=0;u<w;u++)(h=t.__k[u])!=null&&typeof h!="boolean"&&typeof h!="function"&&(d=h.__i===-1?au:_[h.__i]||au,h.__i=u,Sf(r,h,d,n,s,o,l,a,c,p),g=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&Mu(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=kf(h,a,r):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 G0(r,e,t){var i,n,s,o,l,a=e.length,c=t.length,p=c,u=0;for(r.__k=[],i=0;i<a;i++)(n=r.__k[i]=(n=e[i])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?yl(null,n,null,null,n):Ru(n)?yl(Ou,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?yl(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=r,n.__b=r.__b+1,l=J0(n,t,o=i+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!==i+u&&(n.__u|=65536))):(s=t[i])&&s.key==null&&s.__e&&(s.__e==r.__d&&(r.__d=di(s)),uu(s,s,!1),t[i]=null,p--);if(p)for(i=0;i<c;i++)(s=t[i])!=null&&!(131072&s.__u)&&(s.__e==r.__d&&(r.__d=di(s)),uu(s,s))}function kf(r,e,t){var i,n;if(typeof r.type=="function"){for(i=r.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=r,e=kf(i[n],e,t));return e}return r.__e!=e&&(t.insertBefore(r.__e,e||null),e=r.__e),e&&e.nextSibling}function J0(r,e,t,i){var n=r.key,s=r.type,o=t-1,l=t+1,a=e[t];if(a===null||a&&n==a.key&&s===a.type)return t;if(i>(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 gh(r,e,t){e[0]==="-"?r.setProperty(e,t??""):r[e]=t==null?"":typeof t!="number"||W0.test(e)?t:t+"px"}function ro(r,e,t,i,n){var s;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof i=="string"&&(r.style.cssText=i=""),i)for(e in i)t&&e in t||gh(r.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||gh(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+s]=t,t?i?t.u=i.u:(t.u=Date.now(),r.addEventListener(e,s?vh:mh,s)):r.removeEventListener(e,s?vh:mh,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 r)try{r[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?r.removeAttribute(e):r.setAttribute(e,t))}}function mh(r){var e=this.l[r.type+!1];if(r.t){if(r.t<=e.u)return}else r.t=Date.now();return e(oe.event?oe.event(r):r)}function vh(r){return this.l[r.type+!0](oe.event?oe.event(r):r)}function Sf(r,e,t,i,n,s,o,l,a,c){var p,u,d,h,g,m,_,w,y,x,S,M,B,U,R,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)&&i[p.__c],x=p?y?y.props.value:p.__:i,t.__c?_=(u=e.__c=t.__c).__=u.__E:("prototype"in q&&q.prototype.render?e.__c=u=new q(w,x):(e.__c=u=new ao(w,x),u.constructor=q,u.render=K0),y&&y.sub(u),u.props=w,u.state||(u.state={}),u.context=x,u.__n=i,d=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),q.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Vt({},u.__s)),Vt(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,x),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,x)===!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(V){V&&(V.__=e)}),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,x),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,m)})}if(u.context=x,u.props=w,u.__P=r,u.__e=!1,M=oe.__r,B=0,"prototype"in q&&q.prototype.render){for(u.state=u.__s,u.__d=!1,M&&M(e),p=u.render(u.props,u.state,u.context),U=0;U<u._sb.length;U++)u.__h.push(u._sb[U]);u._sb=[]}else do u.__d=!1,M&&M(e),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++B<25);u.state=u.__s,u.getChildContext!=null&&(i=Vt(Vt({},i),u.getChildContext())),d||u.getSnapshotBeforeUpdate==null||(m=u.getSnapshotBeforeUpdate(h,g)),xf(r,Ru(R=p!=null&&p.type===Ou&&p.key==null?p.props.children:p)?R:[R],e,t,i,n,s,o,l,a,c),u.base=e.__e,e.__u&=-161,u.__h.length&&o.push(u),_&&(u.__E=u.__=null)}catch(V){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(V,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Z0(t.__e,e,t,i,n,s,o,a,c);(p=oe.diffed)&&p(e)}function X0(r,e,t){e.__d=void 0;for(var i=0;i<t.length;i++)Mu(t[i],t[++i],t[++i]);oe.__c&&oe.__c(e,r),r.some(function(n){try{r=n.__h,n.__h=[],r.some(function(s){s.call(n)})}catch(s){oe.__e(s,n.__v)}})}function Z0(r,e,t,i,n,s,o,l,a){var c,p,u,d,h,g,m,_=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)){r=h,s[c]=null;break}}if(r==null){if(y===null)return document.createTextNode(w);r=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,w.is&&w),s=null,l=!1}if(y===null)_===w||l&&r.data===w||(r.data=w);else{if(s=s&&gf.call(r.childNodes),_=t.props||au,!l&&s!=null)for(_={},c=0;c<r.attributes.length;c++)_[(h=r.attributes[c]).name]=h.value;for(c in _)h=_[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=h:c==="key"||c in w||ro(r,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"||_[c]===h||ro(r,c,h,_[c],n);if(p)l||u&&(p.__html===u.__html||p.__html===r.innerHTML)||(r.innerHTML=p.__html),e.__k=[];else if(u&&(r.innerHTML=""),xf(r,Ru(d)?d:[d],e,t,i,n&&y!=="foreignObject",s,o,s?s[0]:t.__k&&di(t,0),l,a),s!=null)for(c=s.length;c--;)s[c]!=null&&bf(s[c]);l||(c="value",g!==void 0&&(g!==r[c]||y==="progress"&&!g||y==="option"&&g!==_[c])&&ro(r,c,g,_[c],!1),c="checked",m!==void 0&&m!==r[c]&&ro(r,c,m,_[c],!1))}return r}function Mu(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(i){oe.__e(i,t)}}function uu(r,e,t){var i,n;if(oe.unmount&&oe.unmount(r),(i=r.ref)&&(i.current&&i.current!==r.__e||Mu(i,null,e)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){oe.__e(s,e)}i.base=i.__P=null,r.__c=void 0}if(i=r.__k)for(n=0;n<i.length;n++)i[n]&&uu(i[n],e,t||typeof r.type!="function");t||r.__e==null||bf(r.__e),r.__=r.__e=r.__d=void 0}function K0(r,e,t){return this.constructor(r,t)}gf=_f.slice,oe={__e:function(r,e,t,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(r)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(r,i||{}),o=n.__d),o)return n.__E=n}catch(l){r=l}throw r}},mf=0,ao.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Vt({},this.state),typeof r=="function"&&(r=r(Vt({},t),this.props)),r&&Vt(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),lu(this))},ao.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),lu(this))},ao.prototype.render=Ou,vr=[],vf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ou=function(r,e){return r.__v.__b-e.__v.__b},So.__r=0,yf=0;(function(r,e){var t={__c:e="__cC"+yf++,__:r,Consumer:function(i,n){return i.children(n)},Provider:function(i){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,lu(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)}}),i.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0});var an=qe("[Surveys]"),Y0={icontains:r=>!!v&&v.location.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:r=>!!v&&v.location.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:r=>!!v&&li(v.location.href,r),not_regex:r=>!!v&&!li(v.location.href,r),exact:r=>v?.location.href===r,is_not:r=>v?.location.href!==r},cu=class{constructor(e){this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var t=[],i=0;i<localStorage.length;i++){var n=localStorage.key(i);n!=null&&n.startsWith("seenSurvey_")&&t.push(n)}return t})();e.forEach(t=>localStorage.removeItem(t))}loadIfEnabled(){var e,t,i,n=N==null||(e=N.__PosthogExtensions__)===null||e===void 0?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||n||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new bn(this.instance)),(t=N.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,"surveys",s=>{var o,l;if(s)return an.error("Could not load surveys script",s);this._surveyManager=(o=N.__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 bn(this.instance));var i=this.instance.get_property(Cl);if(i&&!t)return e(i);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,_,w,y,x,S,M;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||((_=c.conditions)===null||_===void 0?void 0:_.actions)&&((w=c.conditions)===null||w===void 0||(y=w.actions)===null||y===void 0?void 0:y.values)&&((x=c.conditions)===null||x===void 0||(S=x.actions)===null||S===void 0||(M=S.values)===null||M===void 0?void 0:M.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({[Cl]:l}),e(l)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(i=>{var n,s=i.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||Y0[(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||O?.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,_,w,y,x;if(!(a.linked_flag_key||a.targeting_flag_key||a.internal_targeting_flag_key||(c=a.feature_flag_keys)!==null&&c!==void 0&&c.length))return!0;var S=!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),B=((p=a.conditions)===null||p===void 0?void 0:p.events)&&((u=a.conditions)===null||u===void 0||(d=u.events)===null||d===void 0?void 0:d.values)&&((h=a.conditions)===null||h===void 0||(g=h.events)===null||g===void 0?void 0:g.values.length)>0,U=((m=a.conditions)===null||m===void 0?void 0:m.actions)&&((_=a.conditions)===null||_===void 0||(w=_.actions)===null||w===void 0?void 0:w.values)&&((y=a.conditions)===null||y===void 0||(x=y.actions)===null||x===void 0?void 0:x.values.length)>0,R=!B&&!U||o?.includes(a.id),q=this._canActivateRepeatedly(a),V=!(a.internal_targeting_flag_key&&!q)||this.instance.featureFlags.isFeatureEnabled(a.internal_targeting_flag_key),xe=this.checkFlags(a);return S&&M&&V&&R&&xe});return e(l)},t)}checkFlags(e){var t;return(t=e.feature_flag_keys)===null||t===void 0||!t.length||e.feature_flag_keys.every(i=>{var{key:n,value:s}=i;return!n||!s||this.instance.featureFlags.isFeatureEnabled(s)})}getNextSurveyStep(e,t,i){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===xo.SingleChoice){var l,a,c=s.choices.indexOf("".concat(i));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===st.End?st.End:o}}else if(s.type===xo.Rating){var u,d;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(m,_){if(_===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(_===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(_===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(_===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")}(i,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===st.End?st.End:o}}return o}return an.warn("Falling back to next question index due to unexpected branching type"),o}_canActivateRepeatedly(e){var t;return Q((t=N.__PosthogExtensions__)===null||t===void 0?void 0:t.canActivateRepeatedly)?(an.warn("init was not called"),!1):N.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Q(this._surveyManager)?an.warn("init was not called"):this.getSurveys(t=>{var i=t.filter(n=>n.id===e)[0];this._surveyManager.canRenderSurvey(i)})}renderSurvey(e,t){Q(this._surveyManager)?an.warn("init was not called"):this.getSurveys(i=>{var n=i.filter(s=>s.id===e)[0];this._surveyManager.renderSurvey(n,O?.querySelector(t))})}},yh=qe("[RateLimiter]"),pu=class{constructor(e){var t,i;P(this,"serverLimits",{}),P(this,"lastEventRateLimited",!1),P(this,"checkForLimiting",n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{yh.info("".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void yh.warn('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(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,i,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(Il))!==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,(i=this.instance.persistence)===null||i===void 0||i.set_property(Il,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},Q0=()=>k({initialPathName:Ne?.pathname||"",referringDomain:se.referringDomain()},se.campaignParams()),du=class{constructor(e,t,i){P(this,"_onSessionIdCallback",n=>{var s=this._getStoredProps();if(!s||s.sessionId!==n){var o={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[$l]:o})}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||Q0,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[$l]}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}:{}}},ev=["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;"],_h=function(r,e){if(!r)return!1;var t=r.toLowerCase();return ev.concat(e||[]).some(i=>{var n=i.toLowerCase();return t.indexOf(n)!==-1})},Ef=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&_h(t,e))return!0;try{var i=r?.userAgentData;if(i!=null&&i.brands&&i.brands.some(n=>_h(n?.brand,e)))return!0}catch{}return!!r.webdriver},Eo=class{constructor(){this.clicks=[]}isRageClick(e,t,i){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},io=qe("[Dead Clicks]"),tv=()=>!0,rv=r=>{var e,t=!((e=r.instance.persistence)===null||e===void 0||!e.get_property(Rh)),i=r.instance.config.capture_dead_clicks;return yr(i)?i:t},Co=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Rh]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(e){var t,i,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture&&e(),(i=N.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"dead-clicks-autocapture",s=>{s?io.error("failed to load script",s):e()})}start(){var e;if(O){if(!this._lazyLoadedDeadClicksAutocapture&&(e=N.__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=N.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(O),io.info("starting...")}}else io.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,io.info("stopping..."))}},iv=qe("[Heatmaps]"),hu=class{constructor(e){var t;P(this,"rageclicks",new Eo),P(this,"_enabledServerSide",!1),P(this,"_initialized",!1),P(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[kl]),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;iv.info("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()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[kl]: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&&O&&(Ct(O,"click",e=>this._onClick(e||v?.event),!1,!0),Ct(O,"mousemove",e=>this._onMouseMove(e||v?.event),!1,!0),this.deadClicksCapture=new Co(this.instance,tv,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var i=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,a,c){for(var p=l;p&&To(p)&&!Wt(p,"body");){if(p===c)return!1;if(z(a,v?.getComputedStyle(p).position))return!0;p=ef(p)}return!1}(Qh(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:i),target_fixed:o,type:t}}_onClick(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!Yd(e.target)){var n=this._getProperties(e,i);(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(k(k({},n),{},{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){Yd(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&&!ti(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},fu=class{constructor(e){P(this,"_updateScrollData",()=>{var t,i,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,(i=this.context.maxScrollHeight)!==null&&i!==void 0?i: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=le(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var i=v?.document.querySelector(t);if(i)return i}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return 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}},bh=qe("[AutoCapture]");function _l(r,e){return e.length>r?e.slice(0,r)+"...":e}function nv(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!To(e));return e}function sv(r,e,t,i){var n=r.tagName.toLowerCase(),s={tag_name:n};Ul.indexOf(n)>-1&&!t&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=_l(1024,sf(r)):s.$el_text=_l(1024,Po(r)));var o=yo(r);o.length>0&&(s.classes=o.filter(function(p){return p!==""})),K(r.attributes,function(p){var u;if((!tf(r)||["name","id","class","aria-label"].indexOf(p.name)!==-1)&&(i==null||!i.includes(p.name))&&!e&&ci(p.value)&&(u=p.name,!Ee(u)||u.substring(0,10)!=="_ngcontent"&&u.substring(0,7)!=="_nghost")){var d=p.value;p.name==="class"&&(d=Au(d).join(" ")),s["attr__"+p.name]=_l(1024,d)}});for(var l=1,a=1,c=r;c=nv(c);)l++,c.tagName===r.tagName&&a++;return s.nth_child=l,s.nth_of_type=a,s}function ov(r,e){for(var t,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:a}=e,c=[r],p=r;p.parentNode&&!Wt(p,"body");)Kh(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,S=>{var M=ql(S);S.tagName.toLowerCase()==="a"&&(g=S.getAttribute("href"),g=M&&g&&ci(g)&&g),z(yo(S),"ph-no-capture")&&(m=!0),d.push(sv(S,s,o,l));var B=function(U){if(!ql(U))return{};var R={};return K(U.attributes,function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var V=q.name.replace("data-ph-capture-attribute-",""),xe=q.value;V&&xe&&ci(xe)&&(R[V]=xe)}}),R}(S);Oe(h,B)}),m)return{props:{},explicitNoCapture:m};if(o||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?d[0].$el_text=sf(r):d[0].$el_text=Po(r)),g){var _,w;d[0].attr__href=g;var y=(_=si(g))===null||_===void 0?void 0:_.host,x=v==null||(w=v.location)===null||w===void 0?void 0:w.host;y&&x&&y!==x&&(u=g)}return{props:Oe({$event_type:n.type,$ce_version:1},a?{}:{$elements:d},{$elements_chain:E0(d)},(t=d[0])!==null&&t!==void 0&&t.$el_text?{$el_text:(i=d[0])===null||i===void 0?void 0:i.$el_text}:{},u&&n.type==="click"?{$external_click_url:u}:{},h)}}var gu=class{constructor(e){P(this,"_initialized",!1),P(this,"_isDisabledServerSide",null),P(this,"rageclicks",new Eo),P(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,i=fe(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),i.url_ignorelist=(t=i.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),i}_addDomEventHandlers(){if(this.isBrowserSupported()){if(v&&O){var e=i=>{i=i||v?.event;try{this._captureEvent(i)}catch(n){bh.error("Failed to capture event",n)}},t=i=>{i=i||v?.event,this._captureEvent(i,ul)};Ct(O,"submit",e,!1,!0),Ct(O,"change",e,!1,!0),Ct(O,"click",e,!1,!0),this.config.capture_copied_text&&(Ct(O,"copy",t,!1,!0),Ct(O,"cut",t,!1,!0))}}else bh.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Md]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,i=[];return(t=this._elementSelectors)===null||t===void 0||t.forEach(n=>{var s=O?.querySelectorAll(n);s?.forEach(o=>{e===o&&i.push(n)})}),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Md],n=this._isDisabledServerSide;if(Gt(n)&&!yr(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var i,n=Qh(e);Zh(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!==null&&i!==void 0&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var s=t===ul;if(n&&b0(n,e,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=ov(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===ul){var c,p=Yh(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(O?.querySelectorAll)}},av=qe("[TracingHeaders]"),mu=class{constructor(e){P(this,"_restoreXHRPatch",void 0),P(this,"_restoreFetchPatch",void 0),P(this,"_startCapturing",()=>{var t,i,n,s;F(this._restoreXHRPatch)&&((t=N.__PosthogExtensions__)===null||t===void 0||(i=t.tracingHeadersPatchFns)===null||i===void 0||i._patchXHR(this.instance.sessionManager)),F(this._restoreFetchPatch)&&((n=N.__PosthogExtensions__)===null||n===void 0||(s=n.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))}),this.instance=e}_loadScript(e){var t,i,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.tracingHeadersPatchFns&&e(),(i=N.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"tracing-headers",s=>{if(s)return av.error("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)}},Ht;(function(r){r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED"})(Ht||(Ht={}));var vu=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Ht.DENIED:this.storedConsent}isOptedOut(){return this.consent===Ht.DENIED||this.consent===Ht.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"?Ht.GRANTED:e==="0"?Ht.DENIED:Ht.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?ye:$t;var t=e==="localStorage"?$t:ye;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&&!!Th([Ge?.doNotTrack,Ge?.msDoNotTrack,N.doNotTrack],e=>z([!0,1,"1","yes"],e))}},no=qe("[ExceptionAutocapture]"),yu=class{constructor(e){var t;P(this,"originalOnUnhandledRejectionHandler",void 0),P(this,"startCapturing",()=>{var i,n,s,o;if(v&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var l=(i=N.__PosthogExtensions__)===null||i===void 0||(n=i.errorWrappingFunctions)===null||n===void 0?void 0:n.wrapOnError,a=(s=N.__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){no.error("failed to start",c),this.stopCapturing()}else no.error("failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[Fd]),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&&(no.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,i;this.hasHandlers&&e(),(t=N.__PosthogExtensions__)===null||t===void 0||(i=t.loadExternalDependency)===null||i===void 0||i.call(t,this.instance,"exception-autocapture",n=>{if(n)return no.error("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)}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[Fd]: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)}},gr=qe("[Web Vitals]"),wh=9e5,_u=class{constructor(e){var t;P(this,"_enabledServerSide",!1),P(this,"_initialized",!1),P(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),P(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((i,n)=>k(k({},i),{},{["$web_vitals_".concat(n.name,"_event")]:k({},n),["$web_vitals_".concat(n.name,"_value")]:n.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),P(this,"_addToBuffer",i=>{var n,s=(n=this.instance.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0);if(F(s))gr.error("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)||(Q(i?.name)||Q(i?.value)?gr.error("Invalid metric received",i):this._maxAllowedValue&&i.value>=this._maxAllowedValue?gr.error("Ignoring metric with value >= "+this._maxAllowedValue,i):(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,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(k(k({},i),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),P(this,"_startCapturing",()=>{var i,n,s,o,l=N.__PosthogExtensions__;F(l)||F(l.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:n,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),i&&n&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&i(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):gr.error("web vitals callbacks not loaded - not starting")}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Ld]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=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(i)?((t=this.instance.persistence)===null||t===void 0?void 0:t.props[Dd])||["CLS","FCP","INP","LCP"]:i}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)&&We(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:wh;return 0<e&&e<=6e4?wh:e}get isEnabled(){var e=fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return yr(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(gr.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=fe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=fe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[Ld]:t}),this.instance.persistence.register({[Dd]:i})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,i,n;(t=N.__PosthogExtensions__)!==null&&t!==void 0&&t.postHogWebVitalsCallbacks&&e(),(i=N.__PosthogExtensions__)===null||i===void 0||(n=i.loadExternalDependency)===null||n===void 0||n.call(i,this.instance,"web-vitals",s=>{s?gr.error("failed to load script",s):e()})}_currentURL(){var e=v?v.location.href:void 0;return e||gr.error("Could not determine current URL"),e}},lv={icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!v&&li(e.href,r),not_regex:(r,e)=>!!v&&!li(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r},bu=class r{constructor(e){var t=this;P(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var i=arguments.length>0&&arguments[0]!==void 0&&arguments[0];t.getWebExperiments(n=>{r.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,n.forEach(s=>{if(s.feature_flag_key){var o;t._flagToExperiments&&(r.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.instance.getFeatureFlag(s.feature_flag_key);Ee(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];r.matchesTestVariant(c)&&t.applyTransforms(s.name,a,c.transforms)}})},i)}),this.instance=e,this.instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}onFeatureFlags(e){if(this._is_bot())r.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(Q(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();r.logInfo("applying feature flags",e),e.forEach(t=>{var i;if(this._flagToExperiments&&(i=this._flagToExperiments)!==null&&i!==void 0&&i.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)}})}}previewWebExperiment(){var e=r.getWindowLocation();if(e!=null&&e.search){var t=fo(e?.search,"__experiment_id"),i=fo(e?.search,"__experiment_variant");t&&i&&(r.logInfo("previewing web experiments ".concat(t," && ").concat(i)),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(t),i,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.instance.config.disable_web_experiments&&!i)return e([]);var 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,i){var n=i.filter(s=>s.id===e);n&&n.length>0&&(r.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!Q(e.conditions)&&r.matchUrlConditions(e)&&r.matchUTMConditions(e)}static matchUrlConditions(e){var t;if(Q(e.conditions)||Q((t=e.conditions)===null||t===void 0?void 0:t.url))return!0;var i,n,s,o=r.getWindowLocation();return!!o&&((i=e.conditions)===null||i===void 0||!i.url||lv[(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(Q(e.conditions)||Q((t=e.conditions)===null||t===void 0?void 0:t.utm))return!0;var i=se.campaignParams();if(i.utm_source){var n,s,o,l,a,c,p,u,d,h,g,m,_,w,y,x,S=(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)==i.utm_campaign,M=(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)==i.utm_source,B=(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)==i.utm_medium,U=(_=e.conditions)===null||_===void 0||(w=_.utm)===null||w===void 0||!w.utm_term||((y=e.conditions)===null||y===void 0||(x=y.utm)===null||x===void 0?void 0:x.utm_term)==i.utm_term;return S&&B&&U&&M}return!1}static logInfo(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];D.info("[WebExperiments] ".concat(e),i)}applyTransforms(e,t,i,n){var s;this._is_bot()?r.logInfo("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach(o=>{if(o.selector){var l;r.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=r.getWindowLocation())===null||a===void 0?void 0:a.href,$web_experiment_elements_modified:c})}}):(r.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=r.getWindowLocation())===null||s===void 0?void 0:s.href,$web_experiment_elements_modified:0}))}_is_bot(){return Ge&&this.instance?Ef(Ge,this.instance.config.custom_blocked_useragents):void 0}},wu=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}},uv=["$set_once","$set"],mr=qe("[SiteApps]"),xu=class{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var i=this.globalsForEvent(t);this.bufferedInvocations.push(i),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var t,i,n,s,o,l,a;if(!e)throw new Error("Event payload is required");var c={},p=this.instance.get_property("$groups")||[],u=this.instance.get_property("$stored_group_properties")||{};for(var[d,h]of Object.entries(u))c[d]={id:p[d],type:d,properties:h};var{$set_once:g,$set:m}=e;return{event:k(k({},Eh(e,uv)),{},{properties:k(k(k({},e.properties),m?{$set:k(k({},(t=(i=e.properties)===null||i===void 0?void 0:i.$set)!==null&&t!==void 0?t:{}),m)}:{}),g?{$set_once:k(k({},(n=(s=e.properties)===null||s===void 0?void 0:s.$set_once)!==null&&n!==void 0?n:{}),g)}:{}),elements_chain:(o=(l=e.properties)===null||l===void 0?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(a=e.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var i=s=>{var o;for(var l of(this.apps[e.id].errored=!s,this.apps[e.id].loaded=!0,mr.info("Site app with id ".concat(e.id," ").concat(s?"loaded":"errored")),s&&this.bufferedInvocations.length&&(mr.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach(a=>{var c;return(c=t.processEvent)===null||c===void 0?void 0:c.call(t,a)})),Object.values(this.apps)))if(!l.loaded)return;(o=this.stopBuffering)===null||o===void 0||o.call(this)};try{var{processEvent:n}=e.init({posthog:this.instance,callback:s=>{i(s)}});n&&(t.processEvent=n)}catch(s){mr.error("Error while initializing PostHog app with config id ".concat(e.id),s),i(!1)}}onCapturedEvent(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{var n;(n=i.processEvent)===null||n===void 0||n.call(i,t)}catch(s){mr.error("Error while processing event ".concat(e.event," for site app ").concat(i.id),s)}}}onRemoteConfig(e){var t,i,n=this;if(le(N._POSTHOG_JS_APPS)){if(!this.isEnabled)return void mr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var s of N._POSTHOG_JS_APPS)this.setupSiteApp(s);var o;N._POSTHOG_JS_APPS.length?this.instance.on("eventCaptured",p=>this.onCapturedEvent(p)):(o=this.stopBuffering)===null||o===void 0||o.call(this)}else if((t=this.stopBuffering)===null||t===void 0||t.call(this),(i=e.siteApps)!==null&&i!==void 0&&i.length)if(this.isEnabled){var l=function(p,u){var d,h;N["__$$ph_site_app_".concat(p)]=n.instance,(d=N.__PosthogExtensions__)===null||d===void 0||(h=d.loadSiteApp)===null||h===void 0||h.call(d,n.instance,u,g=>{if(g)return mr.error("Error while initializing PostHog app with config id ".concat(p),g)})};for(var{id:a,url:c}of e.siteApps)l(a,c)}else mr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},gn={},ku=()=>{},ei="posthog",Cf=!H0&&we?.indexOf("MSIE")===-1&&we?.indexOf("Mozilla")===-1,xh=()=>{var r,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=O?.location,t=e?.hostname,!!Ee(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:ku,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Ne&&Ee(Ne?.search)&&Ne.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||(r=v.location)===null||r===void 0?void 0:r.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:i=>{var n="Bad HTTP status: "+i.statusCode+" "+i.text;D.error(n)},get_device_id:i=>i,_onCapture:ku,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}},kh=r=>{var e={};F(r.process_person)||(e.person_profiles=r.process_person),F(r.xhr_headers)||(e.request_headers=r.xhr_headers),F(r.cookie_name)||(e.persistence_name=r.cookie_name),F(r.disable_cookie)||(e.disable_persistence=r.disable_cookie);var t=Oe({},e,r);return le(r.property_blacklist)&&(F(r.property_denylist)?t.property_denylist=r.property_blacklist:le(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:D.error("Invalid value for property_denylist config: "+r.property_denylist)),t},Su=class{constructor(){P(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){D.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},$o=class r{constructor(){P(this,"webPerformance",new Su),P(this,"version",qt.LIB_VERSION),P(this,"_internalEventEmitter",new ko),this.config=xh(),this.decideEndpointWasHit=!1,this.SentryIntegration=iu,this.sentryIntegration=e=>function(t,i){var n=ff(t,i);return{name:hf,processEvent:s=>n(s)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new Rl(this),this.toolbar=new Yl(this),this.scrollManager=new fu(this),this.pageViewManager=new nu(this),this.surveys=new cu(this),this.experiments=new bu(this),this.exceptions=new wu(this),this.rateLimiter=new pu(this),this.requestRouter=new ru(this),this.consent=new vu(this),this.people={set:(e,t,i)=>{var n=Ee(e)?{[e]:t}:e;this.setPersonProperties(n),i?.({})},set_once:(e,t,i)=>{var n=Ee(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),i?.({})}},this.on("eventCaptured",e=>D.info('send "'.concat(e?.event,'"'),e))}init(e,t,i){if(i&&i!==ei){var n,s=(n=gn[i])!==null&&n!==void 0?n:new r;return s._init(e,t,i),gn[i]=s,gn[ei][i]=s,s}return this._init(e,t,i)}_init(e){var t,i,n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(F(e)||Rd(e))return D.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 D.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],s.person_profiles&&(this._initialPersonProfilesConfig=s.person_profiles),this.set_config(Oe({},xh(),kh(s),{name:o,token:e})),this.config.on_xhr_error&&D.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:at.GZipJS,this.persistence=new dn(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new dn(k(k({},this.config),{},{persistence:"sessionStorage"}));var l=k({},this.persistence.props),a=k({},this.sessionPersistence.props);if(this._requestQueue=new Ql(y=>this._send_retriable_request(y)),this._retryQueue=new eu(this),this.__request_queue=[],this.sessionManager=new tu(this),this.sessionPropsManager=new du(this.sessionManager,this.persistence),new mu(this).startIfEnabledOrStop(),this.siteApps=new xu(this),(t=this.siteApps)===null||t===void 0||t.init(),this.sessionRecording=new Zl(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new gu(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new hu(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new _u(this),this.exceptionObserver=new yu(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Co(this,rv),this.deadClicksAutocapture.startIfEnabled(),qt.DEBUG=qt.DEBUG||this.config.debug,qt.DEBUG&&D.info("Starting in debug mode",{this:this,config:s,thisC:k({},this.config),p:l,s:a}),this._sync_opt_out_with_persistence(),((i=s.bootstrap)===null||i===void 0?void 0:i.distinctID)!==void 0){var c,p,u=this.config.get_device_id(zt()),d=(c=s.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?u:s.bootstrap.distinctID;this.persistence.set_property(kt,(p=s.bootstrap)!==null&&p!==void 0&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var h,g,m=Object.keys(((h=s.bootstrap)===null||h===void 0?void 0:h.featureFlags)||{}).filter(y=>{var x,S;return!((x=s.bootstrap)===null||x===void 0||(S=x.featureFlags)===null||S===void 0||!S[y])}).reduce((y,x)=>{var S,M;return y[x]=((S=s.bootstrap)===null||S===void 0||(M=S.featureFlags)===null||M===void 0?void 0:M[x])||!1,y},{}),_=Object.keys(((g=s.bootstrap)===null||g===void 0?void 0:g.featureFlagPayloads)||{}).filter(y=>m[y]).reduce((y,x)=>{var S,M,B,U;return(S=s.bootstrap)!==null&&S!==void 0&&(M=S.featureFlagPayloads)!==null&&M!==void 0&&M[x]&&(y[x]=(B=s.bootstrap)===null||B===void 0||(U=B.featureFlagPayloads)===null||U===void 0?void 0:U[x]),y},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:_})}if(!this.get_distinct_id()){var w=this.config.get_device_id(zt());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(kt,"anonymous")}return v==null||(n=v.addEventListener)===null||n===void 0||n.call(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?V0(this,()=>this._loaded()):this._loaded(),Ye(this.config._onCapture)&&this.config._onCapture!==ku&&(D.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",y=>this.config._onCapture(y.event,y))),this}_onRemoteConfig(e){var t,i,n,s,o,l,a,c,p;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=z(e.supportedCompression,at.GZipJS)?at.GZipJS:z(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"}),(i=this.siteApps)===null||i===void 0||i.onRemoteConfig(e),(n=this.sessionRecording)===null||n===void 0||n.onRemoteConfig(e),(s=this.autocapture)===null||s===void 0||s.onRemoteConfig(e),(o=this.heatmaps)===null||o===void 0||o.onRemoteConfig(e),(l=this.surveys)===null||l===void 0||l.onRemoteConfig(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.onRemoteConfig(e),(c=this.exceptionObserver)===null||c===void 0||c.onRemoteConfig(e),(p=this.deadClicksAutocapture)===null||p===void 0||p.onRemoteConfig(e)}_loaded(){this.config.advanced_disable_decide||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){D.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new Kl(this).call()}_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()||ni(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&&(Cf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=wo(e.url,{ip:this.config.ip?1:0}),e.headers=k({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(t=>{var i,n,s,o=k({},t);o.timeout=o.timeout||6e4,o.url=wo(o.url,{_:new Date().getTime().toString(),ver:qt.LIB_VERSION,compression:o.compression});var l=(i=o.transport)!==null&&i!==void 0?i:"XHR",a=(n=(s=Th(fn,c=>c.transport===l))===null||s===void 0?void 0:s.method)!==null&&n!==void 0?n:fn[0].method;if(!a)throw new Error("No available transport method");a(o)})(k(k({},e),{},{callback:t=>{var i,n,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(s=this.config).on_request_error)===null||n===void 0||n.call(s,t)),(i=e.callback)===null||i===void 0||i.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,i=[],n=[],s=[];ni(e,l=>{l&&(t=l[0],le(t)?s.push(l):Ye(l)?l.call(this):le(l)&&t==="alias"?i.push(l):le(l)&&t.indexOf("capture")!==-1&&Ye(this[t])?s.push(l):n.push(l))});var o=function(l,a){ni(l,function(c){if(le(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(i,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,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!F(e)&&Ee(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=i!=null&&i.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=i?.timestamp||o,a={uuid:zt(),event:e,properties:this._calculate_event_properties(e,t||{},l)};s&&(a.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(a.$set=i?.$set);var c=this._calculate_set_once_properties(i?.$set_once);c&&(a.$set_once=c),(a=Ym(a,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,F(i?.timestamp)||(a.properties.$event_time_override_provided=!0,a.properties.$event_time_override_system_time=o);var p=k(k({},a.properties.$set),a.$set);if(ti(p)||this.setPersonPropertiesForFlags(p),!Q(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=i?._url)!==null&&n!==void 0?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:a,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),a}D.critical("This capture call is ignored due to client rate limiting.")}}else D.error("No event name provided to posthog.capture")}else D.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,i){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),s=k({},t);if(s.token=this.config.token,e==="$snapshot"){var o=k(k({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ee(s.distinct_id)&&!We(s.distinct_id)||Rd(s.distinct_id))&&D.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l=se.properties();if(this.sessionManager){var{sessionId:a,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=a,s.$window_id=c}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===_r.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(i):e==="$pageleave"&&(u=this.pageViewManager.doPageLeave(i)),s=Oe(s,u)}if(e==="$pageview"&&O&&(s.title=O.title),!F(n)){var d=i.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(),le(this.config.property_denylist)?K(this.config.property_denylist,function(m){delete s[m]}):D.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||{}),i=this.config.sanitize_properties;return i&&(t=i(t,"$set_once")),ti(t)?void 0:t}register(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}register_once(e,t,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,t,i)}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,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.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,i){return this.surveys.getNextSurveyStep(e,t,i)}identify(e,t,i){if(!this.__loaded||!this.persistence)return D.uninitializedWarning("posthog.identify");if(We(e)&&(e=e.toString(),D.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()))D.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(ln)&&(this.unregister(ln),this.register({distinct_id:e}));var o=(this.persistence.get_property(kt)||"anonymous")==="anonymous";e!==n&&o?(this.persistence.set_property(kt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(po))}}else D.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,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:k(k({},n),{},{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}}else D.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,i,n,s,o;if(D.info("reset"),!this.__loaded)return D.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(n=this.surveys)===null||n===void 0||n.reset(),(s=this.persistence)===null||s===void 0||s.set_property(kt,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId();var a=this.config.get_device_id(zt());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:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(e!=null&&e.withTimestamp&&i){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!i)return n;var l=Math.max(Math.floor((new Date().getTime()-i)/1e3)-o,0);n+="?t=".concat(l)}return n}alias(e,t){return e===this.get_property(Ph)?(D.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(ln,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(D.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,n,s,o=k({},this.config);fe(e)&&(Oe(this.config,kh(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 dn(k(k({},this.config),{},{persistence:"sessionStorage"})),ye.is_supported()&&ye.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(qt.DEBUG=!0,D.info("set_config",{config:e,oldConfig:o,newConfig:k({},this.config)})),(i=this.sessionRecording)===null||i===void 0||i.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,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var n,s,o,l,a;(n=this.sessionManager)===null||n===void 0||n.checkAndGetSessionAndWindowId(),i.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),i.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),i.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),i.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 i,n=new Error("PostHog syntheticException"),s=Ye((i=N.__PosthogExtensions__)===null||i===void 0?void 0:i.parseErrorAsProperties)?N.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n}):k({$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:ei;return t!==ei&&(t=ei+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(kt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(kt))==="identified"}_hasPersonProcessing(){var e,t,i,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ti(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[ln])&&((i=this.persistence)===null||i===void 0||(n=i.props)===null||n===void 0||!n[ho]))}_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"?(D.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(ho,!0),!0)}_sync_opt_out_with_persistence(){var e,t,i,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&&((i=this.persistence)===null||i===void 0||i.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 Ge?Ef(Ge,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){O&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:O.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(Q(this.config.before_send))return e;var t=le(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var n of t){if(i=n(i),Q(i)){var s="Event '".concat(e.event,"' was rejected in beforeSend function");return Zm(e.event)?D.warn("".concat(s,". This can cause unexpected behavior.")):D.info(s),null}i.properties&&!ti(i.properties)||D.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return i}};(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=Km(r.prototype[e[t]])})($o,["identify"]);var Sh,$f=(Sh=gn[ei]=new $o,function(){function r(){r.done||(r.done=!0,Cf=!1,K(gn,function(e){e._dom_loaded()}))}O!=null&&O.addEventListener&&(O.readyState==="complete"?r():O.addEventListener("DOMContentLoaded",r,!1)),v&&Ct(v,"load",r,!0)}(),Sh);var If=$f.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 Fe(r,e){if(!If)throw new Error("Failed to initialize PostHog");If.capture(r,e)}var Oo,kn,Mo,Jt,Tf,Ro,wn=class wn extends G(H){constructor(){super();b(this,Jt);b(this,Oo,new jt(this,{onError:console.error}));b(this,kn);b(this,Mo,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Fe("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Fe("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Fe("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Fe("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Fe("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Fe("ShopAssistant: user sent input",t),he("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,kn)||f(this,Oo).data}render(){return this.config?E`
|
|
585
608
|
<!-- embed our chat component forwarding props -->
|
|
586
609
|
<mw-chat
|
|
587
610
|
widget="${this.widgetId}"
|
|
588
611
|
.config="${this.config}"
|
|
589
|
-
.callbacks="${f(this,
|
|
612
|
+
.callbacks="${f(this,Mo)}"
|
|
590
613
|
x-user-data="${this.xUserData}"
|
|
591
614
|
x-prompt-ext="${this.xPromptExt}"
|
|
592
615
|
?show-close="${this.showClose}"
|
|
593
|
-
@mw:close-click="${
|
|
616
|
+
@mw:close-click="${C(this,Jt,Tf)}">
|
|
594
617
|
<slot name="banner" slot="banner"></slot>
|
|
595
618
|
</mw-chat>
|
|
596
|
-
`:j}injectConfig(t){
|
|
619
|
+
`:j}injectConfig(t){A(this,kn,t),this.requestUpdate()}reloadConfig(){f(this,Jt,Ro)?.reloadConfig()}get conversationId(){return f(this,Jt,Ro)?.conversationId??""}get messages(){return f(this,Jt,Ro)?.messages??[]}};Oo=new WeakMap,kn=new WeakMap,Mo=new WeakMap,Jt=new WeakSet,Tf=function(){this.dispatchEvent(new wn.CloseClickEvent)},Ro=function(){return this.renderRoot.querySelector("mw-chat")},T(wn,"styles",tt`
|
|
597
620
|
:host {
|
|
598
621
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
599
622
|
}
|
|
600
|
-
`),T(
|
|
623
|
+
`),T(wn,"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 xn=wn;customElements.define("molin-shop-ai-chat",xn);var Fu;xn.CloseClickEvent=(Fu=class extends CustomEvent{constructor(e={}){super(xn.CloseClickEvent.type,{...e})}},T(Fu,"type","mw:close-click"),Fu);var Fo,Sn=class extends G(H){constructor(){super();b(this,Fo,new jt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return f(this,Fo).data}render(){return this.config?E`
|
|
601
624
|
<!-- embed our bubble component forwarding props -->
|
|
602
625
|
<!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
|
|
603
|
-
<mw-bubble state="${this.state}" src="${
|
|
604
|
-
`:j}};
|
|
626
|
+
<mw-bubble state="${this.state}" src="${Ti(this.config?.bubble?.imageUrl)}"></mw-bubble>
|
|
627
|
+
`:j}};Fo=new WeakMap,T(Sn,"styles",tt`
|
|
605
628
|
:host {
|
|
606
629
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
607
630
|
}
|
|
608
|
-
`),T(
|
|
631
|
+
`),T(Sn,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Sn);var Lo,hi,fi,xr,Cn,$n,En=class{constructor(e,t,i,n=window.history){b(this,Lo);b(this,hi);b(this,fi);b(this,xr);b(this,Cn,!1);b(this,$n,()=>{f(this,hi).test(window.location.pathname)&&f(this,fi).navigated()});A(this,Lo,e),A(this,hi,t),A(this,fi,i),A(this,xr,n),e.addController(this)}hostConnected(){window.addEventListener("pageshow",f(this,$n));let e=f(this,xr).pushState;f(this,xr).pushState=(...t)=>{if(e.call(f(this,xr),...t),!f(this,Cn))try{let i=new URL(t[2],window.location.origin);f(this,hi).test(i.pathname)&&f(this,fi).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",f(this,$n)),A(this,Cn,!0)}};Lo=new WeakMap,hi=new WeakMap,fi=new WeakMap,xr=new WeakMap,Cn=new WeakMap,$n=new WeakMap;function Pf({minMs:r,maxMs:e}){return Math.random()*(e-r)+r}function Lu(r,e=""){return Object.entries(r).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}function Rf(r,e={}){return[Lu(r),Lu(e,"max-sm:")].join(" ")}function Of(r){return Lu(r)}function Du(r){return Object.entries(r).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let i=`sm:${e}-[${t}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function Mf(r){let e=Du(r),i=`sm:bottom-[${r.bottom?`calc(${r.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var Xt,ft,Nu,In,ju=class{constructor(e=window.localStorage){b(this,ft);b(this,Xt);A(this,Xt,e)}setex(e,t,i){return f(this,Xt).setItem(e,C(this,ft,In).call(this,{value:C(this,ft,In).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return f(this,Xt).setItem(e,C(this,ft,In).call(this,{value:C(this,ft,In).call(this,t)})||"")}get(e){let t=f(this,Xt).getItem(e);if(!t)return;let i=C(this,ft,Nu).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){f(this,Xt).removeItem(e);return}return C(this,ft,Nu).call(this,i.value)}}};Xt=new WeakMap,ft=new WeakSet,Nu=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},In=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var Uu=new ju;var Ff="molin-shop-ai-widget-open",Do,Pn,Bu,Hu,ue,jo,re,Lf,Tn,qu,Df,jf,Nf,gi,An=class extends G(H){constructor(){super();b(this,re);b(this,Do,new jt(this,{onError:console.error}));b(this,Pn);b(this,Bu,new En(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=f(this,re,qu);t&&Fe("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,Hu,new En(this,/.*/i,{navigated:()=>{let t=f(this,re,qu);he("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:t?.conversationId||"",url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0})}}));b(this,ue,!1);b(this,jo,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),Fe("ShopAssistant: error",t),he("ShopAssistant: error",{...t,immediate:!0})},onNewMessageStartedStreaming:t=>{Fe("ShopAssistant: user received bot message (streaming started)",t),he("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{Fe("ShopAssistant: user received bot message (streaming ended)",t),he("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{Fe("ShopAssistant: user canceled streaming",t),he("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{Fe("ShopAssistant: user clicked link",t),he("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{Fe("ShopAssistant: user sent input",t),he("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,Pn)||f(this,Do).data}render(){if(!this.config)return j;let t=Rf(this.config.bubble.position,this.config.bubble.mobilePosition),i=Of(this.config.bubble.position),n=Du(this.config.bubble.position),s=Mf(this.config.bubble.position);return this.config.hidden?j:E`
|
|
609
632
|
<mw-bubble
|
|
610
|
-
class="${t} ${f(this,ue)?"opacity-0":"opacity-100"} fixed z-[${f(this,
|
|
611
|
-
@click="${
|
|
633
|
+
class="${t} ${f(this,ue)?"opacity-0":"opacity-100"} fixed z-[${f(this,re,Lf)}] transition-opacity"
|
|
634
|
+
@click="${C(this,re,jf)}"
|
|
612
635
|
state="${f(this,ue)?"close":"open"}"
|
|
613
636
|
src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
|
|
614
637
|
|
|
615
638
|
<!-- only load the component if enabled on any platform -->
|
|
616
|
-
${this.isPopupEnabled?
|
|
639
|
+
${this.isPopupEnabled?E`
|
|
617
640
|
<mw-popup
|
|
618
641
|
position="${s}"
|
|
619
|
-
delay="${this.config.popup?.delayMs||
|
|
642
|
+
delay="${this.config.popup?.delayMs||Pf({minMs:2e3,maxMs:5e3})}"
|
|
620
643
|
sound="https://assets.molinai.io/2024/widget-v20241209/popup.aac"
|
|
621
644
|
.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}}}"
|
|
622
|
-
@mw:click="${
|
|
645
|
+
@mw:click="${C(this,re,Df)}"></mw-popup>
|
|
623
646
|
`:j}
|
|
624
647
|
|
|
625
648
|
<!-- show "Try it out" if enabled (even if the chat window is showing) -->
|
|
626
|
-
${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?
|
|
649
|
+
${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?E`<mw-try-it-out
|
|
627
650
|
class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
|
|
628
|
-
position="${
|
|
651
|
+
position="${i}"
|
|
629
652
|
text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:j}
|
|
630
653
|
|
|
631
654
|
<!-- 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. -->
|
|
632
|
-
${this._dialogAlreadyShown?
|
|
655
|
+
${this._dialogAlreadyShown?E`
|
|
633
656
|
<div
|
|
634
657
|
class="${f(this,ue)?"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]">
|
|
635
658
|
<mw-chat
|
|
636
659
|
widget="${this.widgetId}"
|
|
637
660
|
.config="${this.config}"
|
|
638
|
-
.callbacks="${f(this,
|
|
661
|
+
.callbacks="${f(this,jo)}"
|
|
639
662
|
?show-close="${!0}"
|
|
640
663
|
x-user-data="${this.xUserData}"
|
|
641
664
|
x-prompt-ext="${this.xPromptExt}"
|
|
642
|
-
@mw:close-click="${
|
|
665
|
+
@mw:close-click="${C(this,re,Nf)}">
|
|
643
666
|
<slot name="banner" slot="banner"></slot>
|
|
644
667
|
</mw-chat>
|
|
645
668
|
</div>
|
|
646
669
|
`:j}
|
|
647
|
-
`}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,ue)&&f(this,
|
|
670
|
+
`}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){f(this,ue)&&f(this,re,Tn)?.hide()}firstUpdated(){window.matchMedia("(min-width: 640px)").matches&&Uu.get(Ff)?.isOpen&&this.openChat()}openChat(){f(this,ue)||(A(this,ue,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),C(this,re,gi).call(this,!0),f(this,re,Tn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ue)?"open":"close"}))}closeChat(){f(this,ue)&&(A(this,ue,!1),this.requestUpdate(),C(this,re,gi).call(this,!1),f(this,re,Tn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:f(this,ue)?"open":"close"}))}injectConfig(t){A(this,Pn,t),this.requestUpdate()}};Do=new WeakMap,Pn=new WeakMap,Bu=new WeakMap,Hu=new WeakMap,ue=new WeakMap,jo=new WeakMap,re=new WeakSet,Lf=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},Tn=function(){return this.renderRoot.querySelector("mw-popup")},qu=function(){return this.renderRoot.querySelector("mw-chat")},Df=function(){A(this,ue,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),C(this,re,gi).call(this,!0),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:f(this,ue)?"open":"close"})},jf=function(){A(this,ue,!f(this,ue)),this._dialogAlreadyShown=!0,this.requestUpdate(),C(this,re,gi).call(this,f(this,ue)),f(this,re,Tn)?.hide(),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:f(this,ue)?"open":"close"})},Nf=function(){A(this,ue,!1),this.requestUpdate(),C(this,re,gi).call(this,!1),he("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:f(this,ue)?"open":"close"})},gi=function(t){Uu.set(Ff,{isOpen:t})},T(An,"styles",tt`
|
|
648
671
|
:host {
|
|
649
672
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
650
673
|
}
|
|
651
|
-
`),T(
|
|
674
|
+
`),T(An,"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",An);
|
|
652
675
|
/*! Bundled license information:
|
|
653
676
|
|
|
654
677
|
@lit/reactive-element/css-tag.js:
|
|
@@ -714,24 +737,17 @@ lit-html/directives/when.js:
|
|
|
714
737
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
715
738
|
*)
|
|
716
739
|
|
|
717
|
-
lit-html/directives/
|
|
718
|
-
(**
|
|
719
|
-
* @license
|
|
720
|
-
* Copyright 2017 Google LLC
|
|
721
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
722
|
-
*)
|
|
723
|
-
|
|
724
|
-
lit-html/directives/choose.js:
|
|
740
|
+
lit-html/directives/if-defined.js:
|
|
725
741
|
(**
|
|
726
742
|
* @license
|
|
727
|
-
* Copyright
|
|
743
|
+
* Copyright 2018 Google LLC
|
|
728
744
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
729
745
|
*)
|
|
730
746
|
|
|
731
|
-
lit-html/directives/
|
|
747
|
+
lit-html/directives/unsafe-html.js:
|
|
732
748
|
(**
|
|
733
749
|
* @license
|
|
734
|
-
* Copyright
|
|
750
|
+
* Copyright 2017 Google LLC
|
|
735
751
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
736
752
|
*)
|
|
737
753
|
*/
|