@molin.ai/shop-ai 0.6.27 → 0.6.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- var xp=Object.defineProperty;var $a=n=>{throw TypeError(n)};var kp=(n,e,t)=>e in n?xp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var $=(n,e,t)=>kp(n,typeof e!="symbol"?e+"":e,t),ks=(n,e,t)=>e.has(n)||$a("Cannot "+t);var h=(n,e,t)=>(ks(n,e,"read from private field"),t?t.call(n):e.get(n)),w=(n,e,t)=>e.has(n)?$a("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),R=(n,e,t,i)=>(ks(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),A=(n,e,t)=>(ks(n,e,"access private method"),t);var Ca=(n,e,t,i)=>({set _(r){R(n,e,r,t)},get _(){return h(n,e,i)}});function Os(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function Sp(n,e=","){return n.map(Os).join(e)}var Fa=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Gi(n){for(var e=9,t=n.length;t--;)e=Math.imul(e^n.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Yi(n,e="@media "){return e+Z(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function Z(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function Aa(n){return n}function Ki(){}var fe={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Da(n){return n.match(/[-=:;]/g)?.length||0}function As(n){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(n)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(Da(n),15)<<18}var Ep=["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 Fs({n,i:e,v:t=[]},i,r,s){n&&(n=Os({n,i:e,v:t})),s=[...Z(s)];for(let a of t){let l=i.theme("screens",a);for(let c of Z(l&&Yi(l)||i.v(a))){var o;s.push(c),r|=l?67108864|As(c):a=="dark"?1073741824:c[0]=="@"?As(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Ep.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var Ma=new Map;function Is(n){if(n.d){let e=[],t=Ss(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?Ss(i,s=>Ss(r,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):Es(s,o)}return Es(o,s)})):i,"&"),i=>Es(i,n.n?"."+Fa(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function Ss(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function Es(n,e){return n.replace(/&/g,e)}var Ia=new Intl.Collator("en",{numeric:!0});function La(n,e){for(var t=0,i=n.length;t<i;){let r=i+t>>1;0>=Na(n[r],e)?t=r+1:i=r}return i}function Na(n,e){let t=n.p&fe.o;return t==(e.p&fe.o)&&(t==fe.b||t==fe.o)?0:n.p-e.p||n.o-e.o||Ia.compare(Ta(n.n),Ta(e.n))||Ia.compare(Ra(n.n),Ra(e.n))}function Ta(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function Ra(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function $s(n,e){return Math.round(parseInt(n,16)*e)}function We(n,e={}){if(typeof n=="function")return n(e);let{opacityValue:t="1",opacityVariable:i}=e,r=i?`var(${i})`:t;if(n.includes("<alpha-value>"))return n.replace("<alpha-value>",r);if(n[0]=="#"&&(n.length==4||n.length==7)){let s=(n.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[$s(n.substr(1,s),o),$s(n.substr(1+s,s),o),$s(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function ja(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:c=[],i:p},u){let d=[],f="",g=0,v=0;for(let S in o||{}){var _,E;let O=o[S];if(S[0]=="@"){if(!O)continue;if(S[1]=="a"){d.push(...Ms(a,l,Ji(""+O),u,l,c,p,!0));continue}if(S[1]=="l"){for(let j of Z(O))d.push(...s(j,{n:a,p:(_=fe[S[7]],l&~fe.o|_),r:S[7]=="d"?[]:c,i:p},u));continue}if(S[1]=="i"){d.push(...Z(O).map(j=>({p:-1,o:0,r:[],d:S+" "+j})));continue}if(S[1]=="k"){d.push({p:fe.d,o:0,r:[S],d:s(O,{p:fe.d},u).map(Is).join("")});continue}if(S[1]=="f"){d.push(...Z(O).map(j=>({p:fe.d,o:0,r:[S],d:s(j,{p:fe.d},u).map(Is).join("")})));continue}}if(typeof O!="object"||Array.isArray(O))S=="label"&&O?a=O+Gi(JSON.stringify([l,p,o])):(O||O===0)&&(S=S.replace(/[A-Z]/g,j=>"-"+j.toLowerCase()),v+=1,g=Math.max(g,(E=S)[0]=="-"?0:Da(E)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(E)?+!!RegExp.$1||-!!RegExp.$2:0)+1),f+=(f?";":"")+Z(O).map(j=>u.s(S,Ds(""+j,u.theme)+(p?" !important":""))).join(";"));else if(S[0]=="@"||S.includes("&")){let j=l;S[0]=="@"&&(S=S.replace(/\bscreen\(([^)]+)\)/g,(U,G)=>{let V=u.theme("screens",G);return V?(j|=67108864,Yi(V,"")):U}),j|=As(S)),d.push(...s(O,{n:a,p:j,r:[...c,S],i:p},u))}else d.push(...s(O,{p:l,r:[...c,S]},u))}return d.unshift({n:a,p:l,o:Math.max(0,15-v)+1.5*Math.min(g||15,15),r:c,d:f}),d.sort(Na)}(n,Fs(e,t,i,r),t)}function Ds(n,e){return n.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,r,s,o="")=>{let a=e(r,o);return typeof a=="function"&&/color|fill|stroke/i.test(r)?We(a):""+Z(a).filter(l=>Object(l)!==l)})}function qa(n,e){let t,i=[];for(let r of n)r.d&&r.n?t?.p==r.p&&""+t.r==""+r.r?(t.c=[t.c,r.c].filter(Boolean).join(" "),t.d=t.d+";"+r.d):i.push(t={...r,n:r.n&&e}):i.push({...r,n:r.n&&e});return i}function Xi(n,e,t=fe.u,i,r){let s=[];for(let o of n)for(let a of function(l,c,p,u,d){l={...l,i:l.i||d};let f=function(g,v){let _=Ma.get(g.n);return _?_(g,v):v.r(g.n,g.v[0]=="dark")}(l,c);return f?typeof f=="string"?({r:u,p}=Fs(l,c,p,u),qa(Xi(Ji(f),c,p,u,l.i),l.n)):Array.isArray(f)?f.map(g=>{var v,_;return{o:0,...g,r:[...Z(u),...Z(g.r)],p:(v=p,_=g.p??p,v&~fe.o|_)}}):ja(f,l,c,p,u):[{c:Os(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(La(s,a),0,a);return s}function Ms(n,e,t,i,r,s,o,a){return qa((a?t.flatMap(l=>Xi([l],i,r,s,o)):Xi(t,i,r,s,o)).map(l=>l.p&fe.o&&(l.n||e==fe.b)?{...l,p:l.p&~fe.o|e,o:0}:l),n)}function $p(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:c,i:p}=Fs(s,o,e);return t&&Ms(a,e,t,o,l,c,p,i)},Ma.set(n,r),n}function Cs(n,e,t){if(n[n.length-1]!="("){let i=[],r=!1,s=!1,o="";for(let a of n)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),r=!r),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(Cp),i:r}))}}function Cp(n,e,t){return t.indexOf(n)==e}var Pa=new Map;function Ji(n){let e=Pa.get(n);if(!e){let t=[],i=[[]],r=0,s=0,o=null,a=0,l=(c,p=0)=>{r!=a&&(t.push(n.slice(r,a+p)),c&&Cs(t,i)),r=a+1};for(;a<n.length;a++){let c=n[a];if(s)n[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)n[a-1]!="\\"&&o.test(n.slice(a))&&(o=null,r=a+RegExp.lastMatch.length);else if(c=="/"&&n[a-1]!="\\"&&(n[a+1]=="*"||n[a+1]=="/"))o=n[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),t.push(c);else if(c==":")n[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=t.lastIndexOf("(");if(c==")"){let u=t[p-1];if(/[~@]$/.test(u)){let d=i.shift();t.length=p,Cs([...t,"#"],i);let{v:f}=i[0].pop();for(let g of d)g.v.splice(+(g.v[0]=="dark")-+(f[0]=="dark"),f.length);Cs([...t,$p(u.length>1?u.slice(0,-1)+Gi(JSON.stringify([u,d])):u+"("+Sp(d)+")",fe.a,d,/@$/.test(u))],i)}p=t.lastIndexOf("(",p-1)}t.length=p+1}else/[~@]/.test(c)&&n[a+1]=="("&&i.unshift([])}l(!0),Pa.set(n,e=i[0])}return e}function x(n,e,t){return[n,Ts(e,t)]}function Ts(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):Rs(t,1)}):t=>n||{[t[1]]:Rs(t,2)}}function Rs(n,e,t=n.slice(e).find(Boolean)||n.$$||n.input){return n.input[0]=="-"?`calc(${t} * -1)`:t}function k(n,e,t,i){return[n,Ls(e,t,i)]}function Ls(n,e,t){let i=typeof e=="string"?(r,s)=>({[e]:t?t(r,s):r._}):e||(({1:r,_:s},o,a)=>({[r||a]:s}));return(r,s)=>{let o=Ua(n||r[1]),a=s.theme(o,r.$$)??at(r.$$,o,s);if(a!=null)return r._=Rs(r,0,a),i(r,s,o)}}function de(n,e={},t){return[n,Ap(e,t)]}function Ap(n={},e){return(t,i)=>{let{section:r=Ua(t[0]).replace("-","")+"Color"}=n,[s,o]=Ip(t.$$);if(!s)return;let a=i.theme(r,s)||at(s,r,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:c=r.replace("Color","Opacity"),property:p=r,selector:u}=n,d=i.theme(c,o||"DEFAULT")||o&&at(o,c,i),f=e||(({_:v})=>{let _=Xn(p,v);return u?{[u]:_}:_});t._={value:We(a,{opacityVariable:l||void 0,opacityValue:d||void 0}),color:v=>We(a,v),opacityVariable:l||void 0,opacityValue:d||void 0};let g=f(t,i);if(!t.dark){let v=i.d(r,s,a);v&&v!==a&&(t._={value:We(v,{opacityVariable:l||void 0,opacityValue:d||"1"}),color:_=>We(v,_),opacityVariable:l||void 0,opacityValue:d||void 0},g={"&":g,[i.v("dark")]:f(t,i)})}return g}}function Ip(n){return(n.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Xn(n,e){let t={};return typeof e=="string"?t[n]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[n]=e.value),t}function at(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=hn(Ds(n.slice(1,-1),t.theme)),!e)return n;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(n)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(n))||/image/i.test(e)&&!(/^image:/.test(n)||/^[a-z-]+\(/.test(n))||/weight/i.test(e)&&!(/^(number|any):/.test(n)||/^\d+$/.test(n))||/position/i.test(e)&&/^(length|size):/.test(n)))return n.replace(/^[a-z-]+:/,"")}}function Ua(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function hn(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>hn(t)+i+hn(r)):n.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 Jn({presets:n=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Z(e.variants),rules:Z(e.rules),ignorelist:Z(e.ignorelist),hash:void 0,stringify:(i,r)=>i+":"+r,finalize:[]};for(let i of Z([...n,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Z(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:r,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:a,variants:l,rules:c,ignorelist:p,hash:u=t.hash,stringify:d=t.stringify,finalize:f}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&r!==!1&&[...t.preflight,...Z(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...Z(l)],rules:[...t.rules,...Z(c)],ignorelist:[...t.ignorelist,...Z(p)],hash:u,stringify:d,finalize:[...t.finalize,...Z(f)]}}return t}function Oa(n,e,t,i,r,s){for(let o of e){let a=t.get(o);a||t.set(o,a=i(o));let l=a(n,r,s);if(l)return l}}function Tp(n){var e;return Ps(n[0],typeof(e=n[1])=="function"?e:()=>e)}function Rp(n){var e,t;return Array.isArray(n)?Ps(n[0],Ts(n[1],n[2])):Ps(n,Ts(e,t))}function Ps(n,e){return Ba(n,(t,i,r,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,r)})}function Ba(n,e){let t=Z(n).map(Pp);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function Pp(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function Ha(n,e){let t=Jn(n),i=function({theme:l,darkMode:c,darkColor:p=Ki,variants:u,rules:d,hash:f,stringify:g,ignorelist:v,finalize:_}){let E=new Map,S=new Map,O=new Map,j=new Map,U=Ba(v,(C,B)=>B.test(C));u.push(["dark",Array.isArray(c)||c=="class"?`${Z(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let G=typeof f=="function"?C=>f(C,Gi):f?Gi:Aa;G!==Aa&&_.push(C=>({...C,n:C.n&&G(C.n),d:C.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(B,X)=>"--"+G(X).replace("#",""))}));let V={theme:function({extend:C={},...B}){let X={},dt={get colors(){return me("colors")},theme:me,negative(){return{}},breakpoints(K){let te={};for(let ue in K)typeof K[ue]=="string"&&(te["screen-"+ue]=K[ue]);return te}};return me;function me(K,te,ue,Me){if(K){if({1:K,2:Me}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(K)||[,K],/[.[]/.test(K)){let Ce=[];K.replace(/\[([^\]]+)\]|([^.[]+)/g,(ne,ye,Te=ye)=>Ce.push(Te)),K=Ce.shift(),ue=te,te=Ce.join("-")}let oe=X[K]||Object.assign(Object.assign(X[K]={},ze(B,K)),ze(C,K));if(te==null)return oe;te||(te="DEFAULT");let $e=oe[te]??te.split("-").reduce((Ce,ne)=>Ce?.[ne],oe)??ue;return Me?We($e,{opacityValue:Ds(Me,me)}):$e}let qe={};for(let oe of[...Object.keys(B),...Object.keys(C)])qe[oe]=me(oe);return qe}function ze(K,te){let ue=K[te];return typeof ue=="function"&&(ue=ue(dt)),ue&&/color|fill|stroke/i.test(te)?function Me(qe,oe=[]){let $e={};for(let Ce in qe){let ne=qe[Ce],ye=[...oe,Ce];$e[ye.join("-")]=ne,Ce=="DEFAULT"&&(ye=oe,$e[oe.join("-")]=ne),typeof ne=="object"&&Object.assign($e,Me(ne,ye))}return $e}(ue):ue}}(l),e:Fa,h:G,s(C,B){return g(C,B,V)},d(C,B,X){return p(C,B,V,X)},v(C){return E.has(C)||E.set(C,Oa(C,u,S,Tp,V)||"&:"+C),E.get(C)},r(C,B){let X=JSON.stringify([C,B]);return O.has(X)||O.set(X,!U(C,V)&&Oa(C,d,j,Rp,V,B)),O.get(X)},f(C){return _.reduce((B,X)=>X(B,V),C)}};return V}(t),r=new Map,s=[],o=new Set;e.resume(l=>r.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=i.f(l),p=Is(c);if(p&&!o.has(p)){o.add(p);let u=La(s,l);e.insert(p,u,l),s.splice(u,0,l)}return c.n}return Object.defineProperties(function(c){if(!r.size)for(let u of Z(t.preflight))typeof u=="function"&&(u=u(i)),u&&(typeof u=="string"?Ms("",fe.b,Ji(u),i,fe.b,[],!1,!0):ja(u,{},i,fe.b)).forEach(a);c=""+c;let p=r.get(c);if(!p){let u=new Set;for(let d of Xi(Ji(c),i))u.add(d.c).add(a(d));p=[...u].filter(Boolean).join(" "),r.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let l=e.snapshot(),c=new Set(o),p=new Map(r),u=[...s];return()=>{l(),o=c,r=p,s=u}},clear(){e.clear(),o=new Set,r=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Op(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function za(n){let e=new MutationObserver(t);return{observe(r){e.observe(r,{attributeFilter:["class"],subtree:!0,childList:!0}),i(r),t([{target:r,type:""}])},disconnect(){e.disconnect()}};function t(r){for(let{type:s,target:o}of r)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(r){let s,o=r.getAttribute?.("class");o&&Op(o,s=n(o))&&r.setAttribute("class",s)}}function Fp(n){let e=document.querySelector(n||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Qi(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:Fp(n)).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:Ki}}var Dp=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 Wa(n){return Dp.get(n)}function Va(n){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(n);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Ga(n,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(n);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 Mp=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Zi(){return({stringify:n})=>({stringify(e,t,i){let r="",s=Wa(e);s&&(r+=n(s,t,i)+";");let o=Va(e),a=Ga(e,t);for(let l of Mp)o&l[1]&&(r+=n(l[0]+e,t,i)+";"),a&l[1]&&(r+=n(e,l[0]+t,i)+";");return r+n(e,t,i)}})}function er(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Ls("lineClamp",({_:n})=>Xa(n))],["line-clamp-(\\d+)",({1:n})=>Xa(n)]]}}function Xa(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var Kn={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",...Ue(4,"rem",4,.5,.5),...Ue(12,"rem",4,5),14:"3.5rem",...Ue(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:z("blur"),backdropBrightness:z("brightness"),backdropContrast:z("contrast"),backdropGrayscale:z("grayscale"),backdropHueRotate:z("hueRotate"),backdropInvert:z("invert"),backdropOpacity:z("opacity"),backdropSaturate:z("saturate"),backdropSepia:z("sepia"),backgroundColor:z("colors"),backgroundImage:{none:"none"},backgroundOpacity:z("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:{...Ue(200,"",100,0,50),...Ue(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:z("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:z("spacing"),borderWidth:{DEFAULT:"1px",...Ve(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:z("colors"),caretColor:z("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...Ue(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:z("borderColor"),divideOpacity:z("borderOpacity"),divideWidth:z("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:n})=>({...n("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:n})=>({...n("spacing"),...Yn(2,6),...Yn(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:z("spacing"),gradientColorStops:z("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:n})=>({...n("spacing"),...Yn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:n})=>({...n("spacing"),...Yn(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:{...Ue(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:n})=>({auto:"auto",...n("spacing")}),maxHeight:({theme:n})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...n("spacing")}),maxWidth:({theme:n,breakpoints:e})=>({...e(n("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:{...Ue(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:z("spacing"),placeholderColor:z("colors"),placeholderOpacity:z("opacity"),outlineColor:z("colors"),outlineOffset:Ve(8,"px"),outlineWidth:Ve(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:z("colors"),ringOffsetWidth:Ve(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ve(8,"px")},rotate:{...Ve(2,"deg"),...Ve(12,"deg",3),...Ve(180,"deg",45)},saturate:Ue(200,"",100,0,50),scale:{...Ue(150,"",100,0,50),...Ue(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:z("spacing"),scrollPadding:z("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ve(2,"deg"),...Ve(12,"deg",3)},space:z("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:Ue(2),textColor:z("colors"),textDecorationColor:z("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ve(8,"px")},textUnderlineOffset:{auto:"auto",...Ve(8,"px")},textIndent:z("spacing"),textOpacity:z("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:z("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:n})=>({...n("spacing"),...Yn(2,4),full:"100%"}),width:({theme:n})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...n("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Ue(50,"",1,0,10),auto:"auto"}};function Yn(n,e){let t={};do for(var i=1;i<n;i++)t[`${i}/${n}`]=Number((i/n*100).toFixed(6))+"%";while(++n<=e);return t}function Ve(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function Ue(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function z(n){return({theme:e})=>e(n)}var Ja={"*,::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, ${Kn.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, ${Kn.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 tl=[x("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:at(`[${e}]`,"",t)}}})),x("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),k("aspect-","aspectRatio"),x("container",(n,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:r}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in t){let l=t[a];typeof l=="string"&&(s[Yi(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=r&&(typeof r=="string"?r:r[a]||r.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),k("content-","content",({_:n})=>({"--tw-content":n,content:"var(--tw-content)"})),x("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),x("box-(border|content)","boxSizing",({1:n})=>n+"-box"),x("hidden",{display:"none"}),x("table-(auto|fixed)","tableLayout"),x(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",x("isolate","isolation"),x("object-(contain|cover|fill|none|scale-down)","objectFit"),k("object-","objectPosition"),x("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",tr),x("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),x("(static|fixed|absolute|relative|sticky)","position"),k("-?inset(-[xy])?(?:$|-)","inset",({1:n,_:e})=>({top:n!="-x"&&e,right:n!="-y"&&e,bottom:n!="-x"&&e,left:n!="-y"&&e})),k("-?(top|bottom|left|right)(?:$|-)","inset"),x("(visible|collapse)","visibility"),x("invisible",{visibility:"hidden"}),k("-?z-","zIndex"),x("flex-((row|col)(-reverse)?)","flexDirection",Ya),x("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),k("(flex-(?:grow|shrink))(?:$|-)"),k("(flex)-"),k("grow(?:$|-)","flexGrow"),k("shrink(?:$|-)","flexShrink"),k("basis-","flexBasis"),k("-?(order)-"),"-?(order)-(\\d+)",k("grid-cols-","gridTemplateColumns"),x("grid-cols-(\\d+)","gridTemplateColumns",el),k("col-","gridColumn"),x("col-(span)-(\\d+)","gridColumn",Za),k("col-start-","gridColumnStart"),x("col-start-(auto|\\d+)","gridColumnStart"),k("col-end-","gridColumnEnd"),x("col-end-(auto|\\d+)","gridColumnEnd"),k("grid-rows-","gridTemplateRows"),x("grid-rows-(\\d+)","gridTemplateRows",el),k("row-","gridRow"),x("row-(span)-(\\d+)","gridRow",Za),k("row-start-","gridRowStart"),x("row-start-(auto|\\d+)","gridRowStart"),k("row-end-","gridRowEnd"),x("row-end-(auto|\\d+)","gridRowEnd"),x("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>tr(Ya(n))),x("grid-flow-(dense)","gridAutoFlow"),k("auto-cols-","gridAutoColumns"),k("auto-rows-","gridAutoRows"),k("gap-x(?:$|-)","gap","columnGap"),k("gap-y(?:$|-)","gap","rowGap"),k("gap(?:$|-)","gap"),"(justify-(?:items|self))-",x("justify-","justifyContent",Ka),x("(content|items|self)-",n=>({["align-"+n[1]]:Ka(n)})),x("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),k("p([xytrbl])?(?:$|-)","padding",gn("padding")),k("-?m([xytrbl])?(?:$|-)","margin",gn("margin")),k("-?space-(x|y)(?:$|-)","space",({1:n,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[n]]:`calc(${e} * calc(1 - var(--tw-space-${n}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[n]]:`calc(${e} * var(--tw-space-${n}-reverse))`}})),x("space-(x|y)-reverse",({1:n})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"1"}})),k("w-","width"),k("min-w-","minWidth"),k("max-w-","maxWidth"),k("h-","height"),k("min-h-","minHeight"),k("max-h-","maxHeight"),k("font-","fontWeight"),k("font-","fontFamily",({_:n})=>typeof(n=Z(n))[1]=="string"?{fontFamily:Ke(n)}:{fontFamily:Ke(n[0]),...n[1]}),x("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),x("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),x("italic","fontStyle"),x("not-italic",{fontStyle:"normal"}),x("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:n,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":n)]:n,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...At({"--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,/*!*/ /*!*/)"})}),k("tracking-","letterSpacing"),k("leading-","lineHeight"),x("list-(inside|outside)","listStylePosition"),k("list-","listStyleType"),x("list-","listStyleType"),k("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),de("placeholder-",{property:"color",selector:"&::placeholder"}),x("text-(left|center|right|justify|start|end)","textAlign"),x("text-(ellipsis|clip)","textOverflow"),k("text-opacity-","textOpacity","--tw-text-opacity"),de("text-",{property:"color"}),k("text-","fontSize",({_:n})=>typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}),k("indent-","textIndent"),x("(overline|underline|line-through)","textDecorationLine"),x("no-underline",{textDecorationLine:"none"}),k("underline-offset-","textUnderlineOffset"),de("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),k("decoration-","textDecorationThickness"),x("decoration-","textDecorationStyle"),x("(uppercase|lowercase|capitalize)","textTransform"),x("normal-case",{textTransform:"none"}),x("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),x("align-","verticalAlign"),x("whitespace-","whiteSpace"),x("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),x("break-words",{overflowWrap:"break-word"}),x("break-all",{wordBreak:"break-all"}),x("break-keep",{wordBreak:"keep-all"}),de("caret-",{opacityVariable:!1,opacitySection:"opacity"}),de("accent-",{opacityVariable:!1,opacitySection:"opacity"}),x("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${Xt(n," ")},var(--tw-gradient-stops))`),de("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-from":n.value,"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),de("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${n.value},var(--tw-gradient-to)`})),de("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),x("bg-(fixed|local|scroll)","backgroundAttachment"),x("bg-origin-(border|padding|content)","backgroundOrigin",({1:n})=>n+"-box"),x(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),x("bg-blend-","backgroundBlendMode"),x("bg-clip-(border|padding|content|text)","backgroundClip",({1:n})=>n+(n=="text"?"":"-box")),k("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),de("bg-",{section:"backgroundColor"}),k("bg-","backgroundImage"),k("bg-","backgroundPosition"),x("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",tr),k("bg-","backgroundSize"),k("rounded(?:$|-)","borderRadius"),k("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:n,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[n]||[n,n];return{[`border-${Xt(t[0])}-radius`]:e,[`border-${Xt(t[1])}-radius`]:e}}),x("border-(collapse|separate)","borderCollapse"),k("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),x("border-(solid|dashed|dotted|double|none)","borderStyle"),k("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...At({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(n||"-x")]:e,["--tw-border-spacing"+(n||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),de("border-([xytrbl])-",{section:"borderColor"},gn("border","Color")),de("border-"),k("border-([xytrbl])(?:$|-)","borderWidth",gn("border","Width")),k("border(?:$|-)","borderWidth"),k("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),x("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),x("divide-([xy]-reverse)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+n]:"1"}})),k("divide-([xy])(?:$|-)","divideWidth",({1:n,_:e})=>{let t={x:"lr",y:"tb"}[n];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${n}-reverse`]:"0",[`border-${Xt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${Xt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${n}-reverse))`}}}),de("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),k("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),de("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),k("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),x("ring-inset",{"--tw-ring-inset":"inset"}),de("ring-",{property:"--tw-ring-color"}),k("ring(?:$|-)","ringWidth",({_:n},{theme:e})=>({...At({"--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(${n} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),de("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-shadow-color":n.value,"--tw-shadow":"var(--tw-shadow-colored)"})),k("shadow(?:$|-)","boxShadow",({_:n})=>({...At({"--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":Ke(n),"--tw-shadow-colored":Ke(n).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)"})),k("(opacity)-"),x("mix-blend-","mixBlendMode"),...Qa(),...Qa("backdrop-"),k("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:Ke(n),transitionTimingFunction:n._=="none"?void 0:Ke(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:Ke(e("transitionDuration",""))})),k("duration(?:$|-)","transitionDuration","transitionDuration",Ke),k("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ke),k("delay(?:$|-)","transitionDelay","transitionDelay",Ke),k("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=Ke(n),s=r.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:r}}),"(transform)-(none)",x("transform",js),x("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":nl(n=="gpu")})),k("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...js()})),k("-?(rotate)-","rotate",Ns),k("-?(translate-[xy])-","translate",Ns),k("-?(skew-[xy])-","skew",Ns),x("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",tr),"(appearance)-",k("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",k("(cursor)-"),"(cursor)-",x("snap-(none)","scroll-snap-type"),x("snap-(x|y|both)",({1:n})=>({...At({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" var(--tw-scroll-snap-strictness)"})),x("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),x("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),x("snap-(normal|always)","scroll-snap-stop"),x("scroll-(auto|smooth)","scroll-behavior"),k("scroll-p([xytrbl])?(?:$|-)","padding",gn("scroll-padding")),k("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",gn("scroll-margin")),x("touch-(auto|none|manipulation)","touch-action"),x("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,2:e,3:t})=>({...At({"--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":n}`]:n,"touch-action":"var(--tw-touch-action)"})),x("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),x("outline",{outlineStyle:"solid"}),x("outline-(dashed|dotted|double)","outlineStyle"),k("-?(outline-offset)-"),de("outline-",{opacityVariable:!1,opacitySection:"opacity"}),k("outline-","outlineWidth"),"(pointer-events)-",k("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:n})=>({x:"horizontal",y:"vertical"})[n]||n||"both"],x("select-(none|text|all|auto)","userSelect"),de("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),de("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),k("stroke-","strokeWidth"),x("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),x("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function tr(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function Ya(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function Xt(n,e="-"){let t=[];for(let i of n)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function Ke(n){return n&&""+(n._||n)}function Ka({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function gn(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...Xn(n+"-"+Xt(r[0])+e,i),...Xn(n+"-"+Xt(r[1])+e,i)}:Xn(n+e,i)}}function Qa(n=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",n&&"opacity","saturate","sepia",!n&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${n}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...At(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,x(`${n}filter`,t),...e.map(i=>k(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:Z(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function Ns({1:n,_:e}){return{["--tw-"+n]:e,...js()}}function js(){return{...At({"--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":nl()}),transform:"var(--tw-transform)"}}function nl(n){return[n?"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 Za({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function el({1:n}){return`repeat(${n},minmax(0,1fr))`}function At(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var il=[["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:n})=>`@media (orientation:${n})`],["contrast-(more|less)",({1:n})=>`@media (prefers-contrast:${n})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:n})=>`&::${n}`],["(marker|selection)",({1:n})=>`& *::${n},&::${n}`],["file","&::file-selector-button"],["(first|last|only)",({1:n})=>`&:${n}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:n,$$:e},t)=>e&&`&[${n}-${t.theme(n,e)||at(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:n,3:e="",4:t,5:i="",6:r=e},{e:s,h:o,v:a})=>{let l=hn(i)||(t[0]=="["?t:a(t.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(n+r))})`)}${n[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:n})=>`[dir="${n}"] &`],["supports-",({$$:n},e)=>{if(n&&(n=e.theme("supports",n)||at(n,"",e)),n)return n.includes(":")||(n+=":var(--tw)"),/^\w*\s*\(/.test(n)||(n=`(${n})`),`@supports ${n.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:n},e)=>{if(n&&(n=e.theme("screens",n)||at(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=at(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&hn(n).replace(/[}]+$/,"").split("{")]];function rl({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:Ja,theme:{...Kn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:il,rules:tl,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 Lp={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Np={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},jp={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},qp={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Up={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Bp={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Hp={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},zp={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Wp={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Vp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Gp={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Xp={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Jp={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Yp={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Kp={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Qp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Zp={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},ef={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},tf={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},nf={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},rf={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},sf={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},sl={__proto__:null,slate:Lp,gray:Np,zinc:jp,neutral:qp,stone:Up,red:Bp,orange:Hp,amber:zp,yellow:Wp,lime:Vp,green:Gp,emerald:Xp,teal:Jp,cyan:Yp,sky:Kp,blue:Qp,indigo:Zp,violet:ef,purple:tf,fuchsia:nf,pink:rf,rose:sf};function nr({disablePreflight:n}={}){return rl({colors:sl,disablePreflight:n})}function ir({className:n="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])=>[`${n}-${s}`,(a,l)=>ll(n,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${n})`,({1:s},{h:o})=>[{c:o(s)}]],[`${n}-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)"}}],[n+"-",({$$:s},o)=>{let a=al(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[ol(n,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:F(20,16),marginBottom:F(20,16),paddingLeft:F(26,16)},li:{marginTop:F(8,16),marginBottom:F(8,16)},"ol>li,ul>li":{paddingLeft:F(6,16)},">ul>li p":{marginTop:F(12,16),marginBottom:F(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:F(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:F(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:F(12,16),marginBottom:F(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:F(48,16),marginBottom:F(48,16)},blockquote:{marginTop:F(32,20),marginBottom:F(32,20),paddingLeft:F(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:F(20,16),marginBottom:F(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:F(36,16),marginTop:"0",marginBottom:F(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:F(24,16),marginTop:F(48,24),marginBottom:F(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:F(20,16),marginTop:F(32,20),marginBottom:F(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:F(24,16),marginBottom:F(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:F(32,16),marginBottom:F(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:F(14,16),lineHeight:"1.4",marginTop:F(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:F(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:F(21,24)},"h3 code":{fontSize:F(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:F(14,16),lineHeight:"1.7",marginTop:F(24,14),marginBottom:F(24,14),borderRadius:"0.375rem",paddingTop:F(12,14),paddingRight:F(16,14),paddingBottom:F(12,14),paddingLeft:F(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:F(32,16),marginBottom:F(32,16),fontSize:F(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:F(8,14),paddingBottom:F(8,14),paddingLeft:F(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:F(8,14),paddingRight:F(8,14),paddingBottom:F(8,14),paddingLeft:F(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:F(20,16),lineHeight:"1.6",marginTop:F(24,20),marginBottom:F(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),ol(n,o,t)],"@layer components":{...al(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function r(s,o){let a={},l={},c=(p,u,d)=>{let f=o.theme(`colors.${s}.${u}`,u);d["--tw-prose-"+p]=We(f);let g=d!=l&&o.d("colors",`${s}-${u}`,f);g&&(l["--tw-prose-"+p]=We(g))};for(let p in i){let u=i[p];p!="dark"&&u&&c(p,u,a)}for(let p in i.dark||{}){let u=i.dark[p];u&&(i.dark?c("invert-"+p,u,a):c(p,u,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function ol(n,e,t){let i={};for(let r in t)i[ll(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function ll(n,e,{e:t,h:i},r){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>r(`${o}:where(${a}):not(:where(.${t(i("not-"+n))} *))${l}`))}function al(n){return n?typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}:void 0}function F(n,e){return`${(n/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var qs=Jn({darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"],serif:["Roboto Slab","serif"],mono:["Roboto Mono","monospace"]},colors:{primary:{50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"},secondary:{50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},tertiary:{50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"}}}},presets:[nr(),Zi(),er(),ir()],hash:!1});function rr(n,e=!0){let t=function(){if(of)try{let l=Qi(new CSSStyleSheet);return l.connect=c=>{let p=Us(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=Ki,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Qi(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,p){o[0].insert(l,c,p);let u=this.target.cssRules[c];o.forEach((d,f)=>f&&d.target.insertRule(u.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");Us(l).appendChild(c);let p=Qi(c),{cssRules:u}=this.target;for(let d=0;d<u.length;d++)p.target.insertRule(u[d].cssText,d);o.push(p),a.set(l,p)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}}(),i=Ha({...n,hash:n.hash??e},t),r=za(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(Us(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var of=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Us(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var Bs=n=>rr(qs)(n);var sr=globalThis,or=sr.ShadowRoot&&(sr.ShadyCSS===void 0||sr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),ul=new WeakMap,Qn=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Hs)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(or&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=ul.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ul.set(t,e))}return e}toString(){return this.cssText}},cl=n=>new Qn(typeof n=="string"?n:n+"",void 0,Hs),zs=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((i,r,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.")})(r)+n[s+1],n[0]);return new Qn(t,n,Hs)},Ws=(n,e)=>{if(or)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=sr.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},ar=or?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return cl(t)})(n):n;var{is:af,defineProperty:lf,getOwnPropertyDescriptor:uf,getOwnPropertyNames:cf,getOwnPropertySymbols:pf,getPrototypeOf:ff}=Object,lr=globalThis,pl=lr.trustedTypes,df=pl?pl.emptyScript:"",hf=lr.reactiveElementPolyfillSupport,Zn=(n,e)=>n,Vs={toAttribute(n,e){switch(e){case Boolean:n=n?df:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},dl=(n,e)=>!af(n,e),fl={attribute:!0,type:String,converter:Vs,reflect:!1,hasChanged:dl};Symbol.metadata??=Symbol("metadata"),lr.litPropertyMetadata??=new WeakMap;var ht=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=fl){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&lf(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=uf(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r?.call(this)},set(o){let a=r?.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??fl}static _$Ei(){if(this.hasOwnProperty(Zn("elementProperties")))return;let e=ff(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Zn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Zn("properties"))){let t=this.properties,i=[...cf(t),...pf(t)];for(let r of i)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,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 r of i)t.unshift(ar(r))}else e!==void 0&&t.push(ar(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 Ws(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),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:Vs).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let s=i.getPropertyOptions(r),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Vs;this._$Em=r,this[r]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??dl)(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[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,s]of i)s.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],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){}};ht.elementStyles=[],ht.shadowRootOptions={mode:"open"},ht[Zn("elementProperties")]=new Map,ht[Zn("finalized")]=new Map,hf?.({ReactiveElement:ht}),(lr.reactiveElementVersions??=[]).push("2.0.4");var Xs=globalThis,ur=Xs.trustedTypes,hl=ur?ur.createPolicy("lit-html",{createHTML:n=>n}):void 0,Js="$lit$",gt=`lit$${Math.random().toFixed(9).slice(2)}$`,Ys="?"+gt,gf=`<${Ys}>`,Kt=document,ti=()=>Kt.createComment(""),ni=n=>n===null||typeof n!="object"&&typeof n!="function",bl=Array.isArray,wl=n=>bl(n)||typeof n?.[Symbol.iterator]=="function",Gs=`[
2
- \f\r]`,ei=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gl=/-->/g,vl=/>/g,Jt=RegExp(`>|${Gs}(?:([^\\s"'>=/]+)(${Gs}*=${Gs}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ml=/'/g,yl=/"/g,xl=/^(?:script|style|textarea|title)$/i,kl=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),D=kl(1),ug=kl(2),Qe=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),_l=new WeakMap,Yt=Kt.createTreeWalker(Kt,129);function Sl(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return hl!==void 0?hl.createHTML(e):e}var El=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":"",o=ei;for(let a=0;a<t;a++){let l=n[a],c,p,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,p=o.exec(l),p!==null);)d=o.lastIndex,o===ei?p[1]==="!--"?o=gl:p[1]!==void 0?o=vl:p[2]!==void 0?(xl.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=Jt):p[3]!==void 0&&(o=Jt):o===Jt?p[0]===">"?(o=r??ei,u=-1):p[1]===void 0?u=-2:(u=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?Jt:p[3]==='"'?yl:ml):o===yl||o===ml?o=Jt:o===gl||o===vl?o=ei:(o=Jt,r=void 0);let f=o===Jt&&n[a+1].startsWith("/>")?" ":"";s+=o===ei?l+gf:u>=0?(i.push(c),l.slice(0,u)+Js+l.slice(u)+gt+f):l+gt+(u===-2?a:f)}return[Sl(n,s+(n[t]||"<?>")+(e===2?"</svg>":"")),i]},ii=class n{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,p]=El(e,t);if(this.el=n.createElement(c,i),Yt.currentNode=this.el.content,t===2){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=Yt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let u of r.getAttributeNames())if(u.endsWith(Js)){let d=p[o++],f=r.getAttribute(u).split(gt),g=/([.?@])?(.*)/.exec(d);l.push({type:1,index:s,name:g[2],strings:f,ctor:g[1]==="."?pr:g[1]==="?"?fr:g[1]==="@"?dr:Zt}),r.removeAttribute(u)}else u.startsWith(gt)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(xl.test(r.tagName)){let u=r.textContent.split(gt),d=u.length-1;if(d>0){r.textContent=ur?ur.emptyScript:"";for(let f=0;f<d;f++)r.append(u[f],ti()),Yt.nextNode(),l.push({type:2,index:++s});r.append(u[d],ti())}}}else if(r.nodeType===8)if(r.data===Ys)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(gt,u+1))!==-1;)l.push({type:7,index:s}),u+=gt.length-1}s++}}static createElement(e,t){let i=Kt.createElement("template");return i.innerHTML=e,i}};function Qt(n,e,t=n,i){if(e===Qe)return e;let r=i!==void 0?t._$Co?.[i]:t._$Cl,s=ni(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=r:t._$Cl=r),r!==void 0&&(e=Qt(n,r._$AS(n,e.values),r,i)),e}var cr=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,r=(e?.creationScope??Kt).importNode(t,!0);Yt.currentNode=r;let s=Yt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new vn(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new hr(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Yt.nextNode(),o++)}return Yt.currentNode=Kt,r}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++}},vn=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.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),ni(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==Qe&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):wl(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==L&&ni(this._$AH)?this._$AA.nextSibling.data=e:this.T(Kt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ii.createElement(Sl(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new cr(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=_l.get(e.strings);return t===void 0&&_l.set(e.strings,t=new ii(e)),t}k(e){bl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,r=0;for(let s of e)r===t.length?t.push(i=new n(this.S(ti()),this.S(ti()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$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))}},Zt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Qt(this,e,t,0),o=!ni(e)||e!==this._$AH&&e!==Qe,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Qt(this,a[i+l],t,l),c===Qe&&(c=this._$AH[l]),o||=!ni(c)||c!==this._$AH[l],c===L?e=L:e!==L&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!r&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},pr=class extends Zt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}},fr=class extends Zt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}},dr=class extends Zt{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Qt(this,e,t,0)??L)===Qe)return;let i=this._$AH,r=e===L&&i!==L||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==L&&(i===L||r);r&&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)}},hr=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)}},$l={P:Js,A:gt,C:Ys,M:1,L:El,R:cr,D:wl,V:Qt,I:vn,H:Zt,N:fr,U:dr,B:pr,F:hr},vf=Xs.litHtmlPolyfillSupport;vf?.(ii,vn),(Xs.litHtmlVersions??=[]).push("3.1.4");var Cl=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new vn(e.insertBefore(ti(),s),s,void 0,t??{})}return r._$AI(n),r};var q=class extends ht{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=Cl(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Qe}};q._$litElement$=!0,q.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:q});var mf=globalThis.litElementPolyfillSupport;mf?.({LitElement:q});(globalThis.litElementVersions??=[]).push("4.0.6");var yf="Free",gr,Al,ri=class extends Bs(q){constructor(){super();w(this,gr);this.planConfigs}render(){return D`
1
+ var kp=Object.defineProperty;var Aa=n=>{throw TypeError(n)};var Sp=(n,e,t)=>e in n?kp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var E=(n,e,t)=>Sp(n,typeof e!="symbol"?e+"":e,t),$s=(n,e,t)=>e.has(n)||Aa("Cannot "+t);var h=(n,e,t)=>($s(n,e,"read from private field"),t?t.call(n):e.get(n)),w=(n,e,t)=>e.has(n)?Aa("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),T=(n,e,t,i)=>($s(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),A=(n,e,t)=>($s(n,e,"access private method"),t);var Ia=(n,e,t,i)=>({set _(r){T(n,e,r,t)},get _(){return h(n,e,i)}});function Ms(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function Ep(n,e=","){return n.map(Ms).join(e)}var Ma=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Zi(n){for(var e=9,t=n.length;t--;)e=Math.imul(e^n.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function nr(n,e="@media "){return e+Z(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function Z(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function Ta(n){return n}function ir(){}var he={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function La(n){return n.match(/[-=:;]/g)?.length||0}function Rs(n){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(n)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(La(n),15)<<18}var $p=["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 Ls({n,i:e,v:t=[]},i,r,s){n&&(n=Ms({n,i:e,v:t})),s=[...Z(s)];for(let a of t){let l=i.theme("screens",a);for(let c of Z(l&&nr(l)||i.v(a))){var o;s.push(c),r|=l?67108864|Rs(c):a=="dark"?1073741824:c[0]=="@"?Rs(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~$p.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var Na=new Map;function Ps(n){if(n.d){let e=[],t=Cs(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?Cs(i,s=>Cs(r,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):As(s,o)}return As(o,s)})):i,"&"),i=>As(i,n.n?"."+Ma(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function Cs(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function As(n,e){return n.replace(/&/g,e)}var Ra=new Intl.Collator("en",{numeric:!0});function ja(n,e){for(var t=0,i=n.length;t<i;){let r=i+t>>1;0>=qa(n[r],e)?t=r+1:i=r}return i}function qa(n,e){let t=n.p&he.o;return t==(e.p&he.o)&&(t==he.b||t==he.o)?0:n.p-e.p||n.o-e.o||Ra.compare(Pa(n.n),Pa(e.n))||Ra.compare(Oa(n.n),Oa(e.n))}function Pa(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function Oa(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Is(n,e){return Math.round(parseInt(n,16)*e)}function We(n,e={}){if(typeof n=="function")return n(e);let{opacityValue:t="1",opacityVariable:i}=e,r=i?`var(${i})`:t;if(n.includes("<alpha-value>"))return n.replace("<alpha-value>",r);if(n[0]=="#"&&(n.length==4||n.length==7)){let s=(n.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Is(n.substr(1,s),o),Is(n.substr(1+s,s),o),Is(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function Ua(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:c=[],i:p},u){let d=[],f="",g=0,v=0;for(let S in o||{}){var _,$;let O=o[S];if(S[0]=="@"){if(!O)continue;if(S[1]=="a"){d.push(...js(a,l,tr(""+O),u,l,c,p,!0));continue}if(S[1]=="l"){for(let j of Z(O))d.push(...s(j,{n:a,p:(_=he[S[7]],l&~he.o|_),r:S[7]=="d"?[]:c,i:p},u));continue}if(S[1]=="i"){d.push(...Z(O).map(j=>({p:-1,o:0,r:[],d:S+" "+j})));continue}if(S[1]=="k"){d.push({p:he.d,o:0,r:[S],d:s(O,{p:he.d},u).map(Ps).join("")});continue}if(S[1]=="f"){d.push(...Z(O).map(j=>({p:he.d,o:0,r:[S],d:s(j,{p:he.d},u).map(Ps).join("")})));continue}}if(typeof O!="object"||Array.isArray(O))S=="label"&&O?a=O+Zi(JSON.stringify([l,p,o])):(O||O===0)&&(S=S.replace(/[A-Z]/g,j=>"-"+j.toLowerCase()),v+=1,g=Math.max(g,($=S)[0]=="-"?0:La($)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test($)?+!!RegExp.$1||-!!RegExp.$2:0)+1),f+=(f?";":"")+Z(O).map(j=>u.s(S,Ns(""+j,u.theme)+(p?" !important":""))).join(";"));else if(S[0]=="@"||S.includes("&")){let j=l;S[0]=="@"&&(S=S.replace(/\bscreen\(([^)]+)\)/g,(U,G)=>{let V=u.theme("screens",G);return V?(j|=67108864,nr(V,"")):U}),j|=Rs(S)),d.push(...s(O,{n:a,p:j,r:[...c,S],i:p},u))}else d.push(...s(O,{p:l,r:[...c,S]},u))}return d.unshift({n:a,p:l,o:Math.max(0,15-v)+1.5*Math.min(g||15,15),r:c,d:f}),d.sort(qa)}(n,Ls(e,t,i,r),t)}function Ns(n,e){return n.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,r,s,o="")=>{let a=e(r,o);return typeof a=="function"&&/color|fill|stroke/i.test(r)?We(a):""+Z(a).filter(l=>Object(l)!==l)})}function Ba(n,e){let t,i=[];for(let r of n)r.d&&r.n?t?.p==r.p&&""+t.r==""+r.r?(t.c=[t.c,r.c].filter(Boolean).join(" "),t.d=t.d+";"+r.d):i.push(t={...r,n:r.n&&e}):i.push({...r,n:r.n&&e});return i}function er(n,e,t=he.u,i,r){let s=[];for(let o of n)for(let a of function(l,c,p,u,d){l={...l,i:l.i||d};let f=function(g,v){let _=Na.get(g.n);return _?_(g,v):v.r(g.n,g.v[0]=="dark")}(l,c);return f?typeof f=="string"?({r:u,p}=Ls(l,c,p,u),Ba(er(tr(f),c,p,u,l.i),l.n)):Array.isArray(f)?f.map(g=>{var v,_;return{o:0,...g,r:[...Z(u),...Z(g.r)],p:(v=p,_=g.p??p,v&~he.o|_)}}):Ua(f,l,c,p,u):[{c:Ms(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(ja(s,a),0,a);return s}function js(n,e,t,i,r,s,o,a){return Ba((a?t.flatMap(l=>er([l],i,r,s,o)):er(t,i,r,s,o)).map(l=>l.p&he.o&&(l.n||e==he.b)?{...l,p:l.p&~he.o|e,o:0}:l),n)}function Cp(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:c,i:p}=Ls(s,o,e);return t&&js(a,e,t,o,l,c,p,i)},Na.set(n,r),n}function Ts(n,e,t){if(n[n.length-1]!="("){let i=[],r=!1,s=!1,o="";for(let a of n)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),r=!r),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(Ap),i:r}))}}function Ap(n,e,t){return t.indexOf(n)==e}var Fa=new Map;function tr(n){let e=Fa.get(n);if(!e){let t=[],i=[[]],r=0,s=0,o=null,a=0,l=(c,p=0)=>{r!=a&&(t.push(n.slice(r,a+p)),c&&Ts(t,i)),r=a+1};for(;a<n.length;a++){let c=n[a];if(s)n[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)n[a-1]!="\\"&&o.test(n.slice(a))&&(o=null,r=a+RegExp.lastMatch.length);else if(c=="/"&&n[a-1]!="\\"&&(n[a+1]=="*"||n[a+1]=="/"))o=n[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),t.push(c);else if(c==":")n[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=t.lastIndexOf("(");if(c==")"){let u=t[p-1];if(/[~@]$/.test(u)){let d=i.shift();t.length=p,Ts([...t,"#"],i);let{v:f}=i[0].pop();for(let g of d)g.v.splice(+(g.v[0]=="dark")-+(f[0]=="dark"),f.length);Ts([...t,Cp(u.length>1?u.slice(0,-1)+Zi(JSON.stringify([u,d])):u+"("+Ep(d)+")",he.a,d,/@$/.test(u))],i)}p=t.lastIndexOf("(",p-1)}t.length=p+1}else/[~@]/.test(c)&&n[a+1]=="("&&i.unshift([])}l(!0),Fa.set(n,e=i[0])}return e}function x(n,e,t){return[n,Os(e,t)]}function Os(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):Fs(t,1)}):t=>n||{[t[1]]:Fs(t,2)}}function Fs(n,e,t=n.slice(e).find(Boolean)||n.$$||n.input){return n.input[0]=="-"?`calc(${t} * -1)`:t}function k(n,e,t,i){return[n,qs(e,t,i)]}function qs(n,e,t){let i=typeof e=="string"?(r,s)=>({[e]:t?t(r,s):r._}):e||(({1:r,_:s},o,a)=>({[r||a]:s}));return(r,s)=>{let o=Ha(n||r[1]),a=s.theme(o,r.$$)??at(r.$$,o,s);if(a!=null)return r._=Fs(r,0,a),i(r,s,o)}}function ge(n,e={},t){return[n,Ip(e,t)]}function Ip(n={},e){return(t,i)=>{let{section:r=Ha(t[0]).replace("-","")+"Color"}=n,[s,o]=Tp(t.$$);if(!s)return;let a=i.theme(r,s)||at(s,r,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:c=r.replace("Color","Opacity"),property:p=r,selector:u}=n,d=i.theme(c,o||"DEFAULT")||o&&at(o,c,i),f=e||(({_:v})=>{let _=Yn(p,v);return u?{[u]:_}:_});t._={value:We(a,{opacityVariable:l||void 0,opacityValue:d||void 0}),color:v=>We(a,v),opacityVariable:l||void 0,opacityValue:d||void 0};let g=f(t,i);if(!t.dark){let v=i.d(r,s,a);v&&v!==a&&(t._={value:We(v,{opacityVariable:l||void 0,opacityValue:d||"1"}),color:_=>We(v,_),opacityVariable:l||void 0,opacityValue:d||void 0},g={"&":g,[i.v("dark")]:f(t,i)})}return g}}function Tp(n){return(n.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Yn(n,e){let t={};return typeof e=="string"?t[n]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[n]=e.value),t}function at(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=gn(Ns(n.slice(1,-1),t.theme)),!e)return n;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(n)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(n))||/image/i.test(e)&&!(/^image:/.test(n)||/^[a-z-]+\(/.test(n))||/weight/i.test(e)&&!(/^(number|any):/.test(n)||/^\d+$/.test(n))||/position/i.test(e)&&/^(length|size):/.test(n)))return n.replace(/^[a-z-]+:/,"")}}function Ha(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function gn(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>gn(t)+i+gn(r)):n.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 Kn({presets:n=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Z(e.variants),rules:Z(e.rules),ignorelist:Z(e.ignorelist),hash:void 0,stringify:(i,r)=>i+":"+r,finalize:[]};for(let i of Z([...n,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Z(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:r,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:a,variants:l,rules:c,ignorelist:p,hash:u=t.hash,stringify:d=t.stringify,finalize:f}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&r!==!1&&[...t.preflight,...Z(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...Z(l)],rules:[...t.rules,...Z(c)],ignorelist:[...t.ignorelist,...Z(p)],hash:u,stringify:d,finalize:[...t.finalize,...Z(f)]}}return t}function Da(n,e,t,i,r,s){for(let o of e){let a=t.get(o);a||t.set(o,a=i(o));let l=a(n,r,s);if(l)return l}}function Rp(n){var e;return Ds(n[0],typeof(e=n[1])=="function"?e:()=>e)}function Pp(n){var e,t;return Array.isArray(n)?Ds(n[0],Os(n[1],n[2])):Ds(n,Os(e,t))}function Ds(n,e){return za(n,(t,i,r,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,r)})}function za(n,e){let t=Z(n).map(Op);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function Op(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function Wa(n,e){let t=Kn(n),i=function({theme:l,darkMode:c,darkColor:p=ir,variants:u,rules:d,hash:f,stringify:g,ignorelist:v,finalize:_}){let $=new Map,S=new Map,O=new Map,j=new Map,U=za(v,(C,B)=>B.test(C));u.push(["dark",Array.isArray(c)||c=="class"?`${Z(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let G=typeof f=="function"?C=>f(C,Zi):f?Zi:Ta;G!==Ta&&_.push(C=>({...C,n:C.n&&G(C.n),d:C.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(B,X)=>"--"+G(X).replace("#",""))}));let V={theme:function({extend:C={},...B}){let X={},dt={get colors(){return ye("colors")},theme:ye,negative(){return{}},breakpoints(K){let te={};for(let ce in K)typeof K[ce]=="string"&&(te["screen-"+ce]=K[ce]);return te}};return ye;function ye(K,te,ce,Me){if(K){if({1:K,2:Me}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(K)||[,K],/[.[]/.test(K)){let Ce=[];K.replace(/\[([^\]]+)\]|([^.[]+)/g,(ne,_e,Te=_e)=>Ce.push(Te)),K=Ce.shift(),ce=te,te=Ce.join("-")}let oe=X[K]||Object.assign(Object.assign(X[K]={},ze(B,K)),ze(C,K));if(te==null)return oe;te||(te="DEFAULT");let $e=oe[te]??te.split("-").reduce((Ce,ne)=>Ce?.[ne],oe)??ce;return Me?We($e,{opacityValue:Ns(Me,ye)}):$e}let qe={};for(let oe of[...Object.keys(B),...Object.keys(C)])qe[oe]=ye(oe);return qe}function ze(K,te){let ce=K[te];return typeof ce=="function"&&(ce=ce(dt)),ce&&/color|fill|stroke/i.test(te)?function Me(qe,oe=[]){let $e={};for(let Ce in qe){let ne=qe[Ce],_e=[...oe,Ce];$e[_e.join("-")]=ne,Ce=="DEFAULT"&&(_e=oe,$e[oe.join("-")]=ne),typeof ne=="object"&&Object.assign($e,Me(ne,_e))}return $e}(ce):ce}}(l),e:Ma,h:G,s(C,B){return g(C,B,V)},d(C,B,X){return p(C,B,V,X)},v(C){return $.has(C)||$.set(C,Da(C,u,S,Rp,V)||"&:"+C),$.get(C)},r(C,B){let X=JSON.stringify([C,B]);return O.has(X)||O.set(X,!U(C,V)&&Da(C,d,j,Pp,V,B)),O.get(X)},f(C){return _.reduce((B,X)=>X(B,V),C)}};return V}(t),r=new Map,s=[],o=new Set;e.resume(l=>r.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=i.f(l),p=Ps(c);if(p&&!o.has(p)){o.add(p);let u=ja(s,l);e.insert(p,u,l),s.splice(u,0,l)}return c.n}return Object.defineProperties(function(c){if(!r.size)for(let u of Z(t.preflight))typeof u=="function"&&(u=u(i)),u&&(typeof u=="string"?js("",he.b,tr(u),i,he.b,[],!1,!0):Ua(u,{},i,he.b)).forEach(a);c=""+c;let p=r.get(c);if(!p){let u=new Set;for(let d of er(tr(c),i))u.add(d.c).add(a(d));p=[...u].filter(Boolean).join(" "),r.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let l=e.snapshot(),c=new Set(o),p=new Map(r),u=[...s];return()=>{l(),o=c,r=p,s=u}},clear(){e.clear(),o=new Set,r=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Fp(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function Va(n){let e=new MutationObserver(t);return{observe(r){e.observe(r,{attributeFilter:["class"],subtree:!0,childList:!0}),i(r),t([{target:r,type:""}])},disconnect(){e.disconnect()}};function t(r){for(let{type:s,target:o}of r)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(r){let s,o=r.getAttribute?.("class");o&&Fp(o,s=n(o))&&r.setAttribute("class",s)}}function Dp(n){let e=document.querySelector(n||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function rr(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:Dp(n)).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:ir}}var Mp=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 Ga(n){return Mp.get(n)}function Xa(n){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(n);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Ja(n,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(n);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 Lp=[["-webkit-",1],["-moz-",2],["-ms-",4]];function sr(){return({stringify:n})=>({stringify(e,t,i){let r="",s=Ga(e);s&&(r+=n(s,t,i)+";");let o=Xa(e),a=Ja(e,t);for(let l of Lp)o&l[1]&&(r+=n(l[0]+e,t,i)+";"),a&l[1]&&(r+=n(e,l[0]+t,i)+";");return r+n(e,t,i)}})}function or(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",qs("lineClamp",({_:n})=>Ya(n))],["line-clamp-(\\d+)",({1:n})=>Ya(n)]]}}function Ya(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var Zn={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",...Ue(4,"rem",4,.5,.5),...Ue(12,"rem",4,5),14:"3.5rem",...Ue(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:z("blur"),backdropBrightness:z("brightness"),backdropContrast:z("contrast"),backdropGrayscale:z("grayscale"),backdropHueRotate:z("hueRotate"),backdropInvert:z("invert"),backdropOpacity:z("opacity"),backdropSaturate:z("saturate"),backdropSepia:z("sepia"),backgroundColor:z("colors"),backgroundImage:{none:"none"},backgroundOpacity:z("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:{...Ue(200,"",100,0,50),...Ue(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:z("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:z("spacing"),borderWidth:{DEFAULT:"1px",...Ve(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:z("colors"),caretColor:z("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...Ue(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:z("borderColor"),divideOpacity:z("borderOpacity"),divideWidth:z("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:n})=>({...n("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:n})=>({...n("spacing"),...Qn(2,6),...Qn(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:z("spacing"),gradientColorStops:z("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:n})=>({...n("spacing"),...Qn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:n})=>({...n("spacing"),...Qn(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:{...Ue(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:n})=>({auto:"auto",...n("spacing")}),maxHeight:({theme:n})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...n("spacing")}),maxWidth:({theme:n,breakpoints:e})=>({...e(n("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:{...Ue(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:z("spacing"),placeholderColor:z("colors"),placeholderOpacity:z("opacity"),outlineColor:z("colors"),outlineOffset:Ve(8,"px"),outlineWidth:Ve(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:z("colors"),ringOffsetWidth:Ve(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ve(8,"px")},rotate:{...Ve(2,"deg"),...Ve(12,"deg",3),...Ve(180,"deg",45)},saturate:Ue(200,"",100,0,50),scale:{...Ue(150,"",100,0,50),...Ue(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:z("spacing"),scrollPadding:z("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ve(2,"deg"),...Ve(12,"deg",3)},space:z("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:Ue(2),textColor:z("colors"),textDecorationColor:z("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ve(8,"px")},textUnderlineOffset:{auto:"auto",...Ve(8,"px")},textIndent:z("spacing"),textOpacity:z("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:z("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:n})=>({...n("spacing"),...Qn(2,4),full:"100%"}),width:({theme:n})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...n("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Ue(50,"",1,0,10),auto:"auto"}};function Qn(n,e){let t={};do for(var i=1;i<n;i++)t[`${i}/${n}`]=Number((i/n*100).toFixed(6))+"%";while(++n<=e);return t}function Ve(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function Ue(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function z(n){return({theme:e})=>e(n)}var Ka={"*,::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, ${Zn.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, ${Zn.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 il=[x("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:at(`[${e}]`,"",t)}}})),x("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),k("aspect-","aspectRatio"),x("container",(n,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:r}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in t){let l=t[a];typeof l=="string"&&(s[nr(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=r&&(typeof r=="string"?r:r[a]||r.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),k("content-","content",({_:n})=>({"--tw-content":n,content:"var(--tw-content)"})),x("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),x("box-(border|content)","boxSizing",({1:n})=>n+"-box"),x("hidden",{display:"none"}),x("table-(auto|fixed)","tableLayout"),x(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",x("isolate","isolation"),x("object-(contain|cover|fill|none|scale-down)","objectFit"),k("object-","objectPosition"),x("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",ar),x("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),x("(static|fixed|absolute|relative|sticky)","position"),k("-?inset(-[xy])?(?:$|-)","inset",({1:n,_:e})=>({top:n!="-x"&&e,right:n!="-y"&&e,bottom:n!="-x"&&e,left:n!="-y"&&e})),k("-?(top|bottom|left|right)(?:$|-)","inset"),x("(visible|collapse)","visibility"),x("invisible",{visibility:"hidden"}),k("-?z-","zIndex"),x("flex-((row|col)(-reverse)?)","flexDirection",Qa),x("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),k("(flex-(?:grow|shrink))(?:$|-)"),k("(flex)-"),k("grow(?:$|-)","flexGrow"),k("shrink(?:$|-)","flexShrink"),k("basis-","flexBasis"),k("-?(order)-"),"-?(order)-(\\d+)",k("grid-cols-","gridTemplateColumns"),x("grid-cols-(\\d+)","gridTemplateColumns",nl),k("col-","gridColumn"),x("col-(span)-(\\d+)","gridColumn",tl),k("col-start-","gridColumnStart"),x("col-start-(auto|\\d+)","gridColumnStart"),k("col-end-","gridColumnEnd"),x("col-end-(auto|\\d+)","gridColumnEnd"),k("grid-rows-","gridTemplateRows"),x("grid-rows-(\\d+)","gridTemplateRows",nl),k("row-","gridRow"),x("row-(span)-(\\d+)","gridRow",tl),k("row-start-","gridRowStart"),x("row-start-(auto|\\d+)","gridRowStart"),k("row-end-","gridRowEnd"),x("row-end-(auto|\\d+)","gridRowEnd"),x("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>ar(Qa(n))),x("grid-flow-(dense)","gridAutoFlow"),k("auto-cols-","gridAutoColumns"),k("auto-rows-","gridAutoRows"),k("gap-x(?:$|-)","gap","columnGap"),k("gap-y(?:$|-)","gap","rowGap"),k("gap(?:$|-)","gap"),"(justify-(?:items|self))-",x("justify-","justifyContent",Za),x("(content|items|self)-",n=>({["align-"+n[1]]:Za(n)})),x("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),k("p([xytrbl])?(?:$|-)","padding",vn("padding")),k("-?m([xytrbl])?(?:$|-)","margin",vn("margin")),k("-?space-(x|y)(?:$|-)","space",({1:n,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[n]]:`calc(${e} * calc(1 - var(--tw-space-${n}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[n]]:`calc(${e} * var(--tw-space-${n}-reverse))`}})),x("space-(x|y)-reverse",({1:n})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"1"}})),k("w-","width"),k("min-w-","minWidth"),k("max-w-","maxWidth"),k("h-","height"),k("min-h-","minHeight"),k("max-h-","maxHeight"),k("font-","fontWeight"),k("font-","fontFamily",({_:n})=>typeof(n=Z(n))[1]=="string"?{fontFamily:Ke(n)}:{fontFamily:Ke(n[0]),...n[1]}),x("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),x("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),x("italic","fontStyle"),x("not-italic",{fontStyle:"normal"}),x("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:n,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":n)]:n,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...It({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),k("tracking-","letterSpacing"),k("leading-","lineHeight"),x("list-(inside|outside)","listStylePosition"),k("list-","listStyleType"),x("list-","listStyleType"),k("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),ge("placeholder-",{property:"color",selector:"&::placeholder"}),x("text-(left|center|right|justify|start|end)","textAlign"),x("text-(ellipsis|clip)","textOverflow"),k("text-opacity-","textOpacity","--tw-text-opacity"),ge("text-",{property:"color"}),k("text-","fontSize",({_:n})=>typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}),k("indent-","textIndent"),x("(overline|underline|line-through)","textDecorationLine"),x("no-underline",{textDecorationLine:"none"}),k("underline-offset-","textUnderlineOffset"),ge("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),k("decoration-","textDecorationThickness"),x("decoration-","textDecorationStyle"),x("(uppercase|lowercase|capitalize)","textTransform"),x("normal-case",{textTransform:"none"}),x("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),x("align-","verticalAlign"),x("whitespace-","whiteSpace"),x("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),x("break-words",{overflowWrap:"break-word"}),x("break-all",{wordBreak:"break-all"}),x("break-keep",{wordBreak:"keep-all"}),ge("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ge("accent-",{opacityVariable:!1,opacitySection:"opacity"}),x("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${Jt(n," ")},var(--tw-gradient-stops))`),ge("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-from":n.value,"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),ge("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${n.value},var(--tw-gradient-to)`})),ge("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),x("bg-(fixed|local|scroll)","backgroundAttachment"),x("bg-origin-(border|padding|content)","backgroundOrigin",({1:n})=>n+"-box"),x(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),x("bg-blend-","backgroundBlendMode"),x("bg-clip-(border|padding|content|text)","backgroundClip",({1:n})=>n+(n=="text"?"":"-box")),k("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ge("bg-",{section:"backgroundColor"}),k("bg-","backgroundImage"),k("bg-","backgroundPosition"),x("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",ar),k("bg-","backgroundSize"),k("rounded(?:$|-)","borderRadius"),k("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:n,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[n]||[n,n];return{[`border-${Jt(t[0])}-radius`]:e,[`border-${Jt(t[1])}-radius`]:e}}),x("border-(collapse|separate)","borderCollapse"),k("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),x("border-(solid|dashed|dotted|double|none)","borderStyle"),k("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...It({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(n||"-x")]:e,["--tw-border-spacing"+(n||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),ge("border-([xytrbl])-",{section:"borderColor"},vn("border","Color")),ge("border-"),k("border-([xytrbl])(?:$|-)","borderWidth",vn("border","Width")),k("border(?:$|-)","borderWidth"),k("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),x("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),x("divide-([xy]-reverse)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+n]:"1"}})),k("divide-([xy])(?:$|-)","divideWidth",({1:n,_:e})=>{let t={x:"lr",y:"tb"}[n];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${n}-reverse`]:"0",[`border-${Jt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${Jt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${n}-reverse))`}}}),ge("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),k("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ge("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),k("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),x("ring-inset",{"--tw-ring-inset":"inset"}),ge("ring-",{property:"--tw-ring-color"}),k("ring(?:$|-)","ringWidth",({_:n},{theme:e})=>({...It({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":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(${n} + 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"},({_:n})=>({"--tw-shadow-color":n.value,"--tw-shadow":"var(--tw-shadow-colored)"})),k("shadow(?:$|-)","boxShadow",({_:n})=>({...It({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Ke(n),"--tw-shadow-colored":Ke(n).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)"})),k("(opacity)-"),x("mix-blend-","mixBlendMode"),...el(),...el("backdrop-"),k("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:Ke(n),transitionTimingFunction:n._=="none"?void 0:Ke(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:Ke(e("transitionDuration",""))})),k("duration(?:$|-)","transitionDuration","transitionDuration",Ke),k("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ke),k("delay(?:$|-)","transitionDelay","transitionDelay",Ke),k("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=Ke(n),s=r.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:r}}),"(transform)-(none)",x("transform",Bs),x("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":rl(n=="gpu")})),k("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...Bs()})),k("-?(rotate)-","rotate",Us),k("-?(translate-[xy])-","translate",Us),k("-?(skew-[xy])-","skew",Us),x("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",ar),"(appearance)-",k("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",k("(cursor)-"),"(cursor)-",x("snap-(none)","scroll-snap-type"),x("snap-(x|y|both)",({1:n})=>({...It({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" var(--tw-scroll-snap-strictness)"})),x("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),x("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),x("snap-(normal|always)","scroll-snap-stop"),x("scroll-(auto|smooth)","scroll-behavior"),k("scroll-p([xytrbl])?(?:$|-)","padding",vn("scroll-padding")),k("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",vn("scroll-margin")),x("touch-(auto|none|manipulation)","touch-action"),x("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,2:e,3:t})=>({...It({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":n}`]:n,"touch-action":"var(--tw-touch-action)"})),x("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),x("outline",{outlineStyle:"solid"}),x("outline-(dashed|dotted|double)","outlineStyle"),k("-?(outline-offset)-"),ge("outline-",{opacityVariable:!1,opacitySection:"opacity"}),k("outline-","outlineWidth"),"(pointer-events)-",k("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:n})=>({x:"horizontal",y:"vertical"})[n]||n||"both"],x("select-(none|text|all|auto)","userSelect"),ge("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ge("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),k("stroke-","strokeWidth"),x("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),x("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function ar(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function Qa(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function Jt(n,e="-"){let t=[];for(let i of n)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function Ke(n){return n&&""+(n._||n)}function Za({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function vn(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...Yn(n+"-"+Jt(r[0])+e,i),...Yn(n+"-"+Jt(r[1])+e,i)}:Yn(n+e,i)}}function el(n=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",n&&"opacity","saturate","sepia",!n&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${n}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...It(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,x(`${n}filter`,t),...e.map(i=>k(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:Z(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function Us({1:n,_:e}){return{["--tw-"+n]:e,...Bs()}}function Bs(){return{...It({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":rl()}),transform:"var(--tw-transform)"}}function rl(n){return[n?"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 tl({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function nl({1:n}){return`repeat(${n},minmax(0,1fr))`}function It(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var sl=[["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:n})=>`@media (orientation:${n})`],["contrast-(more|less)",({1:n})=>`@media (prefers-contrast:${n})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:n})=>`&::${n}`],["(marker|selection)",({1:n})=>`& *::${n},&::${n}`],["file","&::file-selector-button"],["(first|last|only)",({1:n})=>`&:${n}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:n,$$:e},t)=>e&&`&[${n}-${t.theme(n,e)||at(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:n,3:e="",4:t,5:i="",6:r=e},{e:s,h:o,v:a})=>{let l=gn(i)||(t[0]=="["?t:a(t.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(n+r))})`)}${n[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:n})=>`[dir="${n}"] &`],["supports-",({$$:n},e)=>{if(n&&(n=e.theme("supports",n)||at(n,"",e)),n)return n.includes(":")||(n+=":var(--tw)"),/^\w*\s*\(/.test(n)||(n=`(${n})`),`@supports ${n.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:n},e)=>{if(n&&(n=e.theme("screens",n)||at(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=at(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&gn(n).replace(/[}]+$/,"").split("{")]];function ol({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:Ka,theme:{...Zn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:sl,rules:il,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 Np={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},jp={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},qp={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Up={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Bp={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Hp={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},zp={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Wp={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Vp={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Gp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Xp={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Jp={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Yp={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Kp={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Qp={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Zp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},ef={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},tf={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},nf={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},rf={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},sf={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},of={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},al={__proto__:null,slate:Np,gray:jp,zinc:qp,neutral:Up,stone:Bp,red:Hp,orange:zp,amber:Wp,yellow:Vp,lime:Gp,green:Xp,emerald:Jp,teal:Yp,cyan:Kp,sky:Qp,blue:Zp,indigo:ef,violet:tf,purple:nf,fuchsia:rf,pink:sf,rose:of};function lr({disablePreflight:n}={}){return ol({colors:al,disablePreflight:n})}function ur({className:n="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])=>[`${n}-${s}`,(a,l)=>cl(n,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${n})`,({1:s},{h:o})=>[{c:o(s)}]],[`${n}-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)"}}],[n+"-",({$$:s},o)=>{let a=ul(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[ll(n,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:F(20,16),marginBottom:F(20,16),paddingLeft:F(26,16)},li:{marginTop:F(8,16),marginBottom:F(8,16)},"ol>li,ul>li":{paddingLeft:F(6,16)},">ul>li p":{marginTop:F(12,16),marginBottom:F(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:F(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:F(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:F(12,16),marginBottom:F(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:F(48,16),marginBottom:F(48,16)},blockquote:{marginTop:F(32,20),marginBottom:F(32,20),paddingLeft:F(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:F(20,16),marginBottom:F(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:F(36,16),marginTop:"0",marginBottom:F(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:F(24,16),marginTop:F(48,24),marginBottom:F(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:F(20,16),marginTop:F(32,20),marginBottom:F(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:F(24,16),marginBottom:F(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:F(32,16),marginBottom:F(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:F(14,16),lineHeight:"1.4",marginTop:F(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:F(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:F(21,24)},"h3 code":{fontSize:F(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:F(14,16),lineHeight:"1.7",marginTop:F(24,14),marginBottom:F(24,14),borderRadius:"0.375rem",paddingTop:F(12,14),paddingRight:F(16,14),paddingBottom:F(12,14),paddingLeft:F(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:F(32,16),marginBottom:F(32,16),fontSize:F(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:F(8,14),paddingBottom:F(8,14),paddingLeft:F(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:F(8,14),paddingRight:F(8,14),paddingBottom:F(8,14),paddingLeft:F(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:F(20,16),lineHeight:"1.6",marginTop:F(24,20),marginBottom:F(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),ll(n,o,t)],"@layer components":{...ul(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function r(s,o){let a={},l={},c=(p,u,d)=>{let f=o.theme(`colors.${s}.${u}`,u);d["--tw-prose-"+p]=We(f);let g=d!=l&&o.d("colors",`${s}-${u}`,f);g&&(l["--tw-prose-"+p]=We(g))};for(let p in i){let u=i[p];p!="dark"&&u&&c(p,u,a)}for(let p in i.dark||{}){let u=i.dark[p];u&&(i.dark?c("invert-"+p,u,a):c(p,u,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function ll(n,e,t){let i={};for(let r in t)i[cl(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function cl(n,e,{e:t,h:i},r){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>r(`${o}:where(${a}):not(:where(.${t(i("not-"+n))} *))${l}`))}function ul(n){return n?typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}:void 0}function F(n,e){return`${(n/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Hs=Kn({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:[lr(),sr(),or(),ur()]});function cr(n,e=!0){let t=function(){if(af)try{let l=rr(new CSSStyleSheet);return l.connect=c=>{let p=zs(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=ir,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[rr(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,p){o[0].insert(l,c,p);let u=this.target.cssRules[c];o.forEach((d,f)=>f&&d.target.insertRule(u.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");zs(l).appendChild(c);let p=rr(c),{cssRules:u}=this.target;for(let d=0;d<u.length;d++)p.target.insertRule(u[d].cssText,d);o.push(p),a.set(l,p)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}}(),i=Wa({...n,hash:n.hash??e},t),r=Va(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(zs(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var af=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function zs(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var Ws=n=>cr(Hs)(n);var pr=globalThis,fr=pr.ShadowRoot&&(pr.ShadyCSS===void 0||pr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vs=Symbol(),pl=new WeakMap,ei=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Vs)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(fr&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=pl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&pl.set(t,e))}return e}toString(){return this.cssText}},fl=n=>new ei(typeof n=="string"?n:n+"",void 0,Vs),ht=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((i,r,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.")})(r)+n[s+1],n[0]);return new ei(t,n,Vs)},Gs=(n,e)=>{if(fr)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=pr.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},dr=fr?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return fl(t)})(n):n;var{is:lf,defineProperty:uf,getOwnPropertyDescriptor:cf,getOwnPropertyNames:pf,getOwnPropertySymbols:ff,getPrototypeOf:df}=Object,hr=globalThis,dl=hr.trustedTypes,hf=dl?dl.emptyScript:"",gf=hr.reactiveElementPolyfillSupport,ti=(n,e)=>n,Xs={toAttribute(n,e){switch(e){case Boolean:n=n?hf:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},gl=(n,e)=>!lf(n,e),hl={attribute:!0,type:String,converter:Xs,reflect:!1,hasChanged:gl};Symbol.metadata??=Symbol("metadata"),hr.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=hl){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&uf(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=cf(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r?.call(this)},set(o){let a=r?.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??hl}static _$Ei(){if(this.hasOwnProperty(ti("elementProperties")))return;let e=df(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ti("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ti("properties"))){let t=this.properties,i=[...pf(t),...ff(t)];for(let r of i)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,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 r of i)t.unshift(dr(r))}else e!==void 0&&t.push(dr(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 Gs(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),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:Xs).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let s=i.getPropertyOptions(r),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Xs;this._$Em=r,this[r]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??gl)(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[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,s]of i)s.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],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[ti("elementProperties")]=new Map,gt[ti("finalized")]=new Map,gf?.({ReactiveElement:gt}),(hr.reactiveElementVersions??=[]).push("2.0.4");var Ys=globalThis,gr=Ys.trustedTypes,vl=gr?gr.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ks="$lit$",vt=`lit$${Math.random().toFixed(9).slice(2)}$`,Qs="?"+vt,vf=`<${Qs}>`,Qt=document,ii=()=>Qt.createComment(""),ri=n=>n===null||typeof n!="object"&&typeof n!="function",xl=Array.isArray,kl=n=>xl(n)||typeof n?.[Symbol.iterator]=="function",Js=`[
2
+ \f\r]`,ni=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ml=/-->/g,yl=/>/g,Yt=RegExp(`>|${Js}(?:([^\\s"'>=/]+)(${Js}*=${Js}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),_l=/'/g,bl=/"/g,Sl=/^(?:script|style|textarea|title)$/i,El=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),D=El(1),cg=El(2),Qe=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),wl=new WeakMap,Kt=Qt.createTreeWalker(Qt,129);function $l(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return vl!==void 0?vl.createHTML(e):e}var Cl=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":"",o=ni;for(let a=0;a<t;a++){let l=n[a],c,p,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,p=o.exec(l),p!==null);)d=o.lastIndex,o===ni?p[1]==="!--"?o=ml:p[1]!==void 0?o=yl:p[2]!==void 0?(Sl.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=Yt):p[3]!==void 0&&(o=Yt):o===Yt?p[0]===">"?(o=r??ni,u=-1):p[1]===void 0?u=-2:(u=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?Yt:p[3]==='"'?bl:_l):o===bl||o===_l?o=Yt:o===ml||o===yl?o=ni:(o=Yt,r=void 0);let f=o===Yt&&n[a+1].startsWith("/>")?" ":"";s+=o===ni?l+vf:u>=0?(i.push(c),l.slice(0,u)+Ks+l.slice(u)+vt+f):l+vt+(u===-2?a:f)}return[$l(n,s+(n[t]||"<?>")+(e===2?"</svg>":"")),i]},si=class n{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,p]=Cl(e,t);if(this.el=n.createElement(c,i),Kt.currentNode=this.el.content,t===2){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=Kt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let u of r.getAttributeNames())if(u.endsWith(Ks)){let d=p[o++],f=r.getAttribute(u).split(vt),g=/([.?@])?(.*)/.exec(d);l.push({type:1,index:s,name:g[2],strings:f,ctor:g[1]==="."?mr:g[1]==="?"?yr:g[1]==="@"?_r:en}),r.removeAttribute(u)}else u.startsWith(vt)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(Sl.test(r.tagName)){let u=r.textContent.split(vt),d=u.length-1;if(d>0){r.textContent=gr?gr.emptyScript:"";for(let f=0;f<d;f++)r.append(u[f],ii()),Kt.nextNode(),l.push({type:2,index:++s});r.append(u[d],ii())}}}else if(r.nodeType===8)if(r.data===Qs)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(vt,u+1))!==-1;)l.push({type:7,index:s}),u+=vt.length-1}s++}}static createElement(e,t){let i=Qt.createElement("template");return i.innerHTML=e,i}};function Zt(n,e,t=n,i){if(e===Qe)return e;let r=i!==void 0?t._$Co?.[i]:t._$Cl,s=ri(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=r:t._$Cl=r),r!==void 0&&(e=Zt(n,r._$AS(n,e.values),r,i)),e}var vr=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,r=(e?.creationScope??Qt).importNode(t,!0);Kt.currentNode=r;let s=Kt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new mn(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new br(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Kt.nextNode(),o++)}return Kt.currentNode=Qt,r}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++}},mn=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.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=Zt(this,e,t),ri(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==Qe&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):kl(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==L&&ri(this._$AH)?this._$AA.nextSibling.data=e:this.T(Qt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=si.createElement($l(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new vr(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=wl.get(e.strings);return t===void 0&&wl.set(e.strings,t=new si(e)),t}k(e){xl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,r=0;for(let s of e)r===t.length?t.push(i=new n(this.S(ii()),this.S(ii()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$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))}},en=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Zt(this,e,t,0),o=!ri(e)||e!==this._$AH&&e!==Qe,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Zt(this,a[i+l],t,l),c===Qe&&(c=this._$AH[l]),o||=!ri(c)||c!==this._$AH[l],c===L?e=L:e!==L&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!r&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},mr=class extends en{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}},yr=class extends en{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}},_r=class extends en{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Zt(this,e,t,0)??L)===Qe)return;let i=this._$AH,r=e===L&&i!==L||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==L&&(i===L||r);r&&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)}},br=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){Zt(this,e)}},Al={P:Ks,A:vt,C:Qs,M:1,L:Cl,R:vr,D:kl,V:Zt,I:mn,H:en,N:yr,U:_r,B:mr,F:br},mf=Ys.litHtmlPolyfillSupport;mf?.(si,mn),(Ys.litHtmlVersions??=[]).push("3.1.4");var Il=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new mn(e.insertBefore(ii(),s),s,void 0,t??{})}return r._$AI(n),r};var q=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=Il(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Qe}};q._$litElement$=!0,q.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:q});var yf=globalThis.litElementPolyfillSupport;yf?.({LitElement:q});(globalThis.litElementVersions??=[]).push("4.0.6");var _f="Free",wr,Tl,oi=class extends Ws(q){constructor(){super();w(this,wr);this.planConfigs}render(){return D`
4
4
  <a href="/pricing-plans" target="_blank" class="text-sm text-white">
5
- <div class="flex m-3 px-3 py-2 bg-tertiary-500 flex-row rounded-xl items-start">
6
- <p class="flex-grow">Upgrade your <span class="font-bold text-[#b9e901]">${this.planConfigs?.title}</span> plan to add more than <span class="font-bold text-[#b9e901]">${this.planConfigs?.maxProducts?.toLocaleString()}</span> products.</p>
7
- <span class="h-full flex-none rounded-full border border-white px-5 py-2 text-sm font-medium text-white transition-colors duration-200 hover:bg-white/10">${this.planConfigs.title!==yf?"Upgrade":"Try Free"}</span>
8
- <button type="button" @click="${A(this,gr,Al)}" class="ml-1 h-6 rounded-full transition-colors bg-tertiary-500 hover:bg-tertiary-700" aria-label="Close">
5
+ <div class="flex m-3 px-3 py-2 bg-violet-500 flex-row rounded-xl items-start">
6
+ <p class="flex-grow">Upgrade your <span class="font-bold text-lime">${this.planConfigs?.title}</span> plan to add more than <span class="font-bold text-lime">${this.planConfigs?.maxProducts?.toLocaleString()}</span> products.</p>
7
+ <span class="h-full flex-none rounded-full border border-white px-5 py-2 text-sm font-medium text-white transition-colors duration-200 hover:bg-white/10">${this.planConfigs.title!==_f?"Upgrade":"Try Free"}</span>
8
+ <button type="button" @click="${A(this,wr,Tl)}" class="ml-1 h-6 rounded-full transition-colors bg-violet-500 hover:bg-violet-700" aria-label="Close">
9
9
  <span class="inline-block h-6 w-6 leading-6">✕</span>
10
10
  </button>
11
11
  </div>
12
12
  </a>
13
- `}firstUpdated(){this.planConfigs.slug==="scale"&&(this.style.display="none")}};gr=new WeakSet,Al=function(t){t.preventDefault(),this.style.display="none"},$(ri,"properties",{planConfigs:{type:Object,attribute:"plan-configs"}});var Ks=Jn({darkMode:"class",theme:{extend:{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"]},fontFamily:{sans:["system-ui","Roboto","Helvetica","Arial","sans-serif"],serif:["ui-serif","Georgia","Cambria","serif"],mono:["ui-monospace","Menlo","Monaco","monospace"]}}},presets:[nr(),Zi(),er(),ir()],hash:!1});var W=n=>rr(Ks)(n);var si=class extends W(q){constructor(){super();$(this,"render",()=>D`
13
+ `}firstUpdated(){this.planConfigs.slug==="scale"&&(this.style.display="none")}};wr=new WeakSet,Tl=function(t){t.preventDefault(),this.style.display="none"},E(oi,"properties",{planConfigs:{type:Object,attribute:"plan-configs"}});var Zs=Kn({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:[lr(),sr(),or(),ur()]});var W=n=>cr(Zs)(n);var ai=class extends W(q){constructor(){super();E(this,"render",()=>D`
14
14
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
15
15
  <!-- 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 -->
16
16
  <button class="leading-0 bg-slate-800 relative inline-block h-14 w-14 rounded-full overflow-hidden shadow-xl transition-transform hover:scale-105 active:scale-90 text-sm text-white">
@@ -35,15 +35,15 @@ var xp=Object.defineProperty;var $a=n=>{throw TypeError(n)};var kp=(n,e,t)=>e in
35
35
  </svg>
36
36
  </div>
37
37
  </button>
38
- `);this.state="open",this.src=""}};$(si,"properties",{state:{type:String},src:{type:String}});var vr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},mr=n=>(...e)=>({_$litDirective$:n,values:e}),mn=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:_f}=$l;var Il=()=>document.createComment(""),yn=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(Il(),r),o=i.insertBefore(Il(),r);t=new _f(s,o,n,n.options)}else{let s=t._$AB.nextSibling,o=t._$AM,a=o!==n;if(a){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==o._$AU&&t._$AP(l)}if(s!==r||a){let l=t._$AA;for(;l!==s;){let c=l.nextSibling;i.insertBefore(l,r),l=c}}}return t},It=(n,e,t=n)=>(n._$AI(e,t),n),bf={},Tl=(n,e=bf)=>n._$AH=e,Rl=n=>n._$AH,yr=n=>{n._$AP?.(!1,!0);let e=n._$AA,t=n._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var Pl=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},oi=mr(class extends mn{constructor(n){if(super(n),n.type!==vr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let r=[],s=[],o=0;for(let a of n)r[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){let r=Rl(n),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,s;let a=this.ut??=[],l=[],c,p,u=0,d=r.length-1,f=0,g=s.length-1;for(;u<=d&&f<=g;)if(r[u]===null)u++;else if(r[d]===null)d--;else if(a[u]===o[f])l[f]=It(r[u],s[f]),u++,f++;else if(a[d]===o[g])l[g]=It(r[d],s[g]),d--,g--;else if(a[u]===o[g])l[g]=It(r[u],s[g]),yn(n,l[g+1],r[u]),u++,g--;else if(a[d]===o[f])l[f]=It(r[d],s[f]),yn(n,r[u],r[d]),d--,f++;else if(c===void 0&&(c=Pl(o,f,g),p=Pl(a,u,d)),c.has(a[u]))if(c.has(a[d])){let v=p.get(o[f]),_=v!==void 0?r[v]:null;if(_===null){let E=yn(n,r[u]);It(E,s[f]),l[f]=E}else l[f]=It(_,s[f]),yn(n,r[u],_),r[v]=null;f++}else yr(r[d]),d--;else yr(r[u]),u++;for(;f<=g;){let v=yn(n,l[g+1]);It(v,s[f]),l[f++]=v}for(;u<=d;){let v=r[u++];v!==null&&yr(v)}return this.ut=o,Tl(n,l),Qe}});function Ol(n,e,t){return n?e(n):t?.(n)}var _r,Fl,br=class br extends W(q){constructor(){super();w(this,_r);$(this,"render",()=>!this.examples?.title&&!this.examples?.items?.length?L:D`
38
+ `);this.state="open",this.src=""}};E(ai,"properties",{state:{type:String},src:{type:String}});var xr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},kr=n=>(...e)=>({_$litDirective$:n,values:e}),yn=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:bf}=Al;var Rl=()=>document.createComment(""),_n=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(Rl(),r),o=i.insertBefore(Rl(),r);t=new bf(s,o,n,n.options)}else{let s=t._$AB.nextSibling,o=t._$AM,a=o!==n;if(a){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==o._$AU&&t._$AP(l)}if(s!==r||a){let l=t._$AA;for(;l!==s;){let c=l.nextSibling;i.insertBefore(l,r),l=c}}}return t},Tt=(n,e,t=n)=>(n._$AI(e,t),n),wf={},Pl=(n,e=wf)=>n._$AH=e,Ol=n=>n._$AH,Sr=n=>{n._$AP?.(!1,!0);let e=n._$AA,t=n._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var Fl=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},li=kr(class extends yn{constructor(n){if(super(n),n.type!==xr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let r=[],s=[],o=0;for(let a of n)r[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){let r=Ol(n),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,s;let a=this.ut??=[],l=[],c,p,u=0,d=r.length-1,f=0,g=s.length-1;for(;u<=d&&f<=g;)if(r[u]===null)u++;else if(r[d]===null)d--;else if(a[u]===o[f])l[f]=Tt(r[u],s[f]),u++,f++;else if(a[d]===o[g])l[g]=Tt(r[d],s[g]),d--,g--;else if(a[u]===o[g])l[g]=Tt(r[u],s[g]),_n(n,l[g+1],r[u]),u++,g--;else if(a[d]===o[f])l[f]=Tt(r[d],s[f]),_n(n,r[u],r[d]),d--,f++;else if(c===void 0&&(c=Fl(o,f,g),p=Fl(a,u,d)),c.has(a[u]))if(c.has(a[d])){let v=p.get(o[f]),_=v!==void 0?r[v]:null;if(_===null){let $=_n(n,r[u]);Tt($,s[f]),l[f]=$}else l[f]=Tt(_,s[f]),_n(n,r[u],_),r[v]=null;f++}else Sr(r[d]),d--;else Sr(r[u]),u++;for(;f<=g;){let v=_n(n,l[g+1]);Tt(v,s[f]),l[f++]=v}for(;u<=d;){let v=r[u++];v!==null&&Sr(v)}return this.ut=o,Pl(n,l),Qe}});function Dl(n,e,t){return n?e(n):t?.(n)}var Er,Ml,$r=class $r extends W(q){constructor(){super();w(this,Er);E(this,"render",()=>!this.examples?.title&&!this.examples?.items?.length?L:D`
39
39
  <div class="h-full w-full flex flex-col font-sans text-base bg-[#FDFDFD] items-stretch justify-center">
40
40
  <!-- examples section -->
41
41
  <div class="m-4">
42
- ${Ol(this.examples.title,()=>D`<p class="text-md text-center text-gray-500 font-semibold select-none">${this.examples.title}</p>`)}
42
+ ${Dl(this.examples.title,()=>D`<p class="text-md text-center text-gray-500 font-semibold select-none">${this.examples.title}</p>`)}
43
43
  ${this.examples?.items?.length?D`
44
44
  <ul class="prose mt-2 text-left text-gray-400 select-none">
45
- ${oi(this.examples.items,t=>t,t=>D`
46
- <li class="w-full rounded-2xl bg-white px-4 py-3 text-sm outline outline-1 outline-[#eeedf1] transition-[color,outline] hover:cursor-pointer hover:outline-[#999]" @click="${()=>A(this,_r,Fl).call(this,t)}">
45
+ ${li(this.examples.items,t=>t,t=>D`
46
+ <li class="w-full rounded-2xl bg-white px-4 py-3 text-sm outline outline-1 outline-[#eeedf1] transition-[color,outline] hover:cursor-pointer hover:outline-[#999]" @click="${()=>A(this,Er,Ml).call(this,t)}">
47
47
  <span>“${t.trim()}” →</span>
48
48
  </li>
49
49
  `)}
@@ -54,7 +54,7 @@ var xp=Object.defineProperty;var $a=n=>{throw TypeError(n)};var kp=(n,e,t)=>e in
54
54
  <!-- spacer for visual alignment -->
55
55
  <div class="h-1/9"></div>
56
56
  </div>
57
- `);this.examples={title:"",items:[]}}};_r=new WeakSet,Fl=function(t){this.dispatchEvent(new br.ExampleClickEvent({example:t}))},$(br,"properties",{examples:{type:Object}});var _n=br,Qs;_n.ExampleClickEvent=(Qs=class extends CustomEvent{constructor(e,t={}){super(_n.ExampleClickEvent.type,{detail:e,...t})}},$(Qs,"type","mw:example-click"),Qs);var bn,Dl,Ml,ai=class ai extends W(q){constructor(){super();w(this,bn);$(this,"render",()=>D`
57
+ `);this.examples={title:"",items:[]}}};Er=new WeakSet,Ml=function(t){this.dispatchEvent(new $r.ExampleClickEvent({example:t}))},E($r,"properties",{examples:{type:Object}});var bn=$r,eo;bn.ExampleClickEvent=(eo=class extends CustomEvent{constructor(e,t={}){super(bn.ExampleClickEvent.type,{detail:e,...t})}},E(eo,"type","mw:example-click"),eo);var wn,Ll,Nl,ui=class ui extends W(q){constructor(){super();w(this,wn);E(this,"render",()=>D`
58
58
  <div class="flex items-center justify-between space-x-4 p-4 text-lg bg-white font-sans">
59
59
  <mw-pulse-dot class="contents" position="bottom-right" color="green-500">
60
60
  <div class="h-10 w-10 overflow-hidden rounded">
@@ -72,7 +72,7 @@ var xp=Object.defineProperty;var $a=n=>{throw TypeError(n)};var kp=(n,e,t)=>e in
72
72
 
73
73
  <div class="flex-grow"></div>
74
74
 
75
- <button @click=${A(this,bn,Dl)} class="${this.showNewChat?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50">
75
+ <button @click=${A(this,wn,Ll)} class="${this.showNewChat?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50">
76
76
  <!-- -->
77
77
  <p class="inline-flex h-6 w-6 items-center justify-center">
78
78
  <span class="whitespace-pre text-[11px] font-medium leading-[15px]">${this.content.newChatTitle||`NEW
@@ -80,15 +80,15 @@ CHAT`}</span>
80
80
  </p>
81
81
  </button>
82
82
 
83
- <button @click=${A(this,bn,Ml)} class="${this.showClose?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50 sm:hidden">
83
+ <button @click=${A(this,wn,Nl)} class="${this.showClose?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50 sm:hidden">
84
84
  <!-- x -->
85
85
  <span class="inline-block h-6 w-6 leading-6">✕</span>
86
86
  </button>
87
87
  </div>
88
- `);this.content={logoUrl:"",title:"",status:"",color:"",newChatTitle:""},this.showNewChat=!1,this.showClose=!1}};bn=new WeakSet,Dl=function(){this.dispatchEvent(new ai.NewChatClickEvent)},Ml=function(){this.dispatchEvent(new ai.CloseClickEvent)},$(ai,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}});var Tt=ai,Zs;Tt.NewChatClickEvent=(Zs=class extends CustomEvent{constructor(e={}){super(Tt.NewChatClickEvent.type,{...e})}},$(Zs,"type","mw:new-chat-click"),Zs);var eo;Tt.CloseClickEvent=(eo=class extends CustomEvent{constructor(e={}){super(Tt.CloseClickEvent.type,{...e})}},$(eo,"type","mw:close-click"),eo);var Ge,Ll,Nl,jl,ql,Ul,wn=class wn extends W(q){constructor(){super();w(this,Ge);$(this,"render",()=>D`
89
- <form class="flex items-center space-x-4 border-t font-sans text-base bg-white px-4" @submit="${A(this,Ge,ql)}">
88
+ `);this.content={logoUrl:"",title:"",status:"",color:"",newChatTitle:""},this.showNewChat=!1,this.showClose=!1}};wn=new WeakSet,Ll=function(){this.dispatchEvent(new ui.NewChatClickEvent)},Nl=function(){this.dispatchEvent(new ui.CloseClickEvent)},E(ui,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}});var Rt=ui,to;Rt.NewChatClickEvent=(to=class extends CustomEvent{constructor(e={}){super(Rt.NewChatClickEvent.type,{...e})}},E(to,"type","mw:new-chat-click"),to);var no;Rt.CloseClickEvent=(no=class extends CustomEvent{constructor(e={}){super(Rt.CloseClickEvent.type,{...e})}},E(no,"type","mw:close-click"),no);var Ge,jl,ql,Ul,Bl,Hl,xn=class xn extends W(q){constructor(){super();w(this,Ge);E(this,"render",()=>D`
89
+ <form class="flex items-center space-x-4 border-t font-sans text-base bg-white px-4" @submit="${A(this,Ge,Bl)}">
90
90
  <!-- text input -->
91
- <textarea name="input" @input="${A(this,Ge,Ul)}" @keydown="${A(this,Ge,jl)}" class="bg-white disabled:bg-white my-2 block w-full flex-1 resize-none rounded py-2 text-[16px] text-gray-800 outline-none transition-colors" placeholder="${this.placeholder}" autofocus ?disabled="${this.disabled}"></textarea>
91
+ <textarea name="input" @input="${A(this,Ge,Hl)}" @keydown="${A(this,Ge,Ul)}" class="bg-white disabled:bg-white my-2 block w-full flex-1 resize-none rounded py-2 text-[16px] text-gray-800 outline-none transition-colors" placeholder="${this.placeholder}" autofocus ?disabled="${this.disabled}"></textarea>
92
92
 
93
93
  <!-- send/cancel button -->
94
94
  <div class="py-2">
@@ -107,7 +107,7 @@ CHAT`}</span>
107
107
  </button>
108
108
  </div>
109
109
  </form>
110
- `);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message...",this.color=""}};Ge=new WeakSet,Ll=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Nl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},jl=function(t){wf(t)&&(t.preventDefault(),this.streaming||h(this,Ge,Nl)?.click())},ql=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new wn.CancelEvent);return}let i=h(this,Ge,Ll);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new wn.SubmitEvent(i.value))&&(i.value="")},Ul=function(t){this.dispatchEvent(new wn.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""}))},$(wn,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String},color:{type:String}});var lt=wn,to;lt.ChangeEvent=(to=class extends CustomEvent{constructor(e,t={}){super(lt.ChangeEvent.type,{detail:e,...t})}},$(to,"type","mw:change"),to);var no;lt.SubmitEvent=(no=class extends CustomEvent{constructor(e,t={}){super(lt.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},$(no,"type","mw:submit"),no);var io;lt.CancelEvent=(io=class extends CustomEvent{constructor(e={}){super(lt.CancelEvent.type,{...e})}},$(io,"type","mw:cancel"),io);function wf(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}var li=class extends W(q){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl=""}render(){switch(this.side){case"user":return D`
110
+ `);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message...",this.color=""}};Ge=new WeakSet,jl=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},ql=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Ul=function(t){xf(t)&&(t.preventDefault(),this.streaming||h(this,Ge,ql)?.click())},Bl=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new xn.CancelEvent);return}let i=h(this,Ge,jl);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new xn.SubmitEvent(i.value))&&(i.value="")},Hl=function(t){this.dispatchEvent(new xn.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""}))},E(xn,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String},color:{type:String}});var lt=xn,io;lt.ChangeEvent=(io=class extends CustomEvent{constructor(e,t={}){super(lt.ChangeEvent.type,{detail:e,...t})}},E(io,"type","mw:change"),io);var ro;lt.SubmitEvent=(ro=class extends CustomEvent{constructor(e,t={}){super(lt.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},E(ro,"type","mw:submit"),ro);var so;lt.CancelEvent=(so=class extends CustomEvent{constructor(e={}){super(lt.CancelEvent.type,{...e})}},E(so,"type","mw:cancel"),so);function xf(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}var ci=class extends W(q){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl=""}render(){switch(this.side){case"user":return D`
111
111
  <div class="ml-20 flex justify-end font-sans text-base">
112
112
  <div class="max-w-full">
113
113
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -142,15 +142,15 @@ CHAT`}</span>
142
142
  </div>
143
143
  </div>
144
144
  </div>
145
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};$(li,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"}});var ui=class extends mn{constructor(e){if(super(e),this.it=L,e.type!==vr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||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:[]}}};ui.directiveName="unsafeHTML",ui.resultType=1;var Bl=mr(ui);var ro;function xf(n){return{lang:n?.lang??ro?.lang,message:n?.message,abortEarly:n?.abortEarly??ro?.abortEarly,abortPipeEarly:n?.abortPipeEarly??ro?.abortPipeEarly}}var kf;function Sf(n){return kf?.get(n)}var Ef;function $f(n){return Ef?.get(n)}var Cf;function Af(n,e){return Cf?.get(n)?.get(e)}function xn(n){let e=typeof n;return e==="object"&&(e=(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null"),e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e}function Rt(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??xn(s),l={kind:n.kind,type:n.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:n.requirement,path:r?.path,issues:r?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=n.kind==="schema",p=r?.message??n.message??Af(n.reference,l.lang)??(c?$f(l.lang):null)??i.message??Sf(l.lang);p&&(l.message=typeof p=="function"?p(l):p),c&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}var If=class extends Error{constructor(e){super(e[0].message);$(this,"issues");this.name="ValiError",this.issues=e}};function so(n,e){return{kind:"validation",type:"max_value",reference:so,async:!1,expects:`<=${n instanceof Date?n.toJSON():xn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&Rt(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():xn(t.value)}),t}}}function oo(n,e){return{kind:"validation",type:"min_value",reference:oo,async:!1,expects:`>=${n instanceof Date?n.toJSON():xn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&Rt(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():xn(t.value)}),t}}}function Tf(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function vt(n,e){return{kind:"schema",type:"array",reference:vt,expects:"Array",async:!1,item:n,message:e,_run(t,i){let r=t.value;if(Array.isArray(r)){t.typed=!0,t.value=[];for(let s=0;s<r.length;s++){let o=r[s],a=this.item._run({typed:!1,value:o},i);if(a.issues){let l={type:"array",origin:"value",input:r,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],t.issues?.push(c);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else Rt(this,"type",t,i);return t}}}function Ae(n){return{kind:"schema",type:"boolean",reference:Ae,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:Rt(this,"type",e,t),e}}}function Xe(n){return{kind:"schema",type:"number",reference:Xe,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Rt(this,"type",e,t),e}}}function re(n,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:n,message:e,_run(t,i){let r=t.value;if(r&&typeof r=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=r[s],a=this.entries[s]._run({typed:!1,value:o},i);if(a.issues){let l={type:"object",origin:"value",input:r,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],t.issues?.push(c);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||s in r)&&(t.value[s]=a.value)}}else Rt(this,"type",t,i);return t}}}function T(n,...e){let t={kind:"schema",type:"optional",reference:T,expects:`${n.expects} | undefined`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=Tf(this,i,r)),i.value===void 0)?(i.typed=!0,i):this.wrapped._run(i,r)}};return 0 in e&&(t.default=e[0]),t}function kn(n,e){return{kind:"schema",type:"picklist",reference:kn,expects:n.map(xn).join(" | ")||"never",async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:Rt(this,"type",t,i),t}}}function N(n){return{kind:"schema",type:"string",reference:N,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:Rt(this,"type",e,t),e}}}function Hl(n,e,t){let i=n._run({typed:!1,value:e},xf(t));if(i.issues)throw new If(i.issues);return i.value}function zl(...n){return{...n[0],pipe:n,_run(e,t){for(let i=0;i<n.length;i++){if(e.issues&&(n[i].kind==="schema"||n[i].kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n[i]._run(e,t))}return e}}}var ci,Le,Ze,pi,ao,wr=class{constructor(e,t){w(this,pi);w(this,ci);w(this,Le);w(this,Ze);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");R(this,ci,e),h(this,ci).addController(this),R(this,Le,t)}connect(e){R(this,Le,e),R(this,Ze,A(this,pi,ao).call(this))}hostConnected(){setTimeout(()=>{R(this,Ze,A(this,pi,ao).call(this))},0)}hostDisconnected(){h(this,Ze)?.close(1e3,"lit_host_disconnected"),R(this,Ze,void 0)}send(e){h(this,Ze)?.send(e)}close(e,t){h(this,Ze)?.close(e,t)}render(e={}){switch(h(this,Ze)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}get isConnected(){return h(this,Ze)?.readyState===WebSocket.OPEN}};ci=new WeakMap,Le=new WeakMap,Ze=new WeakMap,pi=new WeakSet,ao=function(){let e=new WebSocket(h(this,Le).url());return h(this,Le).onClose&&(e.onclose=h(this,Le).onClose),h(this,Le).onOpen&&(e.onopen=h(this,Le).onOpen),h(this,Le).onError&&(e.onerror=h(this,Le).onError),h(this,Le).onMessage&&(e.onmessage=h(this,Le).onMessage),e};var Vl="664df22d-d461-42d6-801e-f70247e2cd7c",_e,be,et,Sn,En,xe,en,Gl,Xl,Jl,Yl,xr=class{constructor(e,t){w(this,xe);w(this,_e);w(this,be);w(this,et);$(this,"isStreaming",!1);$(this,"typingIndicator");$(this,"ranOutOfCredits",!1);$(this,"messages",[]);$(this,"conversationId","");w(this,Sn,0);w(this,En);$(this,"isLiveMode",!1);R(this,_e,e),R(this,be,t),R(this,et,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return A(this,xe,en).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return A(this,xe,en).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return A(this,xe,en).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return A(this,xe,en).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){A(this,xe,en).call(this,{type:"RELOAD_CONFIG"})}close(){h(this,et).close(1e3,"closed by user")}retry(){clearTimeout(h(this,En)),R(this,En,setTimeout(()=>{h(this,be).onReconnect?.(),R(this,et,this.initWS())},1e3*h(this,Sn))),Ca(this,Sn)._++}initWS(){return new wr(h(this,_e),{url:()=>h(this,be).url(this.conversationId,{}),onOpen:e=>A(this,xe,Gl).call(this,e),onMessage:e=>A(this,xe,Xl).call(this,JSON.parse(e.data)),onError:e=>A(this,xe,Jl).call(this,e),onClose:e=>A(this,xe,Yl).call(this,e)})}hostConnected(){this.conversationId=h(this,be).restoreConversationState?.()?.conversationId||"",this.messages=h(this,be).restoreConversationState?.()?.messages||[]}reset(){A(this,xe,en).call(this,{type:"NEW_CHAT"}),h(this,be).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,h(this,_e).requestUpdate()}hostDisconnected(){clearTimeout(h(this,En))}reconnectSocket(){h(this,et).close(1e3,"destroy"),R(this,et,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};_e=new WeakMap,be=new WeakMap,et=new WeakMap,Sn=new WeakMap,En=new WeakMap,xe=new WeakSet,en=function(e,{expectStreaming:t=!1}={}){return h(this,et).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,h(this,_e).requestUpdate()),h(this,et).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Gl=function(e){R(this,Sn,0)},Xl=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,i,r)=>i===r.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,h(this,_e).requestUpdate(),h(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),h(this,_e).requestUpdate(),h(this,be).onUpdateMessage?.(e);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);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,h(this,_e).requestUpdate(),h(this,be).onMessageDone?.(e,t),h(this,be).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,h(this,_e).requestUpdate();break}case"ERROR":{h(this,be).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,h(this,be).onConnect?.(e.conversationId),h(this,be).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,h(this,_e).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},h(this,_e).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,h(this,_e).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Vl)||this.messages.push({id:Vl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,h(this,_e).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),h(this,_e).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Jl=function(e){console.error("onError",e),h(this,be).onError?.(e)},Yl=function(e){h(this,_e).isConnected&&!h(this,et).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,h(this,_e).requestUpdate(),h(this,be).onClose?.()};var fi,$n,Pt,tn,Sr,Kl,kr=class{constructor(e,t,{timeoutMs:i=2e3}={}){w(this,Sr);w(this,fi);w(this,$n);w(this,Pt);w(this,tn,!1);$(this,"timeoutMs");R(this,fi,e),R(this,$n,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return h(this,tn)}hostDisconnected(){clearTimeout(h(this,Pt)),R(this,Pt,void 0)}onInput(e){if(h(this,fi).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(h(this,Pt)),R(this,Pt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),h(this,tn)||A(this,Sr,Kl).call(this)}}typingStopped(){clearTimeout(h(this,Pt)),R(this,tn,!1),h(this,$n).typingStopped()}};fi=new WeakMap,$n=new WeakMap,Pt=new WeakMap,tn=new WeakMap,Sr=new WeakSet,Kl=function(){R(this,tn,!0),h(this,$n).typingStarted()};function Ql(n,e){let t=new Map;for(let i of n){let r=e(i);t.has(r)||t.set(r,[]),(t.get(r)||[]).push(i)}return t}function Zl(n,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(n);return`${n.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var Vv=re({wsApiUrl:N(),url:N(),logoUrl:T(N()),title:N(),status:N(),color:N(),showStillLearningBanner:T(Ae()),allowedOrigins:T(vt(N())),input:re({placeholder:N()}),bubble:re({imageUrl:T(N()),position:re({bottom:T(N()),right:T(N()),left:T(N())}),mobilePosition:T(re({bottom:T(N()),right:T(N()),left:T(N())}))}),examples:re({title:N(),items:vt(N())}),instructions:re({items:vt(N())}),popup:T(re({mobileEnabled:T(Ae()),desktopEnabled:T(Ae()),delayMs:T(Xe()),text:T(N()),mobileTitleText:T(N()),mobileButtonText:T(N())})),tryItOut:T(re({mobileEnabled:T(Ae()),desktopEnabled:T(Ae()),text:T(N())})),contactDetails:T(re({email:T(N()),phone:T(N()),socialMedia:T(re({facebook:T(N()),instagram:T(N()),twitter:T(N())}))})),neverShowStillLearningBanner:T(Ae()),hidden:T(Ae()),newChatTitle:T(N()),webhookURL:T(N()),automatedResponse:T(re({enabled:T(Ae()),text:T(N()),latencyThresholdMs:T(Xe())})),manual:T(Ae()),removePoweredBy:T(Ae()),claimable:T(Ae()),feed:T(N()),scraper:T(kn(["netkazan","jateknet","grandopet","insportline","partocean"])),platform:T(kn(["shopify","shoprenter","unas","scraper"])),workingHours:T(re({dailyAvailability:vt(re({dayOfWeek:zl(Xe(),oo(0),so(6)),startTime:N(),endTime:N(),isActive:Ae()})),userTimeZone:T(N())})),planOverrides:T(re({maxProducts:T(Xe()),conversations:T(Xe()),faqs:T(re({max:T(Xe()),questionLength:T(Xe()),answerLength:T(Xe())}))})),omitGeneralGuidelines:T(Ae()),forceStripe:T(Ae()),products:T(re({blocklistUrls:T(vt(N()))}))});var Rf="\xB7 \xB7 \xB7",Pf=re({conversationId:T(N()),messages:T(vt(re({id:N(),timestamp:Xe(),role:kn(["user","assistant","support"]),content:N(),content_html:T(N())})))}),ie,Er,di,ae,eu,tu,nu,iu,ru,su,ou,uo,$r=class $r extends W(q){constructor(){super();w(this,ie);w(this,di,new kr(this,{typingStarted:()=>h(this,ae).sendUserTypingStart(),typingStopped:()=>h(this,ae).sendUserTypingStop()}));w(this,ae,new xr(this,{url:(t,{resume:i}={})=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("resume",i?"1":""),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&h(this,ie,uo)?.scrollTo(0,h(this,ie,uo).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,i)=>{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(h(this,ie,Er))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(h(this,ie,Er),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(h(this,ie,Er))||"{}"),i=Hl(Pf,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return h(this,ae).conversationId}get messages(){return h(this,ae).messages}render(){let t=Ql(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return D`
145
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};E(ci,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"}});var pi=class extends yn{constructor(e){if(super(e),this.it=L,e.type!==xr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||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:[]}}};pi.directiveName="unsafeHTML",pi.resultType=1;var zl=kr(pi);var oo;function kf(n){return{lang:n?.lang??oo?.lang,message:n?.message,abortEarly:n?.abortEarly??oo?.abortEarly,abortPipeEarly:n?.abortPipeEarly??oo?.abortPipeEarly}}var Sf;function Ef(n){return Sf?.get(n)}var $f;function Cf(n){return $f?.get(n)}var Af;function If(n,e){return Af?.get(n)?.get(e)}function kn(n){let e=typeof n;return e==="object"&&(e=(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null"),e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e}function Pt(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??kn(s),l={kind:n.kind,type:n.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:n.requirement,path:r?.path,issues:r?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=n.kind==="schema",p=r?.message??n.message??If(n.reference,l.lang)??(c?Cf(l.lang):null)??i.message??Ef(l.lang);p&&(l.message=typeof p=="function"?p(l):p),c&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}var Tf=class extends Error{constructor(e){super(e[0].message);E(this,"issues");this.name="ValiError",this.issues=e}};function ao(n,e){return{kind:"validation",type:"max_value",reference:ao,async:!1,expects:`<=${n instanceof Date?n.toJSON():kn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&Pt(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():kn(t.value)}),t}}}function lo(n,e){return{kind:"validation",type:"min_value",reference:lo,async:!1,expects:`>=${n instanceof Date?n.toJSON():kn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&Pt(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():kn(t.value)}),t}}}function Rf(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function mt(n,e){return{kind:"schema",type:"array",reference:mt,expects:"Array",async:!1,item:n,message:e,_run(t,i){let r=t.value;if(Array.isArray(r)){t.typed=!0,t.value=[];for(let s=0;s<r.length;s++){let o=r[s],a=this.item._run({typed:!1,value:o},i);if(a.issues){let l={type:"array",origin:"value",input:r,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],t.issues?.push(c);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else Pt(this,"type",t,i);return t}}}function Ae(n){return{kind:"schema",type:"boolean",reference:Ae,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:Pt(this,"type",e,t),e}}}function Xe(n){return{kind:"schema",type:"number",reference:Xe,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Pt(this,"type",e,t),e}}}function re(n,e){return{kind:"schema",type:"object",reference:re,expects:"Object",async:!1,entries:n,message:e,_run(t,i){let r=t.value;if(r&&typeof r=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=r[s],a=this.entries[s]._run({typed:!1,value:o},i);if(a.issues){let l={type:"object",origin:"value",input:r,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],t.issues?.push(c);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||s in r)&&(t.value[s]=a.value)}}else Pt(this,"type",t,i);return t}}}function R(n,...e){let t={kind:"schema",type:"optional",reference:R,expects:`${n.expects} | undefined`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=Rf(this,i,r)),i.value===void 0)?(i.typed=!0,i):this.wrapped._run(i,r)}};return 0 in e&&(t.default=e[0]),t}function Sn(n,e){return{kind:"schema",type:"picklist",reference:Sn,expects:n.map(kn).join(" | ")||"never",async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:Pt(this,"type",t,i),t}}}function N(n){return{kind:"schema",type:"string",reference:N,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:Pt(this,"type",e,t),e}}}function Wl(n,e,t){let i=n._run({typed:!1,value:e},kf(t));if(i.issues)throw new Tf(i.issues);return i.value}function Vl(...n){return{...n[0],pipe:n,_run(e,t){for(let i=0;i<n.length;i++){if(e.issues&&(n[i].kind==="schema"||n[i].kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n[i]._run(e,t))}return e}}}var fi,Le,Ze,di,uo,Cr=class{constructor(e,t){w(this,di);w(this,fi);w(this,Le);w(this,Ze);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");T(this,fi,e),h(this,fi).addController(this),T(this,Le,t)}connect(e){T(this,Le,e),T(this,Ze,A(this,di,uo).call(this))}hostConnected(){setTimeout(()=>{T(this,Ze,A(this,di,uo).call(this))},0)}hostDisconnected(){h(this,Ze)?.close(1e3,"lit_host_disconnected"),T(this,Ze,void 0)}send(e){h(this,Ze)?.send(e)}close(e,t){h(this,Ze)?.close(e,t)}render(e={}){switch(h(this,Ze)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}get isConnected(){return h(this,Ze)?.readyState===WebSocket.OPEN}};fi=new WeakMap,Le=new WeakMap,Ze=new WeakMap,di=new WeakSet,uo=function(){let e=new WebSocket(h(this,Le).url());return h(this,Le).onClose&&(e.onclose=h(this,Le).onClose),h(this,Le).onOpen&&(e.onopen=h(this,Le).onOpen),h(this,Le).onError&&(e.onerror=h(this,Le).onError),h(this,Le).onMessage&&(e.onmessage=h(this,Le).onMessage),e};var Xl="664df22d-d461-42d6-801e-f70247e2cd7c",be,we,et,En,$n,ke,tn,Jl,Yl,Kl,Ql,Ar=class{constructor(e,t){w(this,ke);w(this,be);w(this,we);w(this,et);E(this,"isStreaming",!1);E(this,"typingIndicator");E(this,"ranOutOfCredits",!1);E(this,"messages",[]);E(this,"conversationId","");w(this,En,0);w(this,$n);E(this,"isLiveMode",!1);T(this,be,e),T(this,we,t),T(this,et,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return A(this,ke,tn).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return A(this,ke,tn).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return A(this,ke,tn).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return A(this,ke,tn).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){A(this,ke,tn).call(this,{type:"RELOAD_CONFIG"})}close(){h(this,et).close(1e3,"closed by user")}retry(){clearTimeout(h(this,$n)),T(this,$n,setTimeout(()=>{h(this,we).onReconnect?.(),T(this,et,this.initWS())},1e3*h(this,En))),Ia(this,En)._++}initWS(){return new Cr(h(this,be),{url:()=>h(this,we).url(this.conversationId,{}),onOpen:e=>A(this,ke,Jl).call(this,e),onMessage:e=>A(this,ke,Yl).call(this,JSON.parse(e.data)),onError:e=>A(this,ke,Kl).call(this,e),onClose:e=>A(this,ke,Ql).call(this,e)})}hostConnected(){this.conversationId=h(this,we).restoreConversationState?.()?.conversationId||"",this.messages=h(this,we).restoreConversationState?.()?.messages||[]}reset(){A(this,ke,tn).call(this,{type:"NEW_CHAT"}),h(this,we).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,h(this,be).requestUpdate()}hostDisconnected(){clearTimeout(h(this,$n))}reconnectSocket(){h(this,et).close(1e3,"destroy"),T(this,et,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};be=new WeakMap,we=new WeakMap,et=new WeakMap,En=new WeakMap,$n=new WeakMap,ke=new WeakSet,tn=function(e,{expectStreaming:t=!1}={}){return h(this,et).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,h(this,be).requestUpdate()),h(this,et).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Jl=function(e){T(this,En,0)},Yl=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,i,r)=>i===r.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,h(this,be).requestUpdate(),h(this,we).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),h(this,be).requestUpdate(),h(this,we).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.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,h(this,be).requestUpdate(),h(this,we).onMessageDone?.(e,t),h(this,we).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,h(this,be).requestUpdate();break}case"ERROR":{h(this,we).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,h(this,we).onConnect?.(e.conversationId),h(this,we).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,h(this,be).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},h(this,be).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,h(this,be).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Xl)||this.messages.push({id:Xl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,h(this,be).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),h(this,be).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Kl=function(e){console.error("onError",e),h(this,we).onError?.(e)},Ql=function(e){h(this,be).isConnected&&!h(this,et).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,h(this,be).requestUpdate(),h(this,we).onClose?.()};var hi,Cn,Ot,nn,Tr,Zl,Ir=class{constructor(e,t,{timeoutMs:i=2e3}={}){w(this,Tr);w(this,hi);w(this,Cn);w(this,Ot);w(this,nn,!1);E(this,"timeoutMs");T(this,hi,e),T(this,Cn,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return h(this,nn)}hostDisconnected(){clearTimeout(h(this,Ot)),T(this,Ot,void 0)}onInput(e){if(h(this,hi).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(h(this,Ot)),T(this,Ot,setTimeout(()=>this.typingStopped(),this.timeoutMs)),h(this,nn)||A(this,Tr,Zl).call(this)}}typingStopped(){clearTimeout(h(this,Ot)),T(this,nn,!1),h(this,Cn).typingStopped()}};hi=new WeakMap,Cn=new WeakMap,Ot=new WeakMap,nn=new WeakMap,Tr=new WeakSet,Zl=function(){T(this,nn,!0),h(this,Cn).typingStarted()};function eu(n,e){let t=new Map;for(let i of n){let r=e(i);t.has(r)||t.set(r,[]),(t.get(r)||[]).push(i)}return t}function tu(n,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(n);return`${n.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var Gv=re({wsApiUrl:N(),url:N(),logoUrl:R(N()),title:N(),status:N(),color:N(),showStillLearningBanner:R(Ae()),allowedOrigins:R(mt(N())),input:re({placeholder:N()}),bubble:re({imageUrl:R(N()),position:re({bottom:R(N()),right:R(N()),left:R(N())}),mobilePosition:R(re({bottom:R(N()),right:R(N()),left:R(N())}))}),examples:re({title:N(),items:mt(N())}),instructions:re({items:mt(N())}),popup:R(re({mobileEnabled:R(Ae()),desktopEnabled:R(Ae()),delayMs:R(Xe()),text:R(N()),mobileTitleText:R(N()),mobileButtonText:R(N())})),tryItOut:R(re({mobileEnabled:R(Ae()),desktopEnabled:R(Ae()),text:R(N())})),contactDetails:R(re({email:R(N()),phone:R(N()),socialMedia:R(re({facebook:R(N()),instagram:R(N()),twitter:R(N())}))})),neverShowStillLearningBanner:R(Ae()),hidden:R(Ae()),newChatTitle:R(N()),webhookURL:R(N()),automatedResponse:R(re({enabled:R(Ae()),text:R(N()),latencyThresholdMs:R(Xe())})),manual:R(Ae()),removePoweredBy:R(Ae()),claimable:R(Ae()),feed:R(N()),scraper:R(Sn(["netkazan","jateknet","grandopet","insportline","partocean"])),platform:R(Sn(["shopify","shoprenter","unas","scraper"])),workingHours:R(re({dailyAvailability:mt(re({dayOfWeek:Vl(Xe(),lo(0),ao(6)),startTime:N(),endTime:N(),isActive:Ae()})),userTimeZone:R(N())})),planOverrides:R(re({maxProducts:R(Xe()),conversations:R(Xe()),faqs:R(re({max:R(Xe()),questionLength:R(Xe()),answerLength:R(Xe())}))})),omitGeneralGuidelines:R(Ae()),forceStripe:R(Ae()),products:R(re({blocklistUrls:R(mt(N()))}))});var Pf="\xB7 \xB7 \xB7",Of=re({conversationId:R(N()),messages:R(mt(re({id:N(),timestamp:Xe(),role:Sn(["user","assistant","support"]),content:N(),content_html:R(N())})))}),ie,Rr,gi,ae,nu,iu,ru,su,ou,au,lu,po,Pr=class Pr extends W(q){constructor(){super();w(this,ie);w(this,gi,new Ir(this,{typingStarted:()=>h(this,ae).sendUserTypingStart(),typingStopped:()=>h(this,ae).sendUserTypingStop()}));w(this,ae,new Ar(this,{url:(t,{resume:i}={})=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("resume",i?"1":""),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&h(this,ie,po)?.scrollTo(0,h(this,ie,po).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,i)=>{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(h(this,ie,Rr))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(h(this,ie,Rr),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(h(this,ie,Rr))||"{}"),i=Wl(Of,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return h(this,ae).conversationId}get messages(){return h(this,ae).messages}render(){let t=eu(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return D`
146
146
  <div class="mx-auto flex h-full w-full flex-col bg-white font-sans text-base">
147
147
  <mw-header
148
148
  class="z-10 border-b"
149
149
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,status:this.config.status,color:this.config.color,newChatTitle:this.config.newChatTitle}}"
150
150
  ?show-new-chat="${!h(this,ae).isLiveMode&&this.messages.length>0}"
151
151
  ?show-close="${this.showClose}"
152
- @mw:new-chat-click="${A(this,ie,su)}"
153
- @mw:close-click="${A(this,ie,ou)}">
152
+ @mw:new-chat-click="${A(this,ie,au)}"
153
+ @mw:close-click="${A(this,ie,lu)}">
154
154
  </mw-header>
155
155
 
156
156
  <!-- used by the dashboard to inject content -->
@@ -176,13 +176,13 @@ CHAT`}</span>
176
176
 
177
177
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
178
178
  <div>
179
- ${oi(Array.from(t),([i])=>i,([i,r])=>D`
180
- <div class="my-2 text-center text-xs text-gray-500">${Zl(new Date(Number(i)),window.navigator.language)}</div>
181
- ${oi(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,c=h(this,ae).isLiveMode&&s.role==="user"&&s.id===h(this,ae).lastMsg?.id?"sent":"";return D`
179
+ ${li(Array.from(t),([i])=>i,([i,r])=>D`
180
+ <div class="my-2 text-center text-xs text-gray-500">${tu(new Date(Number(i)),window.navigator.language)}</div>
181
+ ${li(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,c=h(this,ae).isLiveMode&&s.role==="user"&&s.id===h(this,ae).lastMsg?.id?"sent":"";return D`
182
182
  <div class="${l?"mb-[2px]":"mb-3"} mx-4 flex-row">
183
- <mw-chat-message color="${this.config.color}" status="${c}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" @click="${A(this,ie,eu)}">
183
+ <mw-chat-message color="${this.config.color}" status="${c}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" @click="${A(this,ie,nu)}">
184
184
  <div class="prose break-words text-inherit">
185
- ${s.content===Rf?D`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?Bl(s.content_html):D`<p>${s.content}</p>`}
185
+ ${s.content===Pf?D`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?zl(s.content_html):D`<p>${s.content}</p>`}
186
186
  </div>
187
187
  </mw-chat-message>
188
188
  </div>
@@ -202,15 +202,15 @@ CHAT`}</span>
202
202
  <mw-background
203
203
  class="mx-auto max-w-sm flex-grow"
204
204
  .examples="${this.messages.length>0?[]:this.config.examples}"
205
- @mw:example-click="${A(this,ie,tu)}"></mw-background>
205
+ @mw:example-click="${A(this,ie,iu)}"></mw-background>
206
206
  </div>
207
207
 
208
208
  <div class="flex-shrink-0 flex-grow-0 space-y-2 pb-2">
209
- <mw-chat-input @mw:change="${A(this,ie,iu)}" @mw:submit="${A(this,ie,nu)}" @mw:cancel="${A(this,ie,ru)}" placeholder="${this.config.input?.placeholder}" color="${this.config.color}" ?disabled="${h(this,ae).ranOutOfCredits}" ?streaming="${h(this,ae)?.isStreaming??!0}"></mw-chat-input>
209
+ <mw-chat-input @mw:change="${A(this,ie,su)}" @mw:submit="${A(this,ie,ru)}" @mw:cancel="${A(this,ie,ou)}" placeholder="${this.config.input?.placeholder}" color="${this.config.color}" ?disabled="${h(this,ae).ranOutOfCredits}" ?streaming="${h(this,ae)?.isStreaming??!0}"></mw-chat-input>
210
210
  ${this.config.removePoweredBy?L:D`<mw-powered-by></mw-powered-by>`}
211
211
  </div>
212
212
  </div>
213
- `}reloadConfig(){h(this,ae).reloadConfig(),this.requestUpdate()}};ie=new WeakSet,Er=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},di=new WeakMap,ae=new WeakMap,eu=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}window.open(i.href,i.target)}},tu=function(t){let i=t.detail.example;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},nu=function(t){let i=t.detail;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}h(this,di).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},iu=function(t){h(this,di).onInput(t.detail.full)},ru=function(){h(this,ae)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},su=function(){h(this,ae).reset()},ou=function(){this.dispatchEvent(new $r.CloseClickEvent)},uo=function(){return this.renderRoot.querySelector("#scrollable-content")},$($r,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var Cn=$r,lo;Cn.CloseClickEvent=(lo=class extends CustomEvent{constructor(e={}){super(Cn.CloseClickEvent.type,{...e})}},$(lo,"type","mw:close-click"),lo);var Cr=class extends W(q){constructor(){super(...arguments);$(this,"render",()=>D`
213
+ `}reloadConfig(){h(this,ae).reloadConfig(),this.requestUpdate()}};ie=new WeakSet,Rr=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},gi=new WeakMap,ae=new WeakMap,nu=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}window.open(i.href,i.target)}},iu=function(t){let i=t.detail.example;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},ru=function(t){let i=t.detail;if(!h(this,ae)?.sendUserInput(i)){t.preventDefault();return}h(this,gi).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},su=function(t){h(this,gi).onInput(t.detail.full)},ou=function(){h(this,ae)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},au=function(){h(this,ae).reset()},lu=function(){this.dispatchEvent(new Pr.CloseClickEvent)},po=function(){return this.renderRoot.querySelector("#scrollable-content")},E(Pr,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var An=Pr,co;An.CloseClickEvent=(co=class extends CustomEvent{constructor(e={}){super(An.CloseClickEvent.type,{...e})}},E(co,"type","mw:close-click"),co);var Or=class extends W(q){constructor(){super(...arguments);E(this,"render",()=>D`
214
214
  <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">
215
215
  <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
216
216
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -222,25 +222,25 @@ CHAT`}</span>
222
222
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
223
223
  </circle>
224
224
  </svg>
225
- `)}};var An,au,lu,hi=class hi extends W(q){constructor(){super();w(this,An);$(this,"render",()=>D`
225
+ `)}};var In,uu,cu,vi=class vi extends W(q){constructor(){super();w(this,In);E(this,"render",()=>D`
226
226
  <!-- wrapper -->
227
227
  <div class="group relative z-[2147483647] rounded-t-2xl bg-white font-sans text-base leading-normal shadow-2xl select-none w-[300px] rounded-2xl cursor-pointer">
228
228
  <!-- close button -->
229
- <button class="absolute pb-[2px] -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full text-gray-700 bg-gray-300 bg-opacity-50 text-center duration-300 ease-in-out opacity-0 shadow transition-opacity group-hover:opacity-100" @click="${A(this,An,au)}" aria-label="Close">×</button>
229
+ <button class="absolute pb-[2px] -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full text-gray-700 bg-gray-300 bg-opacity-50 text-center duration-300 ease-in-out opacity-0 shadow transition-opacity group-hover:opacity-100" @click="${A(this,In,uu)}" aria-label="Close">×</button>
230
230
 
231
231
  <!-- content -->
232
- <div class="p-4 text-left text-gray-800" @click="${A(this,An,lu)}">
232
+ <div class="p-4 text-left text-gray-800" @click="${A(this,In,cu)}">
233
233
  <p>${this.text}</p>
234
234
  </div>
235
235
  </div>
236
- `);this.text="Hello there. How can we help?"}};An=new WeakSet,au=function(){this.dispatchEvent(new hi.CloseEvent)},lu=function(){this.dispatchEvent(new hi.ClickEvent)},$(hi,"properties",{text:{type:String}});var Ot=hi,co;Ot.CloseEvent=(co=class extends CustomEvent{constructor(e={}){super(Ot.CloseEvent.type,{...e})}},$(co,"type","mw:close"),co);var po;Ot.ClickEvent=(po=class extends CustomEvent{constructor(e={}){super(Ot.ClickEvent.type,{...e})}},$(po,"type","mw:click"),po);var In,uu,cu,gi=class gi extends W(q){constructor(){super();w(this,In);$(this,"render",()=>D`
236
+ `);this.text="Hello there. How can we help?"}};In=new WeakSet,uu=function(){this.dispatchEvent(new vi.CloseEvent)},cu=function(){this.dispatchEvent(new vi.ClickEvent)},E(vi,"properties",{text:{type:String}});var Ft=vi,fo;Ft.CloseEvent=(fo=class extends CustomEvent{constructor(e={}){super(Ft.CloseEvent.type,{...e})}},E(fo,"type","mw:close"),fo);var ho;Ft.ClickEvent=(ho=class extends CustomEvent{constructor(e={}){super(Ft.ClickEvent.type,{...e})}},E(ho,"type","mw:click"),ho);var Tn,pu,fu,mi=class mi extends W(q){constructor(){super();w(this,Tn);E(this,"render",()=>D`
237
237
  <!-- wrapper -->
238
238
  <div class="group relative z-[2147483647] rounded-t-2xl text-left bg-white font-sans text-base text-[16px] leading-normal shadow-2xl select-none text-gray-800 transition-all">
239
239
  <!-- close button -->
240
- <button class="absolute pb-[2px] top-[28px] right-4 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 text-center shadow-none duration-300 ease-in-out focus:outline-none" @click="${A(this,In,uu)}" aria-label="Close">×</button>
240
+ <button class="absolute pb-[2px] top-[28px] right-4 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 text-center shadow-none duration-300 ease-in-out focus:outline-none" @click="${A(this,Tn,pu)}" aria-label="Close">×</button>
241
241
 
242
242
  <!-- content -->
243
- <div class="p-4 text-gray-800" @click="${A(this,In,cu)}">
243
+ <div class="p-4 text-gray-800" @click="${A(this,Tn,fu)}">
244
244
  <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
245
245
  <p class="py-2.5 text-left">${this.text}</p>
246
246
  <div class="h-4"></div>
@@ -253,25 +253,25 @@ CHAT`}</span>
253
253
  <!-- can append any other content -->
254
254
  <slot name="footer"></slot>
255
255
  </div>
256
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};In=new WeakSet,uu=function(){this.dispatchEvent(new gi.CloseEvent)},cu=function(){this.dispatchEvent(new gi.ClickEvent)},$(gi,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Ft=gi,fo;Ft.CloseEvent=(fo=class extends CustomEvent{constructor(e={}){super(Ft.CloseEvent.type,{...e})}},$(fo,"type","mw:close"),fo);var ho;Ft.ClickEvent=(ho=class extends CustomEvent{constructor(e={}){super(Ft.ClickEvent.type,{...e})}},$(ho,"type","mw:click"),ho);var Tn,vi,nn,Ar=class{constructor(e,t){w(this,Tn);w(this,vi,!1);w(this,nn,()=>{h(this,vi)||(h(this,Tn).userFirstInteracted?.(),R(this,vi,!0)),h(this,Tn).userInteracted?.()});R(this,Tn,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",h(this,nn)),window.addEventListener("keydown",h(this,nn))}stopListening(){window.removeEventListener("click",h(this,nn)),window.removeEventListener("keydown",h(this,nn))}};Tn=new WeakMap,vi=new WeakMap,nn=new WeakMap;var Of=2*60*60*1e3,Rn,Be,rn,mi,sn,yi,Tr,pu,Ir=class{constructor(e,t,i=Date){w(this,Tr);w(this,Rn);w(this,Be);w(this,rn);w(this,mi);w(this,sn,!1);w(this,yi,!1);R(this,Rn,e),R(this,Be,t),R(this,rn,i),e.addController(this)}get showing(){return h(this,sn)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!h(this,sn)&&(R(this,sn,!0),h(this,Rn).requestUpdate(),e)){h(this,Be).playPopupSound();let t=h(this,Be).getPersistedState();h(this,Be).setPersistedState({...t,playedSoundOnce:!0})}}hide(){R(this,yi,!0),this.abortAutoShowTimer(),R(this,sn,!1),h(this,Rn).requestUpdate()}abortAutoShowTimer(){clearTimeout(h(this,mi))}onCloseClick(){let e=h(this,Be).getPersistedState();h(this,Be).setPersistedState({...e,userDismissedAt:h(this,rn).now()}),this.hide()}onContentClick(){let e=h(this,Be).getPersistedState();h(this,Be).setPersistedState({...e,userDismissedAt:h(this,rn).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),h(this,yi)||R(this,mi,setTimeout(()=>A(this,Tr,pu).call(this),h(this,Be).delayMs()))}};Rn=new WeakMap,Be=new WeakMap,rn=new WeakMap,mi=new WeakMap,sn=new WeakMap,yi=new WeakMap,Tr=new WeakSet,pu=function(){let e=h(this,Be).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&h(this,rn).now()-e.userDismissedAt<Of||this.show({sound:!t})};var Dt,yo,Mt,vo,mo,Rr=class Rr extends W(q){constructor(){super();w(this,Mt);w(this,Dt,new Ir(this,{delayMs:()=>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}}}));w(this,yo,new Ar(this,h(this,Dt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=h(this,Dt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return D`
256
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Tn=new WeakSet,pu=function(){this.dispatchEvent(new mi.CloseEvent)},fu=function(){this.dispatchEvent(new mi.ClickEvent)},E(mi,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Dt=mi,go;Dt.CloseEvent=(go=class extends CustomEvent{constructor(e={}){super(Dt.CloseEvent.type,{...e})}},E(go,"type","mw:close"),go);var vo;Dt.ClickEvent=(vo=class extends CustomEvent{constructor(e={}){super(Dt.ClickEvent.type,{...e})}},E(vo,"type","mw:click"),vo);var Rn,yi,rn,Fr=class{constructor(e,t){w(this,Rn);w(this,yi,!1);w(this,rn,()=>{h(this,yi)||(h(this,Rn).userFirstInteracted?.(),T(this,yi,!0)),h(this,Rn).userInteracted?.()});T(this,Rn,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",h(this,rn)),window.addEventListener("keydown",h(this,rn))}stopListening(){window.removeEventListener("click",h(this,rn)),window.removeEventListener("keydown",h(this,rn))}};Rn=new WeakMap,yi=new WeakMap,rn=new WeakMap;var Ff=2*60*60*1e3,Pn,Be,sn,_i,on,bi,Mr,du,Dr=class{constructor(e,t,i=Date){w(this,Mr);w(this,Pn);w(this,Be);w(this,sn);w(this,_i);w(this,on,!1);w(this,bi,!1);T(this,Pn,e),T(this,Be,t),T(this,sn,i),e.addController(this)}get showing(){return h(this,on)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!h(this,on)&&(T(this,on,!0),h(this,Pn).requestUpdate(),e)){h(this,Be).playPopupSound();let t=h(this,Be).getPersistedState();h(this,Be).setPersistedState({...t,playedSoundOnce:!0})}}hide(){T(this,bi,!0),this.abortAutoShowTimer(),T(this,on,!1),h(this,Pn).requestUpdate()}abortAutoShowTimer(){clearTimeout(h(this,_i))}onCloseClick(){let e=h(this,Be).getPersistedState();h(this,Be).setPersistedState({...e,userDismissedAt:h(this,sn).now()}),this.hide()}onContentClick(){let e=h(this,Be).getPersistedState();h(this,Be).setPersistedState({...e,userDismissedAt:h(this,sn).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),h(this,bi)||T(this,_i,setTimeout(()=>A(this,Mr,du).call(this),h(this,Be).delayMs()))}};Pn=new WeakMap,Be=new WeakMap,sn=new WeakMap,_i=new WeakMap,on=new WeakMap,bi=new WeakMap,Mr=new WeakSet,du=function(){let e=h(this,Be).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&h(this,sn).now()-e.userDismissedAt<Ff||this.show({sound:!t})};var Mt,bo,Lt,yo,_o,Lr=class Lr extends W(q){constructor(){super();w(this,Lt);w(this,Mt,new Dr(this,{delayMs:()=>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}}}));w(this,bo,new Fr(this,h(this,Mt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=h(this,Mt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return D`
257
257
  <!-- mobile shadow backdrop -->
258
258
  <div class="sm:hidden ${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility]"></div>
259
259
 
260
260
  <!-- mobile overlay -->
261
261
  <div class="sm:hidden ${t} fixed bottom-0 z-[2147483647] left-0 right-0">
262
- <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${A(this,Mt,mo)}" @mw:close="${A(this,Mt,vo)}">
262
+ <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${A(this,Lt,_o)}" @mw:close="${A(this,Lt,yo)}">
263
263
  ${i.mobile.poweredBy?D`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:L}
264
264
  </mw-popup-mobile>
265
265
  </div>
266
266
 
267
267
  <!-- desktop -->
268
268
  <div class="max-sm:hidden ${t} ${this.positionClasses} z-[2147483647] fixed transition-[opacity,translate,visibility]">
269
- <mw-popup-desktop text="${i.desktop.text}" @mw:click="${A(this,Mt,mo)}" @mw:close="${A(this,Mt,vo)}"></mw-popup-desktop>
269
+ <mw-popup-desktop text="${i.desktop.text}" @mw:click="${A(this,Lt,_o)}" @mw:close="${A(this,Lt,yo)}"></mw-popup-desktop>
270
270
  </div>
271
- `}hide(){h(this,Dt).hide()}};Dt=new WeakMap,yo=new WeakMap,Mt=new WeakSet,vo=function(){h(this,Dt).onCloseClick()},mo=function(){this.dispatchEvent(new Rr.ClickEvent),h(this,Dt).onContentClick()},$(Rr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Pn=Rr,go;Pn.ClickEvent=(go=class extends CustomEvent{constructor(e={}){super(Pn.ClickEvent.type,{...e})}},$(go,"type","mw:click"),go);var Ff="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",_i=class extends W(q){constructor(){super(...arguments);$(this,"render",()=>D`
271
+ `}hide(){h(this,Mt).hide()}};Mt=new WeakMap,bo=new WeakMap,Lt=new WeakSet,yo=function(){h(this,Mt).onCloseClick()},_o=function(){this.dispatchEvent(new Lr.ClickEvent),h(this,Mt).onContentClick()},E(Lr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var On=Lr,mo;On.ClickEvent=(mo=class extends CustomEvent{constructor(e={}){super(On.ClickEvent.type,{...e})}},E(mo,"type","mw:click"),mo);var Df="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",wi=class extends W(q){constructor(){super(...arguments);E(this,"render",()=>D`
272
272
  <p class="flex items-center justify-center bg-white m-0 space-x-1 text-xs font-sans text-gray-400">
273
273
  <span class="pointer-events-none select-none">Powered by</span>
274
- <a class="inline-flex items-center space-x-1 text-gray-600 underline" href="${Ff}" target="_blank">
274
+ <a class="inline-flex items-center space-x-1 text-gray-600 underline" href="${Df}" target="_blank">
275
275
  <!-- molin logo icon -->
276
276
  <svg class="h-4 w-4 text-gray-600" width="1600" height="1600" viewBox="0 0 1600 1600" fill="none" xmlns="http://www.w3.org/2000/svg">
277
277
  <g clip-path="url(#clip0_1347_2815)">
@@ -291,19 +291,19 @@ CHAT`}</span>
291
291
  <span>Molin AI</span>
292
292
  </a>
293
293
  </p>
294
- `)}};$(_i,"styles",zs`
294
+ `)}};E(wi,"styles",ht`
295
295
  :host {
296
296
  display: block;
297
297
  }
298
- `);var Pr,fu,bi=class extends W(q){constructor(){super();w(this,Pr);$(this,"render",()=>D`
298
+ `);var Nr,hu,xi=class extends W(q){constructor(){super();w(this,Nr);E(this,"render",()=>D`
299
299
  <span class="relative inline-flex">
300
300
  <slot></slot>
301
- <span class="${h(this,Pr,fu)} pointer-events-none absolute flex h-3 w-3">
301
+ <span class="${h(this,Nr,hu)} pointer-events-none absolute flex h-3 w-3">
302
302
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
303
303
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
304
304
  </span>
305
305
  </span>
306
- `);this.color="sky-500",this.position="top-right"}};Pr=new WeakSet,fu=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}`)}},$(bi,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});var wi=class extends W(q){constructor(){super();$(this,"render",()=>D`
306
+ `);this.color="sky-500",this.position="top-right"}};Nr=new WeakSet,hu=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}`)}},E(xi,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});var ki=class extends W(q){constructor(){super();E(this,"render",()=>D`
307
307
  <div class="fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base ${this.positionClasses}">
308
308
  <p class="text-md mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
309
309
 
@@ -312,22 +312,30 @@ CHAT`}</span>
312
312
  <path d="M1.41089 1.17749C13.4657 11.874 23.3966 26.992 30.4581 41.4117C31.9751 44.5093 33.1523 47.7224 34.4136 50.9242C34.6288 51.4705 35.4719 52.2988 34.8747 51.5309C33.1064 49.2574 28.9356 48.4966 26.3813 47.9151C23.973 47.3669 17.1432 44.725 19.1984 46.0951C22.9606 48.6033 26.6842 51.3163 30.5552 53.7391C32.8502 55.1756 34.9449 57.9465 37.0101 55.8018C41.8322 50.7943 47.8486 46.2228 53.4629 42.1397" stroke="#303132" stroke-width="2" stroke-linecap="round"></path>
313
313
  </svg>
314
314
  </div>
315
- `);this.positionClasses="",this.text="Try it out"}};$(wi,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.define("mw-background",_n);customElements.define("mw-bubble",si);customElements.define("mw-chat",Cn);customElements.define("mw-chat-input",lt);customElements.define("mw-chat-message",li);customElements.define("mw-header",Tt);customElements.define("mw-loading",Cr);customElements.define("mw-popup",Pn);customElements.define("mw-powered-by",_i);customElements.define("mw-pulse-dot",bi);customElements.define("mw-try-it-out",wi);customElements.define("mw-upsell-banner",ri);customElements.define("mw-popup-desktop",Ot);customElements.define("mw-popup-mobile",Ft);window.__INIT_MOLIN_SHOP_AI=function(e){if(Df(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 Df(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function du(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var on,xi,Lt,an,Fr,hu,Or=class{constructor(e,t,i){w(this,Fr);w(this,on);w(this,xi);w(this,Lt);w(this,an);$(this,"isLoading",!1);$(this,"data");R(this,on,e),R(this,xi,t),R(this,Lt,i),e.addController(this)}fetch(){if(this.isLoading)return;h(this,an)?.abort();let e=new AbortController;R(this,an,e),this.isLoading=!0,this.data=void 0,h(this,on).requestUpdate(),(async()=>{let t=A(this,Fr,hu).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 h(this,Lt)?.transform=="function"?await h(this,Lt).transform(t):t,h(this,on).requestUpdate()}).catch(t=>{h(this,Lt)?.onError?.(t),this.isLoading=!1,this.data=void 0,h(this,on).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||h(this,Lt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){h(this,an)?.abort(),R(this,an,void 0)}};on=new WeakMap,xi=new WeakMap,Lt=new WeakMap,an=new WeakMap,Fr=new WeakSet,hu=function(){let e=h(this,xi);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ut,ki,On,Fn,Nt=class{constructor(e,t){w(this,ut);w(this,ki);w(this,On);w(this,Fn);R(this,ut,e),R(this,ki,t),e.addController(this)}get data(){return h(this,Fn)||h(this,On)?.data}hostConnected(){if(h(this,On)||h(this,Fn))return;let e=du();e&&e.widgetId===h(this,ut).widgetId?R(this,Fn,e.config):R(this,On,new Or(h(this,ut),()=>{if(h(this,ut).cdn&&h(this,ut).widgetId)return`${h(this,ut).cdn}/config?w=${h(this,ut).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:h(this,ki)?.onError}))}};ut=new WeakMap,ki=new WeakMap,On=new WeakMap,Fn=new WeakMap;function gu(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function I(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gu(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):gu(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Mi(n){return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(n)}function J(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function vu(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function Y(n,e,t){return e&&vu(n.prototype,e),t&&vu(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function y(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mf(n,e){if(n==null)return{};var t,i,r=function(o,a){if(o==null)return{};var l,c,p={},u=Object.keys(o);for(c=0;c<u.length;c++)l=u[c],a.indexOf(l)>=0||(p[l]=o[l]);return p}(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Pe(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,i){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,o,a=[],l=!0,c=!1;try{for(r=r.call(t);!(l=(s=r.next()).done)&&(a.push(s.value),!i||a.length!==i);l=!0);}catch(p){c=!0,o=p}finally{try{l||r.return==null||r.return()}finally{if(c)throw o}}return a}}(n,e)||sa(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
316
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function kt(n){return function(e){if(Array.isArray(e))return Ro(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||sa(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
317
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function sa(n,e){if(n){if(typeof n=="string")return Ro(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ro(n,e):void 0}}function Ro(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function ot(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=sa(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
318
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}var ct={DEBUG:!1,LIB_VERSION:"1.144.2"},Lf=Array.isArray,fc=Object.prototype,dc=fc.hasOwnProperty,as=fc.toString,ge=Lf||function(n){return as.call(n)==="[object Array]"},rt=function(n){return typeof n=="function"},Fe=function(n){return n===Object(n)&&!ge(n)},_o=function(n){if(Fe(n)){for(var e in n)if(dc.call(n,e))return!1;return!0}return!1},M=function(n){return n===void 0},Ie=function(n){return as.call(n)=="[object String]"},mu=function(n){return Ie(n)&&n.trim().length===0},Et=function(n){return n===null},st=function(n){return M(n)||Et(n)},nt=function(n){return as.call(n)=="[object Number]"},Mn=function(n){return as.call(n)==="[object Boolean]"},Nf=function(n){return n instanceof FormData},m=typeof window<"u"?window:void 0,je=typeof globalThis<"u"?globalThis:m,hc=Array.prototype,yu=hc.forEach,_u=hc.indexOf,xt=je?.navigator,P=je?.document,Ne=je?.location,Po=je?.fetch,Oo=je!=null&&je.XMLHttpRequest&&"withCredentials"in new je.XMLHttpRequest?je.XMLHttpRequest:void 0,bu=je?.AbortController,le=xt?.userAgent,ce=m??{},wu="[PostHog.js]",b={_log:function(n){if(m&&(ct.DEBUG||ce.POSTHOG_DEBUG)&&!M(m.console)&&m.console){for(var e=("__rrweb_original__"in m.console[n])?m.console[n].__rrweb_original__:m.console[n],t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.apply(void 0,[wu].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];b._log.apply(b,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];b._log.apply(b,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];b._log.apply(b,["error"].concat(e))},critical:function(){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];(n=console).error.apply(n,[wu].concat(t))},uninitializedWarning:function(n){b.error("You must initialize PostHog before calling ".concat(n))}},Xr={},ls=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function jn(n,e,t){if(ge(n)){if(yu&&n.forEach===yu)n.forEach(e,t);else if("length"in n&&n.length===+n.length){for(var i=0,r=n.length;i<r;i++)if(i in n&&e.call(t,n[i],i)===Xr)return}}}function Q(n,e,t){if(!st(n)){if(ge(n))return jn(n,e,t);if(Nf(n)){var i,r=ot(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===Xr)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(dc.call(n,o)&&e.call(t,n[o],o)===Xr)return}}var Oe=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return jn(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function H(n,e){return n.indexOf(e)!==-1}function zr(n){for(var e=Object.keys(n),t=e.length,i=new Array(t);t--;)i[t]=[e[t],n[e[t]]];return i}var gc=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},xu=function(n){try{return n()}catch{return}},jf=function(n){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.apply(this,t)}catch(r){b.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),b.critical(r)}}},Fo=function(n){var e={};return Q(n,function(t,i){Ie(t)&&t.length>0&&(e[i]=t)}),e},Do=function(n){return n.replace(/^\$/,"")};function qf(n,e){return t=n,i=function(s){return Ie(s)&&!Et(e)?s.slice(0,e):s},r=new Set,function s(o,a){return o!==Object(o)?i?i(o,a):o:r.has(o)?void 0:(r.add(o),ge(o)?(l=[],jn(o,function(c){l.push(s(c))})):(l={},Q(o,function(c,p){r.has(c)||(l[p]=s(c,p))})),l);var l}(t);var t,i,r}var it,Uf=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
315
+ `);this.positionClasses="",this.text="Try it out"}};E(ki,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.define("mw-background",bn);customElements.define("mw-bubble",ai);customElements.define("mw-chat",An);customElements.define("mw-chat-input",lt);customElements.define("mw-chat-message",ci);customElements.define("mw-header",Rt);customElements.define("mw-loading",Or);customElements.define("mw-popup",On);customElements.define("mw-powered-by",wi);customElements.define("mw-pulse-dot",xi);customElements.define("mw-try-it-out",ki);customElements.define("mw-upsell-banner",oi);customElements.define("mw-popup-desktop",Ft);customElements.define("mw-popup-mobile",Dt);window.__INIT_MOLIN_SHOP_AI=function(e){if(Mf(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 Mf(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function gu(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var an,Si,Nt,ln,qr,vu,jr=class{constructor(e,t,i){w(this,qr);w(this,an);w(this,Si);w(this,Nt);w(this,ln);E(this,"isLoading",!1);E(this,"data");T(this,an,e),T(this,Si,t),T(this,Nt,i),e.addController(this)}fetch(){if(this.isLoading)return;h(this,ln)?.abort();let e=new AbortController;T(this,ln,e),this.isLoading=!0,this.data=void 0,h(this,an).requestUpdate(),(async()=>{let t=A(this,qr,vu).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 h(this,Nt)?.transform=="function"?await h(this,Nt).transform(t):t,h(this,an).requestUpdate()}).catch(t=>{h(this,Nt)?.onError?.(t),this.isLoading=!1,this.data=void 0,h(this,an).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||h(this,Nt)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){h(this,ln)?.abort(),T(this,ln,void 0)}};an=new WeakMap,Si=new WeakMap,Nt=new WeakMap,ln=new WeakMap,qr=new WeakSet,vu=function(){let e=h(this,Si);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var ut,Ei,Fn,Dn,jt=class{constructor(e,t){w(this,ut);w(this,Ei);w(this,Fn);w(this,Dn);T(this,ut,e),T(this,Ei,t),e.addController(this)}get data(){return h(this,Dn)||h(this,Fn)?.data}hostConnected(){if(h(this,Fn)||h(this,Dn))return;let e=gu();e&&e.widgetId===h(this,ut).widgetId?T(this,Dn,e.config):T(this,Fn,new jr(h(this,ut),()=>{if(h(this,ut).cdn&&h(this,ut).widgetId)return`${h(this,ut).cdn}/config?w=${h(this,ut).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:h(this,Ei)?.onError}))}};ut=new WeakMap,Ei=new WeakMap,Fn=new WeakMap,Dn=new WeakMap;function mu(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function I(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mu(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mu(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ni(n){return Ni=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ni(n)}function J(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function yu(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function Y(n,e,t){return e&&yu(n.prototype,e),t&&yu(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function y(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lf(n,e){if(n==null)return{};var t,i,r=function(o,a){if(o==null)return{};var l,c,p={},u=Object.keys(o);for(c=0;c<u.length;c++)l=u[c],a.indexOf(l)>=0||(p[l]=o[l]);return p}(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Pe(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,i){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,o,a=[],l=!0,c=!1;try{for(r=r.call(t);!(l=(s=r.next()).done)&&(a.push(s.value),!i||a.length!==i);l=!0);}catch(p){c=!0,o=p}finally{try{l||r.return==null||r.return()}finally{if(c)throw o}}return a}}(n,e)||aa(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
316
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function St(n){return function(e){if(Array.isArray(e))return Oo(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||aa(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
317
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function aa(n,e){if(n){if(typeof n=="string")return Oo(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Oo(n,e):void 0}}function Oo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function ot(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=aa(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
318
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}var ct={DEBUG:!1,LIB_VERSION:"1.144.2"},Nf=Array.isArray,hc=Object.prototype,gc=hc.hasOwnProperty,ds=hc.toString,me=Nf||function(n){return ds.call(n)==="[object Array]"},rt=function(n){return typeof n=="function"},Fe=function(n){return n===Object(n)&&!me(n)},wo=function(n){if(Fe(n)){for(var e in n)if(gc.call(n,e))return!1;return!0}return!1},M=function(n){return n===void 0},Ie=function(n){return ds.call(n)=="[object String]"},_u=function(n){return Ie(n)&&n.trim().length===0},$t=function(n){return n===null},st=function(n){return M(n)||$t(n)},nt=function(n){return ds.call(n)=="[object Number]"},Ln=function(n){return ds.call(n)==="[object Boolean]"},jf=function(n){return n instanceof FormData},m=typeof window<"u"?window:void 0,je=typeof globalThis<"u"?globalThis:m,vc=Array.prototype,bu=vc.forEach,wu=vc.indexOf,kt=je?.navigator,P=je?.document,Ne=je?.location,Fo=je?.fetch,Do=je!=null&&je.XMLHttpRequest&&"withCredentials"in new je.XMLHttpRequest?je.XMLHttpRequest:void 0,xu=je?.AbortController,le=kt?.userAgent,pe=m??{},ku="[PostHog.js]",b={_log:function(n){if(m&&(ct.DEBUG||pe.POSTHOG_DEBUG)&&!M(m.console)&&m.console){for(var e=("__rrweb_original__"in m.console[n])?m.console[n].__rrweb_original__:m.console[n],t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.apply(void 0,[ku].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];b._log.apply(b,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];b._log.apply(b,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];b._log.apply(b,["error"].concat(e))},critical:function(){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];(n=console).error.apply(n,[ku].concat(t))},uninitializedWarning:function(n){b.error("You must initialize PostHog before calling ".concat(n))}},es={},hs=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function qn(n,e,t){if(me(n)){if(bu&&n.forEach===bu)n.forEach(e,t);else if("length"in n&&n.length===+n.length){for(var i=0,r=n.length;i<r;i++)if(i in n&&e.call(t,n[i],i)===es)return}}}function Q(n,e,t){if(!st(n)){if(me(n))return qn(n,e,t);if(jf(n)){var i,r=ot(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===es)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(gc.call(n,o)&&e.call(t,n[o],o)===es)return}}var Oe=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return qn(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function H(n,e){return n.indexOf(e)!==-1}function Yr(n){for(var e=Object.keys(n),t=e.length,i=new Array(t);t--;)i[t]=[e[t],n[e[t]]];return i}var mc=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Su=function(n){try{return n()}catch{return}},qf=function(n){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.apply(this,t)}catch(r){b.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),b.critical(r)}}},Mo=function(n){var e={};return Q(n,function(t,i){Ie(t)&&t.length>0&&(e[i]=t)}),e},Lo=function(n){return n.replace(/^\$/,"")};function Uf(n,e){return t=n,i=function(s){return Ie(s)&&!$t(e)?s.slice(0,e):s},r=new Set,function s(o,a){return o!==Object(o)?i?i(o,a):o:r.has(o)?void 0:(r.add(o),me(o)?(l=[],qn(o,function(c){l.push(s(c))})):(l={},Q(o,function(c,p){r.has(c)||(l[p]=s(c,p))})),l);var l}(t);var t,i,r}var it,Bf=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
319
319
  `).replace(/\r/g,`
320
- `)).length,r=0;r<i;r++){var o=n.charCodeAt(r),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Et(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},wt=function(){function n(e){return e&&(e.preventDefault=n.preventDefault,e.stopPropagation=n.stopPropagation),e}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,r,s){if(e)if(e.addEventListener&&!r)e.addEventListener(t,i,!!s);else{var o="on"+t,a=e[o];e[o]=function(l,c,p){return function(u){if(u=u||n(m?.event)){var d,f=!0;rt(p)&&(d=p(u));var g=c.call(l,u);return d!==!1&&g!==!1||(f=!1),f}}}(e,i,a)}else b.error("No valid element provided to register_event")}}();function vc(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return n[t]}(function(n){n.GZipJS="gzip-js",n.Base64="base64"})(it||(it={}));var mc="$people_distinct_id",Ai="__alias",Ii="__timers",ku="$autocapture_disabled_server_side",Mo="$heatmaps_enabled_server_side",Su="$exception_capture_enabled_server_side",Eu="$web_vitals_enabled_server_side",Lo="$session_recording_enabled_server_side",$u="$console_log_recording_enabled_server_side",Cu="$session_recording_network_payload_capture",Au="$session_recording_canvas_recording",Iu="$replay_sample_rate",Tu="$replay_minimum_duration",Jr="$sesid",Ri="$session_is_sampled",Ln="$enabled_feature_flags",No="$early_access_features",Nn="$stored_person_properties",qt="$stored_group_properties",jo="$surveys",bo="$surveys_activated",Yr="$flag_call_reported",_t="$user_state",qo="$client_session_props",Uo="$capture_rate_limit",Bo="$initial_campaign_params",Ho="$initial_referrer_info",Ru="$initial_person_info",Kr="$epp",zo="__POSTHOG_TOOLBAR__",Bf=[mc,Ai,"__cmpns",Ii,Lo,Mo,Jr,Ln,_t,No,qt,Nn,jo,Yr,qo,Uo,Bo,Ho,Kr],wo="$active_feature_flags",Dr="$override_feature_flags",Pu="$feature_flag_payloads",Ou=function(n){var e,t={},i=ot(zr(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Pe(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},Hf=function(){function n(e){J(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Y(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Ln),t=this.instance.get_property(Dr);if(!t)return e||{};for(var i=Oe({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(b.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Pu)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,i=this.instance.get_property(Nn),r=this.instance.get_property(qt),s={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,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:s,compression:this.instance.config.disable_compression?void 0:it.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var a;e.setReloadingPaused(!1);var l=!0;o.statusCode===200&&(e.$anon_distinct_id=void 0,l=!1),e.receivedFeatureFlags((a=o.json)!==null&&a!==void 0?a:{},l),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,r=this.getFlagVariants()[e],s="".concat(r),o=this.instance.get_property(Yr)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(ge(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(y({},Yr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}b.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(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);b.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();(function(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},p=s.featureFlags,u=s.featureFlagPayloads;if(p)if(ge(p)){var d,f={};if(p)for(var g=0;g<p.length;g++)f[p[g]]=!0;o&&o.register((y(d={},wo,p),y(d,Ln,f),d))}else{var v=p,_=u;s.errorsWhileComputingFlags&&(v=I(I({},l),v),_=I(I({},c),_)),o&&o.register((y(a={},wo,Object.keys(Ou(v))),y(a,Ln,v||{}),y(a,Pu,_||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return b.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Dr);else if(ge(e)){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register(y({},Dr,t))}else this.instance.persistence.register(y({},Dr,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),r=i.flags,s=i.flagVariants;e(r,s)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,r,s=y({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=I(I({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},wo,Object.keys(Ou(o))),y(r,Ln,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(No);if(r&&!i)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:function(s){var o;if(s.json){var a=s.json.earlyAccessFeatures;return(o=t.instance.persistence)===null||o===void 0||o.register(y({},No,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(i){return t[i]}),flagVariants:Object.keys(t).filter(function(i){return t[i]}).reduce(function(i,r){return i[r]=t[r],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(i,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Nn)||{};this.instance.register(y({},Nn,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Nn)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(qt)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=I(I({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},qt,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(qt)||{};this.instance.register(y({},qt,I(I({},t),{},y({},e,{}))))}else this.instance.unregister(qt)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return nt(n)&&isFinite(n)&&Math.floor(n)===n});var Fu="0123456789abcdef",zf=function(){function n(e){if(J(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return Y(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Fu.charAt(this.bytes[t]>>>4)+Fu.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}},{key:"clone",value:function(){return new n(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(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}}],[{key:"fromFieldsV7",value:function(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var 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]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new n(s)}}]),n}(),Wf=function(){function n(){J(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new Vf)}return Y(n,[{key:"generate",value:function(){var e=this.generateOrAbort();if(M(e)){this.timestamp=0;var t=this.generateOrAbort();if(M(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){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 zf.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),n}(),yc=function(n){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<n.length;e++)n[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};m&&!M(m.crypto)&&crypto.getRandomValues&&(yc=function(n){return crypto.getRandomValues(n)});var Du,Vf=function(){function n(){J(this,n),y(this,"buffer",new Uint32Array(8)),y(this,"cursor",1/0)}return Y(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(yc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),Bt=function(){return Gf().toString()},Gf=function(){return(Du||(Du=new Wf)).generate()},Xf="Thu, 01 Jan 1970 00:00:00 GMT",Si="",Jf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Yf(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P;if(Si)return Si;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Bt(),c=new RegExp("(^|;)\\s*"+l+"=1");!Si&&a--;){var p=o.slice(a).join("."),u=l+"=1;domain=."+p;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+Xf,Si=p)}return Si}(n);if(!t){var i=function(r){var s=r.match(Jf);return s?s[0]:""}(n);i!==t&&b.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var ke,St={is_supported:function(){return!!P},error:function(n){b.error("cookieStore error: "+n)},get:function(n){if(P){try{for(var e=n+"=",t=P.cookie.split(";").filter(function(s){return s.length}),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},parse:function(n){var e;try{e=JSON.parse(St.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(P)try{var s="",o="",a=Yf(P.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),s="; expires="+l.toUTCString()}r&&(o="; secure");var c=n+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&b.warn("cookieStore warning: large cookie, len="+c.length),P.cookie=c,c}catch{return}},remove:function(n,e){try{St.set(n,"",-1,e)}catch{return}}},xo=null,he={is_supported:function(){if(!Et(xo))return xo;var n=!0;if(M(m))n=!1;else try{var e="__mplssupport__";he.set(e,"xyz"),he.get(e)!=='"xyz"'&&(n=!1),he.remove(e)}catch{n=!1}return n||b.error("localStorage unsupported; falling back to cookie store"),xo=n,n},error:function(n){b.error("localStorage error: "+n)},get:function(n){try{return m?.localStorage.getItem(n)}catch(e){he.error(e)}return null},parse:function(n){try{return JSON.parse(he.get(n))||{}}catch{}return null},set:function(n,e){try{m?.localStorage.setItem(n,JSON.stringify(e))}catch(t){he.error(t)}},remove:function(n){try{m?.localStorage.removeItem(n)}catch(e){he.error(e)}}},Kf=["distinct_id",Jr,Ri,Kr],Mr=I(I({},he),{},{parse:function(n){try{var e={};try{e=St.parse(n)||{}}catch{}var t=Oe(e,JSON.parse(he.get(n)||"{}"));return he.set(n,t),t}catch{}return null},set:function(n,e,t,i,r){try{he.set(n,e);var s={};Kf.forEach(function(o){e[o]&&(s[o]=e[o])}),Object.keys(s).length&&St.set(n,s,t,i,r)}catch(o){he.error(o)}},remove:function(n,e){try{m?.localStorage.removeItem(n),St.remove(n,e)}catch(t){he.error(t)}}}),Lr={},Qf={is_supported:function(){return!0},error:function(n){b.error("memoryStorage error: "+n)},get:function(n){return Lr[n]||null},parse:function(n){return Lr[n]||null},set:function(n,e){Lr[n]=e},remove:function(n){delete Lr[n]}},ln=null,Se={is_supported:function(){if(!Et(ln))return ln;if(ln=!0,M(m))ln=!1;else try{var n="__support__";Se.set(n,"xyz"),Se.get(n)!=='"xyz"'&&(ln=!1),Se.remove(n)}catch{ln=!1}return ln},error:function(n){b.error("sessionStorage error: ",n)},get:function(n){try{return m?.sessionStorage.getItem(n)}catch(e){Se.error(e)}return null},parse:function(n){try{return JSON.parse(Se.get(n))||null}catch{}return null},set:function(n,e){try{m?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){Se.error(t)}},remove:function(n){try{m?.sessionStorage.removeItem(n)}catch(e){Se.error(e)}}},Zf=["localhost","127.0.0.1"],Pi=function(n){var e=P?.createElement("a");return M(e)?null:(e.href=n,e)},Mu=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},ed=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Q(n,function(s,o){M(s)||M(o)||o==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(s)?s.name:s.toString()),t=encodeURIComponent(o),r[r.length]=t+"="+e)}),r.join(i)},Lu=function(n,e){for(var t,i=((n.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){t=s;break}}if(!ge(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{b.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Qr=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Ye="Mobile",Zr="iOS",pt="Android",Li="Tablet",_c=pt+" "+Li,bc="iPad",wc="Apple",xc=wc+" Watch",Ni="Safari",Hn="BlackBerry",kc="Samsung",Sc=kc+"Browser",Ec=kc+" Internet",zt="Chrome",td=zt+" OS",$c=zt+" "+Zr,oa="Internet Explorer",Cc=oa+" "+Ye,aa="Opera",nd=aa+" Mini",la="Edge",Ac="Microsoft "+la,qn="Firefox",Ic=qn+" "+Zr,ji="Nintendo",qi="PlayStation",Un="Xbox",Tc=pt+" "+Ye,Rc=Ye+" "+Ni,Ti="Windows",Wo=Ti+" Phone",Nu="Nokia",Vo="Ouya",Pc="Generic",id=Pc+" "+Ye.toLowerCase(),Oc=Pc+" "+Li.toLowerCase(),Go="Konqueror",Re="(\\d+(\\.\\d+)?)",ko=new RegExp("Version/"+Re),rd=new RegExp(Un,"i"),sd=new RegExp(qi+" \\w+","i"),od=new RegExp(ji+" \\w+","i"),ua=new RegExp(Hn+"|PlayBook|BB10","i"),ad={"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"},ld=function(n,e){return e&&H(e,wc)||function(t){return H(t,Ni)&&!H(t,zt)&&!H(t,pt)}(n)},ju=function(n,e){return e=e||"",H(n," OPR/")&&H(n,"Mini")?nd:H(n," OPR/")?aa:ua.test(n)?Hn:H(n,"IE"+Ye)||H(n,"WPDesktop")?Cc:H(n,Sc)?Ec:H(n,la)||H(n,"Edg/")?Ac:H(n,"FBIOS")?"Facebook "+Ye:H(n,"UCWEB")||H(n,"UCBrowser")?"UC Browser":H(n,"CriOS")?$c:H(n,"CrMo")?zt:H(n,pt)&&H(n,Ni)?Tc:H(n,zt)?zt:H(n,"FxiOS")?Ic:H(n.toLowerCase(),Go.toLowerCase())?Go:ld(n,e)?H(n,Ye)?Rc:Ni:H(n,qn)?qn:H(n,"MSIE")||H(n,"Trident/")?oa:H(n,"Gecko")?qn:""},ud=(y(ke={},Cc,[new RegExp("rv:"+Re)]),y(ke,Ac,[new RegExp(la+"?\\/"+Re)]),y(ke,zt,[new RegExp("("+zt+"|CrMo)\\/"+Re)]),y(ke,$c,[new RegExp("CriOS\\/"+Re)]),y(ke,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Re)]),y(ke,Ni,[ko]),y(ke,Rc,[ko]),y(ke,aa,[new RegExp("(Opera|OPR)\\/"+Re)]),y(ke,qn,[new RegExp(qn+"\\/"+Re)]),y(ke,Ic,[new RegExp("FxiOS\\/"+Re)]),y(ke,Go,[new RegExp("Konqueror[:/]?"+Re,"i")]),y(ke,Hn,[new RegExp(Hn+" "+Re),ko]),y(ke,Tc,[new RegExp("android\\s"+Re,"i")]),y(ke,Ec,[new RegExp(Sc+"\\/"+Re)]),y(ke,oa,[new RegExp("(rv:|MSIE )"+Re)]),y(ke,"Mozilla",[new RegExp("rv:"+Re)]),ke),qu=[[new RegExp(Un+"; "+Un+" (.*?)[);]","i"),function(n){return[Un,n&&n[1]||""]}],[new RegExp(ji,"i"),[ji,""]],[new RegExp(qi,"i"),[qi,""]],[ua,[Hn,""]],[new RegExp(Ti,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Wo,""];if(new RegExp(Ye).test(e)&&!/IEMobile\b/.test(e))return[Ti+" "+Ye,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=ad[i]||"";return/arm/i.test(e)&&(r="RT"),[Ti,r]}return[Ti,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[Zr,e.join(".")]}return[Zr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=M(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+pt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+pt+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[pt,e.join(".")]}return[pt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(n){var e=["Mac OS X",""];if(n&&n[1]){var t=[n[1],n[2],n[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[td,""]],[/Linux|debian/i,["Linux",""]]],Uu=function(n){return od.test(n)?ji:sd.test(n)?qi:rd.test(n)?Un:new RegExp(Vo,"i").test(n)?Vo:new RegExp("("+Wo+"|WPDesktop)","i").test(n)?Wo:/iPad/.test(n)?bc:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?xc:ua.test(n)?Hn:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(Nu,"i").test(n)?Nu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(Ye).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?pt:_c:pt:new RegExp("(pda|"+Ye+")","i").test(n)?id:new RegExp(Li,"i").test(n)&&!new RegExp(Li+" pc","i").test(n)?Oc:""},Nr="https?://(.*)",cd=["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"],we={campaignParams:function(n){return P?this._campaignParamsFromUrl(P.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=cd.concat(e||[]),i={};return Q(t,function(r){var s=Lu(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Nr+"google.([^/?]*)")===0?"google":n.search(Nr+"bing.com")===0?"bing":n.search(Nr+"yahoo.com")===0?"yahoo":n.search(Nr+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=we._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!Et(e)){i.$search_engine=e;var r=P?Lu(P.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=P?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:ju,browserVersion:function(n,e){var t=ju(n,e),i=ud[t];if(M(i))return null;for(var r=0;r<i.length;r++){var s=i[r],o=n.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(var e=0;e<qu.length;e++){var t=Pe(qu[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(rt(r)?r(s,n):r);if(o)return o}return["",""]},device:Uu,deviceType:function(n){var e=Uu(n);return e===bc||e===_c||e==="Kobo"||e==="Kindle Fire"||e===Oc?Li:e===ji||e===Un||e===qi||e===Vo?"Console":e===xc?"Wearable":e?Ye:"Desktop"},referrer:function(){return P?.referrer||"$direct"},referringDomain:function(){var n;return P!=null&&P.referrer&&((n=Pi(P.referrer))===null||n===void 0?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:Ne?.href}},initialPersonPropsFromInfo:function(n){var e,t=n.r,i=n.u,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Pi(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=Pi(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,Q(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+Do(a)]=o})}return t&&Q(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+Do(a)]=o}),r},properties:function(){if(!le)return{};var n=Pe(we.os(le),2),e=n[0],t=n[1];return Oe(Fo({$os:e,$os_version:t,$browser:we.browser(le,navigator.vendor),$device:we.device(le),$device_type:we.deviceType(le)}),{$current_url:Ne?.href,$host:Ne?.host,$pathname:Ne?.pathname,$raw_user_agent:le.length>1e3?le.substring(0,997)+"...":le,$browser_version:we.browserVersion(le,navigator.vendor),$browser_language:we.browserLanguage(),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:"web",$lib_version:ct.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:gc()/1e3})},people_properties:function(){if(!le)return{};var n=Pe(we.os(le),2),e=n[0],t=n[1];return Oe(Fo({$os:e,$os_version:t,$browser:we.browser(le,navigator.vendor)}),{$browser_version:we.browserVersion(le,navigator.vendor)})}},pd=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],So=function(){function n(e){J(this,n),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(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(),this.update_config(e,e),this.save()}return Y(n,[{key:"buildStorage",value:function(e){pd.indexOf(e.persistence.toLowerCase())===-1&&(b.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&he.is_supported()?he:t==="localstorage+cookie"&&Mr.is_supported()?Mr:t==="sessionstorage"&&Se.is_supported()?Se:t==="memory"?Qf:t==="cookie"?St:Mr.is_supported()?Mr:St}},{key:"properties",value:function(){var e={};return Q(this.props,function(t,i){if(i===Ln&&Fe(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else a=i,l=!1,(Et(o=Bf)?l:_u&&o.indexOf===_u?o.indexOf(a)!=-1:(Q(o,function(c){if(l||(l=c===a))return Xr}),l))||(e[i]=t);var o,a,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Oe({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,i){var r=this;if(Fe(e)){M(t)&&(t="None"),this.expire_days=M(i)?this.default_expiry:i;var s=!1;if(Q(e,function(o,a){r.props.hasOwnProperty(a)&&r.props[a]!==t||(r.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(Fe(e)){this.expire_days=M(t)?this.default_expiry:t;var r=!1;if(Q(e,function(s,o){e.hasOwnProperty(o)&&i.props[o]!==s&&(i.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(we.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(we.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(we.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[Bo]||this.props[Ho]||this.register_once(y({},Ru,we.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Fo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Q([Ho,Bo],function(s){var o=e.props[s];o&&Q(o,function(a,l){t["$initial_"+Do(l)]=a})});var i=this.props[Ru];if(i){var r=we.initialPersonPropsFromInfo(i);Oe(t,r)}return t}},{key:"safe_merge",value:function(e){return Q(this.props,function(t,i){i in e||(e[i]=t)}),e}},{key:"update_config",value:function(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),r=this.props;this.clear(),this.storage=i,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var i=this.props[Ii]||{};i[e]=t,this.props[Ii]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Ii]||{})[e];return M(t)||(delete this.props[Ii][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),n}(),fd=2,dd=4,Wr=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(Wr||{}),yt=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(yt||{});function ca(n){return n?ls(n).split(/\s+/):[]}function es(n){var e="";switch(Mi(n.className)){case"string":e=n.className;break;case"object":e=("baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return ca(e)}function Fc(n){return st(n)?null:ls(n).split(/(\s+)/).filter(function(e){return Bn(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ts(n){var e="";return Jo(n)&&!Nc(n)&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;Dc(t)&&t.textContent&&(e+=(i=Fc(t.textContent))!==null&&i!==void 0?i:"")}),ls(e)}function pa(n){return!!n&&n.nodeType===1}function Wt(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function Dc(n){return!!n&&n.nodeType===3}function Mc(n){return!!n&&n.nodeType===11}var Xo=["a","button","form","input","select","textarea","label"];function Lc(n){var e=n.parentNode;return!(!e||!pa(e))&&e}function hd(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!m||!n||Wt(n,"html")||!pa(n))return!1;if(t!=null&&t.url_allowlist){var s=m.location.href,o=t.url_allowlist;if(o&&!o.some(function(v){return s.match(v)}))return!1}if(t!=null&&t.dom_event_allowlist){var a=t.dom_event_allowlist;if(a&&!a.some(function(v){return e.type===v}))return!1}for(var l=!1,c=[n],p=!0,u=n;u.parentNode&&!Wt(u,"body");)if(Mc(u.parentNode))c.push(u.parentNode.host),u=u.parentNode.host;else{if(!(p=Lc(u)))break;if(i||Xo.indexOf(p.tagName.toLowerCase())>-1)l=!0;else{var d=m.getComputedStyle(p);d&&d.getPropertyValue("cursor")==="pointer"&&(l=!0)}c.push(p),u=p}if(!function(v,_){var E=_?.element_allowlist;if(M(E))return!0;var S,O=ot(v);try{var j=function(){var G=S.value;if(E.some(function(V){return G.tagName.toLowerCase()===V}))return{v:!0}};for(O.s();!(S=O.n()).done;){var U=j();if(Mi(U)==="object")return U.v}}catch(G){O.e(G)}finally{O.f()}return!1}(c,t)||!function(v,_){var E=_?.css_selector_allowlist;if(M(E))return!0;var S,O=ot(v);try{var j=function(){var G=S.value;if(E.some(function(V){return G.matches(V)}))return{v:!0}};for(O.s();!(S=O.n()).done;){var U=j();if(Mi(U)==="object")return U.v}}catch(G){O.e(G)}finally{O.f()}return!1}(c,t))return!1;var f=m.getComputedStyle(n);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=n.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return l?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Xo.indexOf(g)>-1||n.getAttribute("contenteditable")==="true")}}function Jo(n){for(var e=n;e.parentNode&&!Wt(e,"body");e=e.parentNode){var t=es(e);if(H(t,"ph-sensitive")||H(t,"ph-no-capture"))return!1}if(H(es(n),"ph-include"))return!0;var i=n.type||"";if(Ie(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Ie(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function Nc(n){return!!(Wt(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||Wt(n,"select")||Wt(n,"textarea")||n.getAttribute("contenteditable")==="true")}var jc="(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})",gd=new RegExp("^(?:".concat(jc,")$")),vd=new RegExp(jc),qc="\\d{3}-?\\d{2}-?\\d{4}",md=new RegExp("^(".concat(qc,")$")),yd=new RegExp("(".concat(qc,")"));function Bn(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(st(n)||Ie(n)&&(n=ls(n),(e?gd:vd).test((n||"").replace(/[- ]/g,""))||(e?md:yd).test(n)))}function Bu(n){var e=ts(n);return Bn(e="".concat(e," ").concat(Uc(n)).trim())?e:""}function Uc(n){var e="";return n&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=ts(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(Uc(t)).trim())}catch(s){b.error(s)}}),e}function _d(n){return function(e){var t=e.map(function(i){var r,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class){i.attr_class.sort();var a,l=ot(i.attr_class);try{for(l.s();!(a=l.n()).done;){var c=a.value;o+=".".concat(c.replace(/"/g,""))}}catch(d){l.e(d)}finally{l.f()}}var p=I(I(I(I({},i.text?{text:i.text}:{}),{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r: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),u={};return zr(p).sort(function(d,f){var g=Pe(d,1)[0],v=Pe(f,1)[0];return g.localeCompare(v)}).forEach(function(d){var f=Pe(d,2),g=f[0],v=f[1];return u[Hu(g.toString())]=Hu(v.toString())}),o+=":",o+=zr(p).map(function(d){var f=Pe(d,2),g=f[0],v=f[1];return"".concat(g,'="').concat(v,'"')}).join("")});return t.join(";")}(function(e){return e.map(function(t){var i,r,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:bd(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return zr(t).filter(function(o){return Pe(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Pe(o,2),l=a[0],c=a[1];return s.attributes[l]=c}),s})}(n))}function Hu(n){return n.replace(/"|\\"/g,'\\"')}function bd(n){var e=n.attr__class;return e?ge(e)?e:ca(e):void 0}var Yo="[SessionRecording]",Ko="redacted",jr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(n){return n},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},wd=["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"],xd=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],kd=["/s/","/e/","/i/"];function zu(n,e,t,i){if(st(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Ie(r)&&(r=parseInt(r)),r>t?Yo+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function Wu(n,e){if(st(n))return n;var t=n;return Bn(t,!1)||(t=Yo+" "+e+" body "+Ko),Q(xd,function(i){var r,s;(r=t)!==null&&r!==void 0&&r.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=Yo+" "+e+" body "+Ko+" as might contain: "+i)}),t}var Sd=function(n,e){var t,i,r,s={payloadSizeLimitBytes:jr.payloadSizeLimitBytes,performanceEntryTypeToObserve:kt(jr.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(kt(e.payloadHostDenyList||[]),kt(jr.payloadHostDenyList))},o=n.session_recording.recordHeaders!==!1&&e.recordHeaders,a=n.session_recording.recordBody!==!1&&e.recordBody,l=n.capture_performance!==!1&&e.recordPerformance,c=(t=s,r=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(d){return d!=null&&d.requestBody&&(d.requestBody=zu(d.requestBody,d.requestHeaders,r,"Request")),d!=null&&d.responseBody&&(d.responseBody=zu(d.responseBody,d.responseHeaders,r,"Response")),d}),p=function(d){return c(function(v){var _=Pi(v.name);if(!(_&&_.pathname&&kd.some(function(E){return _.pathname.indexOf(E)===0})))return v}((g=(f=d).requestHeaders,st(g)||Q(Object.keys(g??{}),function(v){wd.includes(v.toLowerCase())&&(g[v]=Ko)}),f)));var f,g},u=rt(n.session_recording.maskNetworkRequestFn);return u&&rt(n.session_recording.maskCapturedNetworkRequestFn)&&b.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(n.session_recording.maskCapturedNetworkRequestFn=function(d){var f=n.session_recording.maskNetworkRequestFn({url:d.name});return I(I({},d),{},{name:f?.url})}),s.maskRequestFn=rt(n.session_recording.maskCapturedNetworkRequestFn)?function(d){var f,g,v,_=p(d);return _&&(f=(g=(v=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(v,_))!==null&&f!==void 0?f:void 0}:function(d){return function(f){if(!M(f))return f.requestBody=Wu(f.requestBody,"Request"),f.responseBody=Wu(f.responseBody,"Response"),f}(p(d))},I(I(I({},jr),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Ed=Y(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};J(this,n),y(this,"bucketSize",100),y(this,"refillRate",10),y(this,"mutationBuckets",{}),y(this,"loggedTracker",{}),y(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(o){r.mutationBuckets[o]=r.mutationBuckets[o]+r.refillRate,r.mutationBuckets[o]>=r.bucketSize&&delete r.mutationBuckets[o]})}),y(this,"getNodeOrRelevantParent",function(o){var a=r.rrweb.mirror.getNode(o);if(a?.nodeName!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[r.rrweb.mirror.getId(l),l]}return[o,a]}),y(this,"numberOfChanges",function(o){var a,l,c,p,u,d,f,g;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((c=(p=o.attributes)===null||p===void 0?void 0:p.length)!==null&&c!==void 0?c:0)+((u=(d=o.texts)===null||d===void 0?void 0:d.length)!==null&&u!==void 0?u:0)+((f=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&f!==void 0?f:0)}),y(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var a=o.data,l=r.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(p){var u,d,f,g=Pe(r.getNodeOrRelevantParent(p.id),2),v=g[0],_=g[1];return r.mutationBuckets[v]===0?!1:(r.mutationBuckets[v]=(u=r.mutationBuckets[v])!==null&&u!==void 0?u:r.bucketSize,r.mutationBuckets[v]=Math.max(r.mutationBuckets[v]-1,0),r.mutationBuckets[v]===0&&(r.loggedTracker[v]||(r.loggedTracker[v]=!0,(d=(f=r.options).onBlockedNode)===null||d===void 0||d.call(f,v,_))),p)}));var c=r.numberOfChanges(a);return c!==0||l===c?o:void 0}),this.rrweb=e,this.options=s,this.refillRate=(t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),$d=3e5,Cd=[yt.MouseMove,yt.MouseInteraction,yt.Scroll,yt.ViewportResize,yt.Input,yt.TouchMove,yt.MediaInteraction,yt.Drag],Vu=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Je="[SessionRecording]";function Ad(n){return JSON.stringify(n,(e=[],function(t,i){if(Fe(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i})).length;var e}var bt,Id=function(){function n(e){var t=this;if(J(this,n),y(this,"queuedRRWebEvents",[]),y(this,"isIdle",!1),y(this,"_linkedFlagSeen",!1),y(this,"_lastActivityTimestamp",Date.now()),y(this,"_linkedFlag",null),y(this,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,m?.addEventListener("beforeunload",function(){t._flushBuffer()}),m?.addEventListener("offline",function(){t._tryAddCustomEvent("browser offline",{})}),m?.addEventListener("online",function(){t._tryAddCustomEvent("browser online",{})}),m?.addEventListener("visibilitychange",function(){if(P!=null&&P.visibilityState){var o="window "+P.visibilityState;t._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw b.error(Je+" started without valid sessionManager"),new Error(Je+" started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,s=i.windowId;this.sessionId=r,this.windowId=s,this.buffer=this.clearBuffer(),this._setupSampling()}return Y(n,[{key:"rrwebRecord",get:function(){var e;return ce==null||(e=ce.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Je+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.full_snapshot_interval_millis)||$d}},{key:"isSampled",get:function(){var e=this.instance.get_property(Ri);return Mn(e)?e:null}},{key:"sessionDuration",get:function(){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],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Lo),t=!this.instance.config.disable_session_recording;return m&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property($u),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(Au);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(Cu),r={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=r?.recordHeaders||i?.recordHeaders,o=r?.recordBody||i?.recordBody,a=Fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,l=!!(Mn(a)?a:i?.capturePerformance);return s||o||l?{recordHeaders:s,recordBody:o,recordPerformance:l}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(Iu);return nt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(Tu);return nt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?st(this._linkedFlag)||this._linkedFlagSeen?Mn(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),b.info(Je+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,b.info(Je+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(nt(r)){var s,o=this.isSampled,a=i||!Mn(o);a?s=Math.random()<r:s=o,!s&&a&&b.warn(Je+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),(t=this.instance.persistence)===null||t===void 0||t.register(y({},Ri,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},Ri,null))}}},{key:"afterDecideResponse",value:function(e){var t,i,r,s=this;if(this._persistDecideResponse(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=(r=e.sessionRecording)===null||r===void 0?void 0:r.endpoint),this._setupSampling(),!st(this._linkedFlag)){var o=Ie(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Ie(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,c){var p=Fe(c)&&o in c,u=a?c[o]===a:p;if(u){var d={linkedFlag:o,linkedVariant:a},f="linked flag matched";b.info(Je+" "+f,d),s._tryAddCustomEvent(f,d)}s._linkedFlagSeen=u})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;nt(this.sampleRate)&&Et(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,i=function(){var r,s,o,a,l,c,p,u,d=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate,f=st(d)?null:parseFloat(d),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(u={},Lo,!!e.sessionRecording),y(u,$u,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(u,Cu,I({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(u,Au,{enabled:(l=e.sessionRecording)===null||l===void 0?void 0:l.recordCanvas,fps:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasFps,quality:(p=e.sessionRecording)===null||p===void 0?void 0:p.canvasQuality}),y(u,Iu,f),y(u,Tu,M(g)?null:g),u))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(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:gc()})}},{key:"_startCapture",value:function(){var e=this;M(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(ct.LIB_VERSION),function(t){if(t)return b.error(Je+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&Cd.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),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 r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=r.windowId,o=r.sessionId,a=this.sessionId!==o,l=this.windowId!==s;this.windowId=s,this.sessionId=o,(i||[fd,dd].indexOf(e.type)===-1&&(l||a||M(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(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}):b.warn(Je+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(Vu(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Vu(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording,s=0,o=Object.entries(r||{});s<o.length;s++){var a=Pe(o[s],2),l=a[0],c=a[1];l in i&&(i[l]=c)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new Ed(this.rrwebRecord,{onBlockedNode:function(u,d){var f="Too many mutations on node '".concat(u,"'. Rate limiting. This could be due to SVG animations or something similar");b.info(f,{node:d}),t.log(Je+" "+f,"warn")}});var p=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(I({emit:function(u){t.onRRwebEmit(u)},plugins:p},i)),this.instance._addCaptureHook(function(u){try{if(u==="$pageview"){var d=m?t._maskUrl(m.location.href):"";if(!d)return;t._tryAddCustomEvent("$pageview",{href:d})}}catch(f){b.error("Could not add $pageview to rrweb session",f)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:p.map(function(u){return u?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else b.error(Je+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return ce.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(ce.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&rt(ce.getRecordNetworkPlugin)&&(!Zf.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(ce.getRecordNetworkPlugin(Sd(this.instance.config,this.networkPayloadCapture))):b.info(Je+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Fe(e)){if(e.type===Wr.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Wr.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&Fe(l)&&l.type===6&&Fe(l.data)&&l.data.plugin==="rrweb/console@1"){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var c=[],p=0;p<l.data.payload.payload.length;p++)l.data.payload.payload[p]&&l.data.payload.payload[p].length>2e3?c.push(l.data.payload.payload[p].slice(0,2e3)+"...[truncated]"):c.push(l.data.payload.payload[p]);return l.data.payload.payload=c,a}return a}(i),s=Ad(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Wr.Custom){var o={$snapshot_bytes:s,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){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)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=kt(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt<=2e3&&e._tryRRWebMethod(i)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,r={url:e};return(i=r=t.maskNetworkRequestFn(r))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=nt(i)&&i>=0,s=nt(t)&&r&&i<t;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);(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.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),n}(),Td=function(){function n(e){J(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Y(n,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Nn),group_properties:this.instance.get_property(qt),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:it.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(i){return e.parseDecideResponse(i.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var i=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},i),i)b.error("Failed to fetch feature flags from PostHog.");else{if(!P||!P.body)return b.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r,s=ot(e.siteApps);try{var o=function(){var a=r.value,l=a.id,c=a.url,p=t.instance.requestRouter.endpointFor("api",c);ce["__$$ph_site_app_".concat(l)]=t.instance,t.instance.requestRouter.loadScript(p,function(u){u&&b.error("Error while initializing PostHog app with config id ".concat(l),u)})};for(s.s();!(r=s.n()).done;)o()}catch(a){s.e(a)}finally{s.f()}}else e.siteApps.length>0&&b.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),Rd=m!=null&&m.location?Qr(m.location.hash,"__posthog")||Qr(location.hash,"state"):null,Gu="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(bt||(bt={}));var Pd=function(){function n(e){J(this,n),this.instance=e}return Y(n,[{key:"setToolbarState",value:function(e){ce.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=ce.ph_toolbar_state)!==null&&e!==void 0?e:bt.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=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||!P)return!1;i=(e=i)!==null&&e!==void 0?e:m.location,s=(t=s)!==null&&t!==void 0?t:m.history;try{if(!r){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}r=m?.localStorage}var o,a=Rd||Qr(i.hash,"__posthog")||Qr(i.hash,"state"),l=a?xu(function(){return JSON.parse(atob(decodeURIComponent(a)))})||xu(function(){return JSON.parse(decodeURIComponent(a))}):null;return l&&l.action==="ph_authorize"?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(r.getItem(Gu)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(ce.ph_load_toolbar||ce.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(P==null||!P.getElementById(zo));if(!m||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=I(I({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(m.localStorage.setItem(Gu,JSON.stringify(I(I({},s),{},{source:void 0}))),this.getToolbarState()===bt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===bt.UNINITIALIZED){this.setToolbarState(bt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(a),function(l){if(l)return b.error("Failed to load toolbar",l),void t.setToolbarState(bt.UNINITIALIZED);t.setToolbarState(bt.LOADED),t._callLoadToolbar(s)}),wt(m,"turbolinks:load",function(){t.setToolbarState(bt.UNINITIALIZED),t.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){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)}}]),n}(),Od=function(){function n(e){J(this,n),y(this,"isPaused",!0),y(this,"queue",[]),y(this,"flushTimeoutMs",3e3),this.sendRequest=e}return Y(n,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},i=Object.values(t),r=[].concat(kt(i.filter(function(s){return s.url.indexOf("/e")===0})),kt(i.filter(function(s){return s.url.indexOf("/e")!==0})));r.map(function(s){e.sendRequest(I(I({},s),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),i=function(s){var o=t[s],a=new Date().getTime();o.data&&ge(o.data)&&Q(o.data,function(l){l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.sendRequest(o)};for(var r in t)i(r)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Q(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;M(e[s])&&(e[s]=I(I({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),He=Uint8Array,De=Uint16Array,zn=Uint32Array,fa=new He([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]),da=new He([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]),Xu=new He([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bc=function(n,e){for(var t=new De(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new zn(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},Hc=Bc(fa,2),Fd=Hc[0],Qo=Hc[1];Fd[28]=258,Qo[258]=28;for(Zo=Bc(da,0)[1],ns=new De(32768),ee=0;ee<32768;++ee)jt=(43690&ee)>>>1|(21845&ee)<<1,jt=(61680&(jt=(52428&jt)>>>2|(13107&jt)<<2))>>>4|(3855&jt)<<4,ns[ee]=((65280&jt)>>>8|(255&jt)<<8)>>>1;var jt,Zo,ns,ee,Oi=function(n,e,t){for(var i=n.length,r=0,s=new De(e);r<i;++r)++s[n[r]-1];var o,a=new De(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new De(1<<e);var l=15-e;for(r=0;r<i;++r)if(n[r])for(var c=r<<4|n[r],p=e-n[r],u=a[n[r]-1]++<<p,d=u|(1<<p)-1;u<=d;++u)o[ns[u]>>>l]=c}else for(o=new De(i),r=0;r<i;++r)o[r]=ns[a[n[r]-1]++]>>>15-n[r];return o},pn=new He(288);for(ee=0;ee<144;++ee)pn[ee]=8;for(ee=144;ee<256;++ee)pn[ee]=9;for(ee=256;ee<280;++ee)pn[ee]=7;for(ee=280;ee<288;++ee)pn[ee]=8;var is=new He(32);for(ee=0;ee<32;++ee)is[ee]=5;var Dd=Oi(pn,9,0),Md=Oi(is,5,0),zc=function(n){return(n/8>>0)+(7&n&&1)},Wc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof De?De:n instanceof zn?zn:He)(t-e);return i.set(n.subarray(e,t)),i},mt=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},Ei=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},Eo=function(n,e){for(var t=[],i=0;i<n.length;++i)n[i]&&t.push({s:i,f:n[i]});var r=t.length,s=t.slice();if(!r)return[new He(0),0];if(r==1){var o=new He(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(U,G){return U.f-G.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],c=0,p=1,u=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};p!=r-1;)a=t[t[c].f<t[u].f?c++:u++],l=t[c!=p&&t[c].f<t[u].f?c++:u++],t[p++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;i<r;++i)s[i].s>d&&(d=s[i].s);var f=new De(d+1),g=Ld(t[p-1],f,0);if(g>e){i=0;var v=0,_=g-e,E=1<<_;for(s.sort(function(U,G){return f[G.s]-f[U.s]||U.f-G.f});i<r;++i){var S=s[i].s;if(!(f[S]>e))break;v+=E-(1<<g-f[S]),f[S]=e}for(v>>>=_;v>0;){var O=s[i].s;f[O]<e?v-=1<<e-f[O]++-1:++i}for(;i>=0&&v;--i){var j=s[i].s;f[j]==e&&(--f[j],++v)}g=e}return[new He(f),g]},Ld=function n(e,t,i){return e.s==-1?Math.max(n(e.l,t,i+1),n(e.r,t,i+1)):t[e.s]=i},Ju=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new De(++e),i=0,r=n[0],s=1,o=function(l){t[i++]=l},a=1;a<=e;++a)if(n[a]==r&&a!=e)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=n[a]}return[t.subarray(0,i),e]},$i=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},Vr=function(n,e,t){var i=t.length,r=zc(e+2);n[r]=255&i,n[r+1]=i>>>8,n[r+2]=255^n[r],n[r+3]=255^n[r+1];for(var s=0;s<i;++s)n[r+s+4]=t[s];return 8*(r+4+i)},Yu=function(n,e,t,i,r,s,o,a,l,c,p){mt(e,p++,t),++r[256];for(var u=Eo(r,15),d=u[0],f=u[1],g=Eo(s,15),v=g[0],_=g[1],E=Ju(d),S=E[0],O=E[1],j=Ju(v),U=j[0],G=j[1],V=new De(19),C=0;C<S.length;++C)V[31&S[C]]++;for(C=0;C<U.length;++C)V[31&U[C]]++;for(var B=Eo(V,7),X=B[0],dt=B[1],me=19;me>4&&!X[Xu[me-1]];--me);var ze,K,te,ue,Me=c+5<<3,qe=$i(r,pn)+$i(s,is)+o,oe=$i(r,d)+$i(s,v)+o+14+3*me+$i(V,X)+(2*V[16]+3*V[17]+7*V[18]);if(Me<=qe&&Me<=oe)return Vr(e,p,n.subarray(l,l+c));if(mt(e,p,1+(oe<qe)),p+=2,oe<qe){ze=Oi(d,f,0),K=d,te=Oi(v,_,0),ue=v;var $e=Oi(X,dt,0);for(mt(e,p,O-257),mt(e,p+5,G-1),mt(e,p+10,me-4),p+=14,C=0;C<me;++C)mt(e,p+3*C,X[Xu[C]]);p+=3*me;for(var Ce=[S,U],ne=0;ne<2;++ne){var ye=Ce[ne];for(C=0;C<ye.length;++C){var Te=31&ye[C];mt(e,p,$e[Te]),p+=X[Te],Te>15&&(mt(e,p,ye[C]>>>5&127),p+=ye[C]>>>12)}}}else ze=Dd,K=pn,te=Md,ue=is;for(C=0;C<a;++C)if(i[C]>255){Te=i[C]>>>18&31,Ei(e,p,ze[Te+257]),p+=K[Te+257],Te>7&&(mt(e,p,i[C]>>>23&31),p+=fa[Te]);var dn=31&i[C];Ei(e,p,te[dn]),p+=ue[dn],dn>3&&(Ei(e,p,i[C]>>>5&8191),p+=da[dn])}else Ei(e,p,ze[i[C]]),p+=K[i[C]];return Ei(e,p,ze[256]),p+K[256]},Nd=new zn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jd=new He(0),qd=function(){for(var n=new zn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),Ud=function(n,e,t,i,r){return function(s,o,a,l,c,p){var u=s.length,d=new He(l+u+5*(1+Math.floor(u/7e3))+c),f=d.subarray(l,d.length-c),g=0;if(!o||u<8)for(var v=0;v<=u;v+=65535){var _=v+65535;_<u?g=Vr(f,g,s.subarray(v,_)):(f[v]=p,g=Vr(f,g,s.subarray(v,u)))}else{for(var E=Nd[o-1],S=E>>>13,O=8191&E,j=(1<<a)-1,U=new De(32768),G=new De(j+1),V=Math.ceil(a/3),C=2*V,B=function(xs){return(s[xs]^s[xs+1]<<V^s[xs+2]<<C)&j},X=new zn(25e3),dt=new De(288),me=new De(32),ze=0,K=0,te=(v=0,0),ue=0,Me=0;v<u;++v){var qe=B(v),oe=32767&v,$e=G[qe];if(U[oe]=$e,G[qe]=oe,ue<=v){var Ce=u-v;if((ze>7e3||te>24576)&&Ce>423){g=Yu(s,f,0,X,dt,me,K,te,Me,v-Me,g),te=ze=K=0,Me=v;for(var ne=0;ne<286;++ne)dt[ne]=0;for(ne=0;ne<30;++ne)me[ne]=0}var ye=2,Te=0,dn=O,$t=oe-$e&32767;if(Ce>2&&qe==B(v-$t))for(var yp=Math.min(S,Ce)-1,_p=Math.min(32767,v),bp=Math.min(258,Ce);$t<=_p&&--dn&&oe!=$e;){if(s[v+ye]==s[v+ye-$t]){for(var Ct=0;Ct<bp&&s[v+Ct]==s[v+Ct-$t];++Ct);if(Ct>ye){if(ye=Ct,Te=$t,Ct>yp)break;var wp=Math.min($t,Ct-2),xa=0;for(ne=0;ne<wp;++ne){var ws=v-$t+ne+32768&32767,ka=ws-U[ws]+32768&32767;ka>xa&&(xa=ka,$e=ws)}}}$t+=(oe=$e)-($e=U[oe])+32768&32767}if(Te){X[te++]=268435456|Qo[ye]<<18|Zo[Te];var Sa=31&Qo[ye],Ea=31&Zo[Te];K+=fa[Sa]+da[Ea],++dt[257+Sa],++me[Ea],ue=v+ye,++ze}else X[te++]=s[v],++dt[s[v]]}}g=Yu(s,f,p,X,dt,me,K,te,Me,v-Me,g),p||(g=Vr(f,g,jd))}return Wc(d,0,l+zc(g)+c)}(n,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+e.mem,t,i,!r)},$o=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function Bd(n,e){e===void 0&&(e={});var t=function(){var o=4294967295;return{p:function(a){for(var l=o,c=0;c<a.length;++c)l=qd[255&l^a[c]]^l>>>8;o=l},d:function(){return 4294967295^o}}}(),i=n.length;t.p(n);var r=Ud(n,e,function(o){return 10+(o.filename&&o.filename.length+1||0)}(e),8),s=r.length;return function(o,a){var l=a.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=a.level<2?4:a.level==9?2:0,o[9]=3,a.mtime!=0&&$o(o,4,Math.floor(new Date(a.mtime||Date.now())/1e3)),l){o[3]=8;for(var c=0;c<=l.length;++c)o[c+10]=l.charCodeAt(c)}}(r,e),$o(r,s-8,t.d()),$o(r,s-4,i),r}var Hd=!!Oo||!!Po,Ku="text/plain",rs=function(n,e){var t=Pe(n.split("?"),2),i=t[0],r=t[1],s=I({},e);r?.split("&").forEach(function(a){var l=Pe(a.split("="),1)[0];delete s[l]});var o=ed(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},zd=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},Co=function(n){var e=n.data,t=n.compression;if(e){if(t===it.GZipJS){var i=Bd(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new He(s.length+(s.length>>>1)),c=0,p=function(g){l[c++]=g},u=0;u<a;++u){if(c+5>l.length){var d=new He(c+8+(a-u<<1));d.set(l),l=d}var f=s.charCodeAt(u);f<128||o?p(f):f<2048?(p(192|f>>>6),p(128|63&f)):f>55295&&f<57344?(p(240|(f=65536+(1047552&f)|1023&s.charCodeAt(++u))>>>18),p(128|f>>>12&63),p(128|f>>>6&63),p(128|63&f)):(p(224|f>>>12),p(128|f>>>6&63),p(128|63&f))}return Wc(l,0,c)}(JSON.stringify(e)),{mtime:0});return{contentType:Ku,body:new Blob([i],{type:Ku})}}if(t===it.Base64){var r=function(s){var o,a,l,c,p,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,f=0,g="",v=[];if(!s)return s;s=Uf(s);do o=(p=s.charCodeAt(d++)<<16|s.charCodeAt(d++)<<8|s.charCodeAt(d++))>>18&63,a=p>>12&63,l=p>>6&63,c=63&p,v[f++]=u.charAt(o)+u.charAt(a)+u.charAt(l)+u.charAt(c);while(d<s.length);switch(g=v.join(""),s.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:zd(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Fi=[];Oo&&Fi.push({transport:"XHR",method:function(n){var e,t=new Oo;t.open(n.method||"GET",n.url,!0);var i=(e=Co(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;Q(n.headers,function(o,a){t.setRequestHeader(a,o)}),r&&t.setRequestHeader("Content-Type",r),n.timeout&&(t.timeout=n.timeout),t.withCredentials=!0,t.onreadystatechange=function(){if(t.readyState===4){var o,a={statusCode:t.status,text:t.responseText};if(t.status===200)try{a.json=JSON.parse(t.responseText)}catch{}(o=n.callback)===null||o===void 0||o.call(n,a)}},t.send(s)}}),Po&&Fi.push({transport:"fetch",method:function(n){var e,t,i=(e=Co(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;Q(o,function(p,u){o.append(u,p)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(bu){var c=new bu;l={signal:c.signal,timeout:setTimeout(function(){return c.abort()},n.timeout)}}Po(a,{method:n?.method||"GET",headers:o,keepalive:n.method==="POST",body:s,signal:(t=l)===null||t===void 0?void 0:t.signal}).then(function(p){return p.text().then(function(u){var d,f={statusCode:p.status,text:u};if(p.status===200)try{f.json=JSON.parse(u)}catch(g){b.error(g)}(d=n.callback)===null||d===void 0||d.call(n,f)})}).catch(function(p){var u;b.error(p),(u=n.callback)===null||u===void 0||u.call(n,{statusCode:0,text:p})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),xt!=null&&xt.sendBeacon&&Fi.push({transport:"sendBeacon",method:function(n){var e=rs(n.url,{beacon:"1"});try{var t,i=(t=Co(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;xt.sendBeacon(e,o)}catch{}}});var Wd=["retriesPerformedSoFar"],cn,Vd=function(){function n(e){var t=this;J(this,n),y(this,"isPolling",!1),y(this,"pollIntervalMs",3e3),y(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!M(m)&&"onLine"in m.navigator&&(this.areWeOnline=m.navigator.onLine,m.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),m.addEventListener("offline",function(){t.areWeOnline=!1}))}return Y(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=Mf(e,Wd);nt(i)&&i>0&&(r.url=rs(r.url,{retry_count:i})),this.instance._send_request(I(I({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(I({retriesPerformedSoFar:i},r)):(o=r.callback)===null||o===void 0||o.call(r,s)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),p=(Math.random()-.5)*(c-l);return Math.ceil(c+p)}(t),r=Date.now()+i;this.queue.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),b.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],i=this.queue.filter(function(a){return a.retryAt<e||(t.push(a),!1)});if(this.queue=t,i.length>0){var r,s=ot(i);try{for(s.s();!(r=s.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(a){s.e(a)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=ot(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(I(I({},i),{},{transport:"sendBeacon"}))}catch(r){b.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),qr=1800,Gd=function(){function n(e,t,i,r){var s;J(this,n),y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||Bt,this._windowIdGenerator=r||Bt;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||qr;if(nt(a)?a>qr?b.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&b.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(b.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=qr),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),qr),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var l=Se.parse(this._window_id_storage_key),c=Se.parse(this._primary_window_exists_storage_key);l&&!c?this._windowId=l:Se.remove(this._window_id_storage_key),Se.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var p=function(u){var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),p)}catch(u){b.error("Invalid sessionID in bootstrap",u)}this._listenToReloadWindow()}return Y(n,[{key:"onSessionId",value:function(e){var t=this;return M(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Se.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Se.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Se.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(y({},Jr,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Jr];return ge(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;m?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&Se.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){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=Pe(this._getSessionId(),3),r=i[0],s=i[1],o=i[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(t-o)>864e5,c=!1,p=!s,u=!e&&Math.abs(t-r)>this._sessionTimeoutMs;p||u||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),b.info("[SessionId] new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:p,activityTimeout:u,sessionPastMaximumLength:l}}),o=t,c=!0):a||(a=this._windowIdGenerator(),c=!0);var d=r===0||!e||l?t:r,f=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,d,f),c&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:f}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(cn||(cn={}));var Qu="i.posthog.com",Xd=function(){function n(e){J(this,n),y(this,"_regionCache",{}),this.instance=e}return Y(n,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=cn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=cn.EU:this._regionCache[this.apiHost]=cn.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(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||this.apiHost.replace(".".concat(Qu),".posthog.com"))+t;if(this.region===cn.CUSTOM)return this.apiHost+t;var i=Qu+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return b.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var i=e[0]==="/"?this.endpointFor("assets",e):e,r=function(){if(!P)return t("document not found");var s=P.createElement("script");s.type="text/javascript",s.src=i,s.onload=function(l){return t(void 0,l)},s.onerror=function(l){return t(l)};var o,a=P.querySelectorAll("body > script");a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(s,a[0]):P.body.appendChild(s)};P!=null&&P.body?r():P?.addEventListener("DOMContentLoaded",r)}}]),n}(),Vc="posthog-js";function Gc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.organization,i=e.projectId,r=e.prefix,s=e.severityAllowList,o=s===void 0?["error"]:s;return function(a){var l,c,p,u,d;if(!(o==="*"||o.includes(a.level))||!n.__loaded)return a;a.tags||(a.tags={});var f=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=f,n.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));var g=((l=a.exception)===null||l===void 0?void 0:l.values)||[],v={$exception_message:((c=g[0])===null||c===void 0?void 0:c.value)||a.message,$exception_type:(p=g[0])===null||p===void 0?void 0:p.type,$exception_personURL:f,$exception_level:a.level,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((u=g[0])===null||u===void 0?void 0:u.value)||a.message,$sentry_exception_type:(d=g[0])===null||d===void 0?void 0:d.type,$sentry_tags:a.tags,$level:a.level};return t&&i&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.capture("$exception",v),a}}var Jd=Y(function n(e,t,i,r,s){J(this,n),this.name=Vc,this.setupOnce=function(o){o(Gc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function Yd(n,e){var t=n.config.segment;if(!t)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var o=function(l){var c=function(){return l.anonymousId()||Bt()};i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(_t,"identified")),r()},a=s.user();"then"in a&&rt(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||b.warn("This browser does not have Promise support, and can not use the segment integration");var r=function(s,o){var a;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||i.reset(),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(i.register({distinct_id:s.event.userId}),i.reloadFeatureFlags());var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{});return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return r(s,s.event.event)},page:function(s){return r(s,"$pageview")},identify:function(s){return r(s,"$identify")},screen:function(s){return r(s,"$screen")}}}(n)).then(function(){e()})})}var Zu,ss,tt,Kd=function(){function n(e){J(this,n),this._instance=e}return Y(n,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=(e=m?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var i=t.maxScrollHeight,r=t.lastScrollY,s=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,l=t.maxContentY;return M(i)||M(r)||M(s)||M(o)||M(a)||M(l)?{}:(i=Math.ceil(i),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:i<=1?1:Ur(r/i,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:i<=1?1:Ur(s/i,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Ur(a/o,0,1),$prev_pageview_max_content:l,$prev_pageview_max_content_percentage:o<=1?1:Ur(l/o,0,1)})}}]),n}();function Ur(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(Zu||(Zu={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(ss||(ss={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(tt||(tt={}));var ea=function(){function n(e){J(this,n),this.persistence=e,this.eventRegistry=new Map}return Y(n,[{key:"register",value:function(e){var t=this;e.forEach(function(i){var r,s,o,a,l;(r=i.conditions)!==null&&r!==void 0&&r.events&&(s=i.conditions)!==null&&s!==void 0&&(o=s.events)!==null&&o!==void 0&&o.values&&((a=i.conditions)===null||a===void 0?void 0:a.events.values.length)>0&&t.eventRegistry.set(i.id,(l=i.conditions)===null||l===void 0?void 0:l.events.values.map(function(c){return c.name}))})}},{key:"on",value:function(e,t){var i,r=[],s=((i=this.persistence)===null||i===void 0?void 0:i.props[bo])||[];if(n.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,a=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(a){var l=s.indexOf(a);l>=0&&s.splice(l,1)}}else this.eventRegistry.forEach(function(p,u){p.includes(e)&&r.push(u)});var c=s.concat(r);this._saveSurveysToStorage(c)}},{key:"getSurveys",value:function(){var e,t=(e=this.persistence)===null||e===void 0?void 0:e.props[bo];return t||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.register(y({},bo,kt(new Set(e))))}}]),n}();y(ea,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Xc,se,Jc,un,ec,Yc,ta,Kc,na={},Qc=[],Qd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ha=Array.isArray;function Ht(n,e){for(var t in e)n[t]=e[t];return n}function Zc(n){var e=n.parentNode;e&&e.removeChild(n)}function Ao(n,e,t,i,r){var s={type:n,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++Jc,__i:-1,__u:0};return r==null&&se.vnode!=null&&se.vnode(s),s}function ga(n){return n.children}function Gr(n,e){this.props=n,this.context=e}function Wn(n,e){if(e==null)return n.__?Wn(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Wn(n):null}function ep(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return ep(n)}}function ia(n){(!n.__d&&(n.__d=!0)&&un.push(n)&&!os.__r++||ec!==se.debounceRendering)&&((ec=se.debounceRendering)||Yc)(os)}function os(){var n,e,t,i,r,s,o,a,l;for(un.sort(ta);n=un.shift();)n.__d&&(e=un.length,i=void 0,s=(r=(t=n).__v).__e,a=[],l=[],(o=t.__P)&&((i=Ht({},r)).__v=r.__v+1,se.vnode&&se.vnode(i),ip(o,i,r,t.__n,o.ownerSVGElement!==void 0,32&r.__u?[s]:null,a,s??Wn(r),!!(32&r.__u),l),i.__.__k[i.__i]=i,th(a,i,l),i.__e!=s&&ep(i)),un.length>e&&un.sort(ta));os.__r=0}function tp(n,e,t,i,r,s,o,a,l,c,p){var u,d,f,g,v,_=i&&i.__k||Qc,E=e.length;for(t.__d=l,Zd(t,e,_),l=t.__d,u=0;u<E;u++)(f=t.__k[u])!=null&&typeof f!="boolean"&&typeof f!="function"&&(d=f.__i===-1?na:_[f.__i]||na,f.__i=u,ip(n,f,d,r,s,o,a,l,c,p),g=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&va(d.ref,null,f),p.push(f.ref,f.__c||g,f)),v==null&&g!=null&&(v=g),65536&f.__u||d.__k===f.__k?l=np(f,l,n):typeof f.type=="function"&&f.__d!==void 0?l=f.__d:g&&(l=g.nextSibling),f.__d=void 0,f.__u&=-196609);t.__d=l,t.__e=v}function Zd(n,e,t){var i,r,s,o,a,l=e.length,c=t.length,p=c,u=0;for(n.__k=[],i=0;i<l;i++)(r=n.__k[i]=(r=e[i])==null||typeof r=="boolean"||typeof r=="function"?null:typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?Ao(null,r,null,null,r):ha(r)?Ao(ga,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?Ao(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=n,r.__b=n.__b+1,a=eh(r,t,o=i+u,p),r.__i=a,s=null,a!==-1&&(p--,(s=t[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&u--,typeof r.type!="function"&&(r.__u|=65536)):a!==o&&(a===o+1?u++:a>o?p>l-o?u+=a-o:u--:u=a<o&&a==o-1?a-o:0,a!==i+u&&(r.__u|=65536))):(s=t[i])&&s.key==null&&s.__e&&(s.__e==n.__d&&(n.__d=Wn(s)),ra(s,s,!1),t[i]=null,p--);if(p)for(i=0;i<c;i++)(s=t[i])!=null&&!(131072&s.__u)&&(s.__e==n.__d&&(n.__d=Wn(s)),ra(s,s))}function np(n,e,t){var i,r;if(typeof n.type=="function"){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,e=np(i[r],e,t));return e}return n.__e!=e&&(t.insertBefore(n.__e,e||null),e=n.__e),e&&e.nextSibling}function eh(n,e,t,i){var r=n.key,s=n.type,o=t-1,a=t+1,l=e[t];if(l===null||l&&r==l.key&&s===l.type)return t;if(i>(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a<e.length;){if(o>=0){if((l=e[o])&&!(131072&l.__u)&&r==l.key&&s===l.type)return o;o--}if(a<e.length){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&s===l.type)return a;a++}}return-1}function tc(n,e,t){e[0]==="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||Qd.test(e)?t:t+"px"}function Br(n,e,t,i,r){var s;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof i=="string"&&(n.style.cssText=i=""),i)for(e in i)t&&e in t||tc(n.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||tc(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+s]=t,t?i?t.u=i.u:(t.u=Date.now(),n.addEventListener(e,s?ic:nc,s)):n.removeEventListener(e,s?ic:nc,s);else{if(r)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 n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?n.removeAttribute(e):n.setAttribute(e,t))}}function nc(n){var e=this.l[n.type+!1];if(n.t){if(n.t<=e.u)return}else n.t=Date.now();return e(se.event?se.event(n):n)}function ic(n){return this.l[n.type+!0](se.event?se.event(n):n)}function ip(n,e,t,i,r,s,o,a,l,c){var p,u,d,f,g,v,_,E,S,O,j,U,G,V,C,B=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),s=[a=e.__e=t.__e]),(p=se.__b)&&p(e);e:if(typeof B=="function")try{if(E=e.props,S=(p=B.contextType)&&i[p.__c],O=p?S?S.props.value:p.__:i,t.__c?_=(u=e.__c=t.__c).__=u.__E:("prototype"in B&&B.prototype.render?e.__c=u=new B(E,O):(e.__c=u=new Gr(E,O),u.constructor=B,u.render=ih),S&&S.sub(u),u.props=E,u.state||(u.state={}),u.context=O,u.__n=i,d=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),B.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Ht({},u.__s)),Ht(u.__s,B.getDerivedStateFromProps(E,u.__s))),f=u.props,g=u.state,u.__v=e,d)B.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(B.getDerivedStateFromProps==null&&E!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(E,O),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(E,u.__s,O)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(u.props=E,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(X){X&&(X.__=e)}),j=0;j<u._sb.length;j++)u.__h.push(u._sb[j]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(E,u.__s,O),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,g,v)})}if(u.context=O,u.props=E,u.__P=n,u.__e=!1,U=se.__r,G=0,"prototype"in B&&B.prototype.render){for(u.state=u.__s,u.__d=!1,U&&U(e),p=u.render(u.props,u.state,u.context),V=0;V<u._sb.length;V++)u.__h.push(u._sb[V]);u._sb=[]}else do u.__d=!1,U&&U(e),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++G<25);u.state=u.__s,u.getChildContext!=null&&(i=Ht(Ht({},i),u.getChildContext())),d||u.getSnapshotBeforeUpdate==null||(v=u.getSnapshotBeforeUpdate(f,g)),tp(n,ha(C=p!=null&&p.type===ga&&p.key==null?p.props.children:p)?C:[C],e,t,i,r,s,o,a,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&o.push(u),_&&(u.__E=u.__=null)}catch(X){e.__v=null,l||s!=null?(e.__e=a,e.__u|=l?160:32,s[s.indexOf(a)]=null):(e.__e=t.__e,e.__k=t.__k),se.__e(X,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=nh(t.__e,e,t,i,r,s,o,l,c);(p=se.diffed)&&p(e)}function th(n,e,t){e.__d=void 0;for(var i=0;i<t.length;i++)va(t[i],t[++i],t[++i]);se.__c&&se.__c(e,n),n.some(function(r){try{n=r.__h,r.__h=[],n.some(function(s){s.call(r)})}catch(s){se.__e(s,r.__v)}})}function nh(n,e,t,i,r,s,o,a,l){var c,p,u,d,f,g,v,_=t.props,E=e.props,S=e.type;if(S==="svg"&&(r=!0),s!=null){for(c=0;c<s.length;c++)if((f=s[c])&&"setAttribute"in f==!!S&&(S?f.localName===S:f.nodeType===3)){n=f,s[c]=null;break}}if(n==null){if(S===null)return document.createTextNode(E);n=r?document.createElementNS("http://www.w3.org/2000/svg",S):document.createElement(S,E.is&&E),s=null,a=!1}if(S===null)_===E||a&&n.data===E||(n.data=E);else{if(s=s&&Xc.call(n.childNodes),_=t.props||na,!a&&s!=null)for(_={},c=0;c<n.attributes.length;c++)_[(f=n.attributes[c]).name]=f.value;for(c in _)f=_[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=f:c==="key"||c in E||Br(n,c,null,f,r));for(c in E)f=E[c],c=="children"?d=f:c=="dangerouslySetInnerHTML"?p=f:c=="value"?g=f:c=="checked"?v=f:c==="key"||a&&typeof f!="function"||_[c]===f||Br(n,c,f,_[c],r);if(p)a||u&&(p.__html===u.__html||p.__html===n.innerHTML)||(n.innerHTML=p.__html),e.__k=[];else if(u&&(n.innerHTML=""),tp(n,ha(d)?d:[d],e,t,i,r&&S!=="foreignObject",s,o,s?s[0]:t.__k&&Wn(t,0),a,l),s!=null)for(c=s.length;c--;)s[c]!=null&&Zc(s[c]);a||(c="value",g!==void 0&&(g!==n[c]||S==="progress"&&!g||S==="option"&&g!==_[c])&&Br(n,c,g,_[c],!1),c="checked",v!==void 0&&v!==n[c]&&Br(n,c,v,_[c],!1))}return n}function va(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(i){se.__e(i,t)}}function ra(n,e,t){var i,r;if(se.unmount&&se.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||va(i,null,e)),(i=n.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){se.__e(s,e)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&ra(i[r],e,t||typeof n.type!="function");t||n.__e==null||Zc(n.__e),n.__=n.__e=n.__d=void 0}function ih(n,e,t){return this.constructor(n,t)}Xc=Qc.slice,se={__e:function(n,e,t,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(n)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(n,i||{}),o=r.__d),o)return r.__E=r}catch(a){n=a}throw n}},Jc=0,Gr.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ht({},this.state),typeof n=="function"&&(n=n(Ht({},t),this.props)),n&&Ht(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),ia(this))},Gr.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),ia(this))},Gr.prototype.render=ga,un=[],Yc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ta=function(n,e){return n.__v.__b-e.__v.__b},os.__r=0,Kc=0;var rc=function(n){var e,t,i,r,s,o;return((e=n.conditions)===null||e===void 0||(t=e.events)===null||t===void 0||(i=t.values)===null||i===void 0?void 0:i.length)!=null&&((r=n.conditions)===null||r===void 0||(s=r.events)===null||s===void 0||(o=s.values)===null||o===void 0?void 0:o.length)>0};(function(n,e){var t={__c:e="__cC"+Kc++,__:n,Consumer:function(i,r){return i.children(r)},Provider:function(i){var r,s;return this.getChildContext||(r=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&r.some(function(a){a.__e=!0,ia(a)})},this.sub=function(o){r.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){r.splice(r.indexOf(o),1),a&&a.call(o)}}),i.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:function(){}});var rh={icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!m&&Mu(m.location.href,n)},not_regex:function(n){return!!m&&!Mu(m.location.href,n)},exact:function(n){return m?.location.href===n},is_not:function(n){return m?.location.href!==n}},sh=function(){function n(e){J(this,n),this.instance=e,this._surveyEventReceiver=null}return Y(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=ce?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new ea(this.instance.persistence)),this.instance.requestRouter.loadScript("/static/surveys.js",function(i){if(i)return b.error("Could not load surveys script",i);ce.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new ea(this.instance.persistence));var r=this.instance.get_property(jo);if(r&&!i)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:function(s){var o;if(s.statusCode!==200||!s.json)return e([]);var a=s.json.surveys||[],l=a.filter(function(p){var u,d,f,g,v,_;return((u=p.conditions)===null||u===void 0?void 0:u.events)&&((d=p.conditions)===null||d===void 0||(f=d.events)===null||f===void 0?void 0:f.values)&&((g=p.conditions)===null||g===void 0||(v=g.events)===null||v===void 0||(_=v.values)===null||_===void 0?void 0:_.length)>0});if(l.length>0&&!M(t.instance._addCaptureHook)){var c;(c=t._surveyEventReceiver)===null||c===void 0||c.register(l),t.instance._addCaptureHook(function(p,u){var d;(d=t._surveyEventReceiver)===null||d===void 0||d.on(p,u)})}return(o=t.instance.persistence)===null||o===void 0||o.register(y({},jo,a)),e(a)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(r){var s,o=r.filter(function(c){return!(!c.start_date||c.end_date)}).filter(function(c){var p,u,d,f;if(!c.conditions)return!0;var g=(p=c.conditions)===null||p===void 0||!p.url||rh[(u=(d=c.conditions)===null||d===void 0?void 0:d.urlMatchType)!==null&&u!==void 0?u:"icontains"](c.conditions.url),v=(f=c.conditions)===null||f===void 0||!f.selector||P?.querySelector(c.conditions.selector);return g&&v}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(c){if(!c.linked_flag_key&&!c.targeting_flag_key&&!c.internal_targeting_flag_key)return!0;var p=!c.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(c.linked_flag_key),u=!c.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(c.targeting_flag_key),d=!rc(c)||a?.includes(c.id),f=function(v){var _,E;return!((_=v.conditions)===null||_===void 0||(E=_.events)===null||E===void 0||!E.repeatedActivation||!rc(v))}(c),g=!(c.internal_targeting_flag_key&&!f)||t.instance.featureFlags.isFeatureEnabled(c.internal_targeting_flag_key);return p&&u&&g&&d});return e(l)},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var r,s=e.questions[t],o=t+1;if((r=s.branching)===null||r===void 0||!r.type)return t===e.questions.length-1?tt.End:o;if(s.branching.type===tt.End)return tt.End;if(s.branching.type===tt.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===tt.ResponseBased){if(s.type===ss.SingleChoice){var a,l,c=s.choices.indexOf("".concat(i));if((a=s.branching)!==null&&a!==void 0&&(l=a.responseValues)!==null&&l!==void 0&&l.hasOwnProperty(c)){var p=s.branching.responseValues[c];return Number.isInteger(p)?p:p===tt.End?tt.End:o}}else if(s.type===ss.Rating){var u,d;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var f=function(v,_){if(_===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(_===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(_===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, 10")}(i,s.scale);if((u=s.branching)!==null&&u!==void 0&&(d=u.responseValues)!==null&&d!==void 0&&d.hasOwnProperty(f)){var g=s.branching.responseValues[f];return Number.isInteger(g)?g:g===tt.End?tt.End:o}}return o}return console.warn("Falling back to next question index due to unexpected branching type"),o}}]),n}(),oh=function(){function n(e){var t,i,r=this;J(this,n),y(this,"serverLimits",{}),y(this,"lastEventRateLimited",!1),y(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(a){b.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void b.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:o})}}),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}return Y(n,[{key:"clientRateLimitContext",value:function(){var e,t,i,r=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(Uo))!==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 a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||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=a,(i=this.instance.persistence)===null||i===void 0||i.set_property(Uo,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}]),n}(),ah=function(){return I({initialPathName:Ne?.pathname||"",referringDomain:we.referringDomain()},we.campaignParams())},lh=function(){function n(e,t,i){var r=this;J(this,n),y(this,"_onSessionIdCallback",function(s){var o=r._getStoredProps();if(!o||o.sessionId!==s){var a={sessionId:s,props:r._sessionSourceParamGenerator()};r._persistence.register(y({},qo,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||ah,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return Y(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[qo]}},{key:"getSessionProps",value:function(){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}:{}}}]),n}(),uh=["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","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],sc=function(n,e){if(!n)return!1;var t=n.toLowerCase();return uh.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},rp=function(){function n(){J(this,n),this.clicks=[]}return Y(n,[{key:"isRageClick",value:function(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.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}}]),n}();function oc(n){var e;return n.id===zo||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+zo))}var ch=function(){function n(e){var t;J(this,n),y(this,"rageclicks",new rp),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Mo])}return Y(n,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(b.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return M(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},Mo,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;m&&P&&(wt(P,"click",function(t){return e._onClick(t||m?.event)},!1,!0),wt(P,"mousemove",function(t){return e._onMouseMove(t||m?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,l,c){for(var p=a;p&&!Wt(p,"body");){if(p===c)return!1;if(H(l,m?.getComputedStyle(p).position))return!0;p=Lc(p)}return!1}(e.target,["fixed","sticky"],s);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!oc(e.target)){var i=this._getProperties(e,"click");(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(I(I({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;oc(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(m){var t=m.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),n}(),ph=function(){function n(e){var t=this;J(this,n),y(this,"_updateScrollData",function(){var i,r,s,o;t.context||(t.context={});var a=t.scrollElement(),l=t.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,p=l+(a?.clientHeight||0),u=a?.scrollHeight||0;t.context.lastScrollY=Math.ceil(l),t.context.maxScrollY=Math.max(l,(i=t.context.maxScrollY)!==null&&i!==void 0?i:0),t.context.maxScrollHeight=Math.max(c,(r=t.context.maxScrollHeight)!==null&&r!==void 0?r:0),t.context.lastContentY=p,t.context.maxContentY=Math.max(p,(s=t.context.maxContentY)!==null&&s!==void 0?s:0),t.context.maxContentHeight=Math.max(u,(o=t.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=e}return Y(n,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){m?.addEventListener("scroll",this._updateScrollData,!0),m?.addEventListener("scrollend",this._updateScrollData,!0),m?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return m?.document.documentElement;var e,t=ot(ge(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var i=e.value,r=m?.document.querySelector(i);if(r)return r}}catch(s){t.e(s)}finally{t.f()}}},{key:"scrollY",value:function(){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}},{key:"scrollX",value:function(){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}}]),n}(),fh=function(){function n(){J(this,n),y(this,"events",{}),this.events={}}return Y(n,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(r){return r!==t})}}},{key:"emit",value:function(e,t){var i,r=ot(this.events[e]||[]);try{for(r.s();!(i=r.n()).done;)(0,i.value)(t)}catch(a){r.e(a)}finally{r.f()}var s,o=ot(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),Io="$copy_autocapture";function To(n,e){return e.length>n?e.slice(0,n)+"...":e}var Ut,dh=function(){function n(e){J(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new rp),y(this,"_elementsChainAsString",!1),this.instance=e}return Y(n,[{key:"config",get:function(){var e,t=Fe(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(e=t.url_allowlist)===null||e===void 0?void 0:e.map(function(i){return new RegExp(i)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(m&&P){var t=function(r){r=r||m?.event;try{e._captureEvent(r)}catch(s){b.error("Failed to capture event",s)}},i=function(r){r=r||m?.event,e._captureEvent(r,Io)};wt(P,"submit",t,!1,!0),wt(P,"change",t,!1,!0),wt(P,"click",t,!1,!0),this.config.capture_copied_text&&(wt(P,"copy",i,!1,!0),wt(P,"cut",i,!1,!0))}}else b.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(y({},ku,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[ku],r=this._isDisabledServerSide;if(Et(r)&&!Mn(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}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!pa(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Jo(e))return{};var t={};return Q(e.attributes,function(i){if(i.name&&i.name.indexOf("data-ph-capture-attribute")===0){var r=i.name.replace("data-ph-capture-attribute-",""),s=i.value;r&&s&&Bn(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Xo.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=To(1024,Bu(e)):o.$el_text=To(1024,ts(e)));var a=es(e);a.length>0&&(o.classes=a.filter(function(d){return d!==""}));var l=(r=this.config)===null||r===void 0?void 0:r.element_attribute_ignorelist;Q(e.attributes,function(d){var f;if((!Nc(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(l==null||!l.includes(d.name))&&!t&&Bn(d.value)&&(f=d.name,!Ie(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var g=d.value;d.name==="class"&&(g=ca(g).join(" ")),o["attr__"+d.name]=To(1024,g)}});for(var c=1,p=1,u=e;u=this._previousElementSibling(u);)c++,u.tagName===e.tagName&&p++;return o.nth_child=c,o.nth_of_type=p,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return M(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);Dc(s)&&(s=s.parentNode||null),i==="$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 o=i===Io;if(s&&hd(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,c=[s],p=s;p.parentNode&&!Wt(p,"body");)Mc(p.parentNode)?(c.push(p.parentNode.host),p=p.parentNode.host):(c.push(p.parentNode),p=p.parentNode);var u,d,f=[],g={},v=!1;if(Q(c,function(C){var B=Jo(C);C.tagName.toLowerCase()==="a"&&(u=C.getAttribute("href"),u=B&&Bn(u)&&u),H(es(C),"ph-no-capture")&&(v=!0),f.push(t._getPropertiesFromElement(C,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var X=t._getAugmentPropertiesFromElement(C);Oe(g,X)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?f[0].$el_text=Bu(s):f[0].$el_text=ts(s)),u){var _,E;f[0].attr__href=u;var S=(_=Pi(u))===null||_===void 0?void 0:_.host,O=m==null||(E=m.location)===null||E===void 0?void 0:E.host;S&&O&&S!==O&&(d=u)}if(v)return!1;var j=Oe(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:_d(f)}:{$elements:f},(a=f[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=f[0])===null||l===void 0?void 0:l.$el_text}:{},d&&e.type==="click"?{$external_click_url:d}:{},g);if(i===Io){var U,G=Fc(m==null||(U=m.getSelection())===null||U===void 0?void 0:U.toString()),V=e.type||"clipboard";if(!G)return!1;j.$selected_content=G,j.$copy_type=V}return this.instance.capture(i,j),!0}}}},{key:"isBrowserSupported",value:function(){return rt(P?.querySelectorAll)}}]),n}(),hh=function(){function n(e){var t=this;J(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){M(t._restoreXHRPatch)&&ce.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),M(t._restoreFetchPatch)&&ce.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return Y(n,[{key:"_loadScript",value:function(e){ce.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(ct.LIB_VERSION),function(t){t&&b.error("[TRACING-HEADERS] failed to load script",t),e()})}},{key:"startIfEnabledOrStop",value:function(){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)}}]),n}();(function(n){n[n.PENDING=-1]="PENDING",n[n.DENIED=0]="DENIED",n[n.GRANTED=1]="GRANTED"})(Ut||(Ut={}));var gh=function(){function n(e){J(this,n),this.instance=e}return Y(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Ut.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Ut.DENIED||this.consent===Ut.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return e==="1"?Ut.GRANTED:e==="0"?Ut.DENIED:Ut.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?he:St;var t=e==="localStorage"?St:he;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}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!vc([xt?.doNotTrack,xt?.msDoNotTrack,ce.doNotTrack],function(e){return H([!0,1,"1","yes"],e)})}}]),n}(),ac="/e/",Hr="[Exception Capture]",vh=function(){function n(e){var t,i=this;J(this,n),y(this,"_endpoint",ac),y(this,"originalOnUnhandledRejectionHandler",void 0),y(this,"startCapturing",function(){var r;if(m&&i.isEnabled&&!i.hasHandlers&&((r=m.onerror)===null||r===void 0||!r.__POSTHOG_INSTRUMENTED__)){var s=m.posthogErrorWrappingFunctions.wrapOnError,o=m.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(s&&o)try{i.unwrapOnError=s(i.captureException.bind(i)),i.unwrapUnhandledRejection=o(i.captureException.bind(i))}catch(a){b.error(Hr+" failed to start",a),i.stopCapturing()}else b.error(Hr+" failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[Su]),this.startIfEnabled()}return Y(n,[{key:"isEnabled",get:function(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}},{key:"isCapturing",get:function(){var e;return!(m==null||(e=m.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(b.info(Hr+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js?v=".concat(ct.LIB_VERSION)),function(t){t&&b.error(Hr+" failed to load script",t),e()})}},{key:"stopCapturing",value:function(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this._endpoint=Fe(t)&&t.endpoint||ac,this.instance.persistence&&(this.instance.persistence.register(y({},Su,this.remoteEnabled)),this.instance.persistence.register(y({},"$exception_capture_endpoint",this._endpoint))),this.startIfEnabled()}},{key:"captureException",value:function(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.sendExceptionEvent(e)}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0,_url:this._endpoint})}}]),n}(),Ci="[Web Vitals]",mh=function(){function n(e){var t,i=this;J(this,n),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),y(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),y(this,"_flushToCapture",function(){clearTimeout(i._delayedFlushTimer),i.buffer.metrics.length!==0&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce(function(r,s){var o;return I(I({},r),{},(y(o={},"$web_vitals_".concat(s.name,"_event"),I({},s)),y(o,"$web_vitals_".concat(s.name,"_value"),s.value),o))},{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),y(this,"_addToBuffer",function(r){var s,o=(s=i.instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0);if(M(o))b.error(Ci+"Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{};var a=i._currentURL();M(a)||(st(r?.name)||st(r?.value)?b.error(Ci+"Invalid metric received",r):(i.buffer.url!==a&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,8e3)),M(i.buffer.url)&&(i.buffer.url=a),i.buffer.firstMetricTimestamp=M(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,i.buffer.metrics.push(I(I({},r),{},{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),i.buffer.metrics.length===4&&i._flushToCapture()))}}),y(this,"_startCapturing",function(){var r=ce.postHogWebVitalsCallbacks,s=r.onLCP,o=r.onCLS,a=r.onFCP,l=r.onINP;s(i._addToBuffer),o(i._addToBuffer),a(i._addToBuffer),l(i._addToBuffer),i._initialized=!0}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Eu]),this.startIfEnabled()}return Y(n,[{key:"isEnabled",get:function(){var e=Fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Mn(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(b.info(Ci+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=Fe(e.capturePerformance)&&!!e.capturePerformance.web_vitals;this.instance.persistence&&this.instance.persistence.register(y({},Eu,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){m.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/web-vitals.js?v=".concat(ct.LIB_VERSION)),function(t){t&&b.error(Ci+" failed to load script",t),e()})}},{key:"_currentURL",value:function(){var e=m?m.location.href:void 0;return e||b.error(Ci+"Could not determine current URL"),e}}]),n}(),Di={},lc=function(){},Dn="posthog",sp=!Hd&&le?.indexOf("MSIE")===-1&&le?.indexOf("Mozilla")===-1,uc=function(){var n,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=P?.location,t=e?.hostname,!!Ie(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:lc,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Ne&&Ie(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_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(m==null||(n=m.location)===null||n===void 0?void 0:n.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:function(i){var r="Bad HTTP status: "+i.statusCode+" "+i.text;b.error(r)},get_device_id:function(i){return i},_onCapture:lc,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},cc=function(n){var e={};M(n.process_person)||(e.person_profiles=n.process_person),M(n.xhr_headers)||(e.request_headers=n.xhr_headers),M(n.cookie_name)||(e.persistence_name=n.cookie_name),M(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Oe({},e,n);return ge(n.property_blacklist)&&(M(n.property_denylist)?t.property_denylist=n.property_blacklist:ge(n.property_denylist)?t.property_denylist=[].concat(kt(n.property_blacklist),kt(n.property_denylist)):b.error("Invalid value for property_denylist config: "+n.property_denylist)),t},yh=function(){function n(){J(this,n),y(this,"__forceAllowLocalhost",!1)}return Y(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){b.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),op=function(){function n(){var e=this;J(this,n),y(this,"webPerformance",new yh),y(this,"_internalEventEmitter",new fh),this.config=uc(),this.decideEndpointWasHit=!1,this.SentryIntegration=Jd,this.sentryIntegration=function(t){return function(i,r){var s=Gc(i,r);return{name:Vc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new Hf(this),this.toolbar=new Pd(this),this.scrollManager=new ph(this),this.pageViewManager=new Kd(this),this.surveys=new sh(this),this.rateLimiter=new oh(this),this.requestRouter=new Xd(this),this.consent=new gh(this),this.people={set:function(t,i,r){var s=Ie(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Ie(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return b.info("send",t)})}return Y(n,[{key:"init",value:function(e,t,i){if(i&&i!==Dn){var r,s=(r=Di[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),Di[i]=s,Di[Dn][i]=s,s}return this._init(e,t,i)}},{key:"_init",value:function(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(M(e)||mu(e))return b.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return b.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Oe({},uc(),cc(s),{name:o,token:e})),this.compression=s.disable_compression?void 0:it.Base64,this.persistence=new So(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new So(I(I({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new Od(function(_){return r._send_retriable_request(_)}),this._retryQueue=new Vd(this),this.__request_queue=[],this.sessionManager=new Gd(this.config,this.persistence),this.sessionPropsManager=new lh(this.sessionManager,this.persistence),new hh(this).startIfEnabledOrStop(),this.sessionRecording=new Id(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new dh(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ch(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new mh(this),this.exceptionObserver=new vh(this),this.exceptionObserver.startIfEnabled(),ct.DEBUG=ct.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,l,c=this.config.get_device_id(Bt()),p=(a=s.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?c:s.bootstrap.distinctID;this.persistence.set_property(_t,(l=s.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var u,d,f=Object.keys(((u=s.bootstrap)===null||u===void 0?void 0:u.featureFlags)||{}).filter(function(_){var E,S;return!((E=s.bootstrap)===null||E===void 0||(S=E.featureFlags)===null||S===void 0||!S[_])}).reduce(function(_,E){var S,O;return _[E]=((S=s.bootstrap)===null||S===void 0||(O=S.featureFlags)===null||O===void 0?void 0:O[E])||!1,_},{}),g=Object.keys(((d=s.bootstrap)===null||d===void 0?void 0:d.featureFlagPayloads)||{}).filter(function(_){return f[_]}).reduce(function(_,E){var S,O,j,U;return(S=s.bootstrap)!==null&&S!==void 0&&(O=S.featureFlagPayloads)!==null&&O!==void 0&&O[E]&&(_[E]=(j=s.bootstrap)===null||j===void 0||(U=j.featureFlagPayloads)===null||U===void 0?void 0:U[E]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:g})}if(!this.get_distinct_id()){var v=this.config.get_device_id(Bt());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(_t,"anonymous")}return m==null||(i=m.addEventListener)===null||i===void 0||i.call(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?Yd(this,function(){return r._loaded()}):this._loaded(),rt(this.config._onCapture)&&this.on("eventCaptured",function(_){return r.config._onCapture(_.event,_)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o,a,l;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=H(e.supportedCompression,it.GZipJS)?it.GZipJS:H(e.supportedCompression,it.Base64)?it.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(i=this.sessionRecording)===null||i===void 0||i.afterDecideResponse(e),(r=this.autocapture)===null||r===void 0||r.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.afterDecideResponse(e),(l=this.exceptionObserver)===null||l===void 0||l.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(i){b.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){P&&e.capture("$pageview",{title:P.title},{send_instantly:!0})},1),t||(new Td(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||jn(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){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"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(sp?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=rs(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=I({},i);a.timeout=a.timeout||6e4,a.url=rs(a.url,{_:new Date().getTime().toString(),ver:ct.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",c=(s=(o=vc(Fi,function(p){return p.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Fi[0].method;if(!c)throw new Error("No available transport method");c(a)}(I(I({},e),{},{callback:function(i){var r,s,o;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&((s=(o=t.config).on_request_error)===null||s===void 0||s.call(o,i)),(r=e.callback)===null||r===void 0||r.call(e,i)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,i=this,r=[],s=[],o=[];jn(e,function(l){l&&(t=l[0],ge(t)?o.push(l):rt(l)?l.call(i):ge(l)&&t==="alias"?r.push(l):ge(l)&&t.indexOf("capture")!==-1&&rt(i[t])?o.push(l):s.push(l))});var a=function(l,c){jn(l,function(p){if(ge(p[0])){var u=c;Q(p,function(d){u=u[d[0]].apply(u,d.slice(1))})}else this[p[0]].apply(this,p.slice(1))},c)};a(r,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){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}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,i){var r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return b.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!M(e)&&Ie(e)){if(!le||this.config.opt_out_useragent_filter||!sc(le,this.config.custom_blocked_useragents)){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={uuid:Bt(),event:e,properties:this._calculate_event_properties(e,t||{},i)};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(o.$set=i?.$set);var a=this._calculate_set_once_properties(i?.$set_once);a&&(o.$set_once=a),(o=qf(o,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i?.timestamp||new Date,M(i?.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var l=I(I({},o.properties.$set),o.$set);_o(l)||this.setPersonPropertiesForFlags(l),this._internalEventEmitter.emit("eventCaptured",o);var c={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,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(c):this._requestQueue.enqueue(c),o}b.critical("This capture call is ignored due to client rate limiting.")}}else b.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=I({},t);if(s.token=this.config.token,e==="$snapshot"){var o=I(I({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ie(s.distinct_id)&&!nt(s.distinct_id)||mu(s.distinct_id))&&b.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var a=we.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),c=l.sessionId,p=l.windowId;s.$session_id=c,s.$window_id=p}if(this.requestRouter.region===cn.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 u=this.sessionPropsManager.getSessionProps();s=Oe(s,u)}if(!this.config.disable_scroll_properties){var d={};e==="$pageview"?d=this.pageViewManager.doPageView():e==="$pageleave"&&(d=this.pageViewManager.doPageLeave()),s=Oe(s,d)}if(e==="$pageview"&&P&&(s.title=P.title),!M(r)){var f=new Date().getTime()-r;s.$duration=parseFloat((f/1e3).toFixed(3))}if(le&&this.config.opt_out_useragent_filter&&(s.$browser_type=sc(le,this.config.custom_blocked_useragents)?"bot":"browser"),(s=Oe({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),i==null||!i._noHeatmaps){var g,v=(g=this.heatmaps)===null||g===void 0?void 0:g.getAndClearBuffer();v&&(s.$heatmap_data=v)}ge(this.config.property_denylist)?Q(this.config.property_denylist,function(E){delete s[E]}):b.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;return _&&(s=_(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Oe({},this.persistence.get_initial_props(),e||{});return _o(t)?void 0:t}},{key:"register",value:function(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,t,i)}},{key:"register_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}},{key:"unregister",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(y({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return b.uninitializedWarning("posthog.identify");if(nt(e)&&(e=e.toString(),b.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))b.critical('The string "'.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 r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(Ai)&&(this.unregister(Ai),this.register({distinct_id:e}));var o=(this.persistence.get_property(_t)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(_t,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Yr))}}else b.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:I(I({},r),{},y({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(y({},e,i))),r[e]===t||i||this.reloadFeatureFlags()}}else b.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,i,r,s;if(!this.__loaded)return b.uninitializedWarning("posthog.reset");var o=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(),(r=this.persistence)===null||r===void 0||r.set_property(_t,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(Bt());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionId,r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(e!=null&&e.withTimestamp&&r){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);s+="?t=".concat(l)}return s}},{key:"alias",value:function(e,t){return e===this.get_property(mc)?(b.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(M(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ai,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(b.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,i,r,s,o=I({},this.config);Fe(e)&&(Oe(this.config,cc(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new So(I(I({},this.config),{},{persistence:"sessionStorage"})),he.is_supported()&&he.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(ct.DEBUG=!0),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(e!=null&&e.sampling){var t,i,r=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId();(i=this.persistence)===null||i===void 0||i.register(y({},Ri,!0)),b.info("Session recording started with sampling override for session: ",r?.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Dn;return t!==Dn&&(t=Dn+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(_t))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(_t))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&_o(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[Ai])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[Kr]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(b.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Kr,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,r,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==a&&((i=this.persistence)===null||i===void 0||i.set_disabled(a)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(M(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(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}))}}]),n}();(function(n,e){for(var t=0;t<e.length;t++)n.prototype[e[t]]=jf(n.prototype[e[t]])})(op,["identify"]);var pc,ap=(pc=Di[Dn]=new op,function(){function n(){n.done||(n.done=!0,sp=!1,Q(Di,function(e){e._dom_loaded()}))}P!=null&&P.addEventListener&&(P.readyState==="complete"?n():P.addEventListener("DOMContentLoaded",n,!1)),m&&wt(m,"load",n,!0)}(),pc);var lp=ap.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 pe(n,e){if(!lp)throw new Error("Failed to initialize PostHog");lp.capture(n,e)}var cs,Bi,ps,Vt,cp,us,fs=class fs extends W(q){constructor(){super();w(this,Vt);w(this,cs,new Nt(this,{onError:console.error}));w(this,Bi);w(this,ps,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),pe("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>pe("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>pe("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>pe("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>pe("ShopAssistant: user clicked link",t),onUserSentInput:t=>pe("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return h(this,Bi)||h(this,cs).data}render(){return this.config?D`
320
+ `)).length,r=0;r<i;r++){var o=n.charCodeAt(r),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),$t(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},xt=function(){function n(e){return e&&(e.preventDefault=n.preventDefault,e.stopPropagation=n.stopPropagation),e}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,r,s){if(e)if(e.addEventListener&&!r)e.addEventListener(t,i,!!s);else{var o="on"+t,a=e[o];e[o]=function(l,c,p){return function(u){if(u=u||n(m?.event)){var d,f=!0;rt(p)&&(d=p(u));var g=c.call(l,u);return d!==!1&&g!==!1||(f=!1),f}}}(e,i,a)}else b.error("No valid element provided to register_event")}}();function yc(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return n[t]}(function(n){n.GZipJS="gzip-js",n.Base64="base64"})(it||(it={}));var _c="$people_distinct_id",Ti="__alias",Ri="__timers",Eu="$autocapture_disabled_server_side",No="$heatmaps_enabled_server_side",$u="$exception_capture_enabled_server_side",Cu="$web_vitals_enabled_server_side",jo="$session_recording_enabled_server_side",Au="$console_log_recording_enabled_server_side",Iu="$session_recording_network_payload_capture",Tu="$session_recording_canvas_recording",Ru="$replay_sample_rate",Pu="$replay_minimum_duration",ts="$sesid",Oi="$session_is_sampled",Nn="$enabled_feature_flags",qo="$early_access_features",jn="$stored_person_properties",Ut="$stored_group_properties",Uo="$surveys",xo="$surveys_activated",ns="$flag_call_reported",bt="$user_state",Bo="$client_session_props",Ho="$capture_rate_limit",zo="$initial_campaign_params",Wo="$initial_referrer_info",Ou="$initial_person_info",is="$epp",Vo="__POSTHOG_TOOLBAR__",Hf=[_c,Ti,"__cmpns",Ri,jo,No,ts,Nn,bt,qo,Ut,jn,Uo,ns,Bo,Ho,zo,Wo,is],ko="$active_feature_flags",Ur="$override_feature_flags",Fu="$feature_flag_payloads",Du=function(n){var e,t={},i=ot(Yr(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Pe(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},zf=function(){function n(e){J(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Y(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Nn),t=this.instance.get_property(Ur);if(!t)return e||{};for(var i=Oe({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(b.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Fu)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,i=this.instance.get_property(jn),r=this.instance.get_property(Ut),s={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,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:s,compression:this.instance.config.disable_compression?void 0:it.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var a;e.setReloadingPaused(!1);var l=!0;o.statusCode===200&&(e.$anon_distinct_id=void 0,l=!1),e.receivedFeatureFlags((a=o.json)!==null&&a!==void 0?a:{},l),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,r=this.getFlagVariants()[e],s="".concat(r),o=this.instance.get_property(ns)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(me(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(y({},ns,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}b.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(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);b.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();(function(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},p=s.featureFlags,u=s.featureFlagPayloads;if(p)if(me(p)){var d,f={};if(p)for(var g=0;g<p.length;g++)f[p[g]]=!0;o&&o.register((y(d={},ko,p),y(d,Nn,f),d))}else{var v=p,_=u;s.errorsWhileComputingFlags&&(v=I(I({},l),v),_=I(I({},c),_)),o&&o.register((y(a={},ko,Object.keys(Du(v))),y(a,Nn,v||{}),y(a,Fu,_||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return b.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Ur);else if(me(e)){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register(y({},Ur,t))}else this.instance.persistence.register(y({},Ur,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),r=i.flags,s=i.flagVariants;e(r,s)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,r,s=y({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=I(I({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},ko,Object.keys(Du(o))),y(r,Nn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(qo);if(r&&!i)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:function(s){var o;if(s.json){var a=s.json.earlyAccessFeatures;return(o=t.instance.persistence)===null||o===void 0||o.register(y({},qo,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(i){return t[i]}),flagVariants:Object.keys(t).filter(function(i){return t[i]}).reduce(function(i,r){return i[r]=t[r],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(i,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(jn)||{};this.instance.register(y({},jn,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(jn)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Ut)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=I(I({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},Ut,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Ut)||{};this.instance.register(y({},Ut,I(I({},t),{},y({},e,{}))))}else this.instance.unregister(Ut)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return nt(n)&&isFinite(n)&&Math.floor(n)===n});var Mu="0123456789abcdef",Wf=function(){function n(e){if(J(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return Y(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Mu.charAt(this.bytes[t]>>>4)+Mu.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}},{key:"clone",value:function(){return new n(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(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}}],[{key:"fromFieldsV7",value:function(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var 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]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new n(s)}}]),n}(),Vf=function(){function n(){J(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new Gf)}return Y(n,[{key:"generate",value:function(){var e=this.generateOrAbort();if(M(e)){this.timestamp=0;var t=this.generateOrAbort();if(M(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){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 Wf.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),n}(),bc=function(n){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<n.length;e++)n[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};m&&!M(m.crypto)&&crypto.getRandomValues&&(bc=function(n){return crypto.getRandomValues(n)});var Lu,Gf=function(){function n(){J(this,n),y(this,"buffer",new Uint32Array(8)),y(this,"cursor",1/0)}return Y(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(bc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),Ht=function(){return Xf().toString()},Xf=function(){return(Lu||(Lu=new Vf)).generate()},Jf="Thu, 01 Jan 1970 00:00:00 GMT",$i="",Yf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Kf(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P;if($i)return $i;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Ht(),c=new RegExp("(^|;)\\s*"+l+"=1");!$i&&a--;){var p=o.slice(a).join("."),u=l+"=1;domain=."+p;s.cookie=u,c.test(s.cookie)&&(s.cookie=u+";expires="+Jf,$i=p)}return $i}(n);if(!t){var i=function(r){var s=r.match(Yf);return s?s[0]:""}(n);i!==t&&b.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var Se,Et={is_supported:function(){return!!P},error:function(n){b.error("cookieStore error: "+n)},get:function(n){if(P){try{for(var e=n+"=",t=P.cookie.split(";").filter(function(s){return s.length}),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},parse:function(n){var e;try{e=JSON.parse(Et.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(P)try{var s="",o="",a=Kf(P.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),s="; expires="+l.toUTCString()}r&&(o="; secure");var c=n+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&b.warn("cookieStore warning: large cookie, len="+c.length),P.cookie=c,c}catch{return}},remove:function(n,e){try{Et.set(n,"",-1,e)}catch{return}}},So=null,ve={is_supported:function(){if(!$t(So))return So;var n=!0;if(M(m))n=!1;else try{var e="__mplssupport__";ve.set(e,"xyz"),ve.get(e)!=='"xyz"'&&(n=!1),ve.remove(e)}catch{n=!1}return n||b.error("localStorage unsupported; falling back to cookie store"),So=n,n},error:function(n){b.error("localStorage error: "+n)},get:function(n){try{return m?.localStorage.getItem(n)}catch(e){ve.error(e)}return null},parse:function(n){try{return JSON.parse(ve.get(n))||{}}catch{}return null},set:function(n,e){try{m?.localStorage.setItem(n,JSON.stringify(e))}catch(t){ve.error(t)}},remove:function(n){try{m?.localStorage.removeItem(n)}catch(e){ve.error(e)}}},Qf=["distinct_id",ts,Oi,is],Br=I(I({},ve),{},{parse:function(n){try{var e={};try{e=Et.parse(n)||{}}catch{}var t=Oe(e,JSON.parse(ve.get(n)||"{}"));return ve.set(n,t),t}catch{}return null},set:function(n,e,t,i,r){try{ve.set(n,e);var s={};Qf.forEach(function(o){e[o]&&(s[o]=e[o])}),Object.keys(s).length&&Et.set(n,s,t,i,r)}catch(o){ve.error(o)}},remove:function(n,e){try{m?.localStorage.removeItem(n),Et.remove(n,e)}catch(t){ve.error(t)}}}),Hr={},Zf={is_supported:function(){return!0},error:function(n){b.error("memoryStorage error: "+n)},get:function(n){return Hr[n]||null},parse:function(n){return Hr[n]||null},set:function(n,e){Hr[n]=e},remove:function(n){delete Hr[n]}},un=null,Ee={is_supported:function(){if(!$t(un))return un;if(un=!0,M(m))un=!1;else try{var n="__support__";Ee.set(n,"xyz"),Ee.get(n)!=='"xyz"'&&(un=!1),Ee.remove(n)}catch{un=!1}return un},error:function(n){b.error("sessionStorage error: ",n)},get:function(n){try{return m?.sessionStorage.getItem(n)}catch(e){Ee.error(e)}return null},parse:function(n){try{return JSON.parse(Ee.get(n))||null}catch{}return null},set:function(n,e){try{m?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){Ee.error(t)}},remove:function(n){try{m?.sessionStorage.removeItem(n)}catch(e){Ee.error(e)}}},ed=["localhost","127.0.0.1"],Fi=function(n){var e=P?.createElement("a");return M(e)?null:(e.href=n,e)},Nu=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},td=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Q(n,function(s,o){M(s)||M(o)||o==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(s)?s.name:s.toString()),t=encodeURIComponent(o),r[r.length]=t+"="+e)}),r.join(i)},ju=function(n,e){for(var t,i=((n.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){t=s;break}}if(!me(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{b.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},rs=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Ye="Mobile",ss="iOS",pt="Android",ji="Tablet",wc=pt+" "+ji,xc="iPad",kc="Apple",Sc=kc+" Watch",qi="Safari",zn="BlackBerry",Ec="Samsung",$c=Ec+"Browser",Cc=Ec+" Internet",Wt="Chrome",nd=Wt+" OS",Ac=Wt+" "+ss,la="Internet Explorer",Ic=la+" "+Ye,ua="Opera",id=ua+" Mini",ca="Edge",Tc="Microsoft "+ca,Un="Firefox",Rc=Un+" "+ss,Ui="Nintendo",Bi="PlayStation",Bn="Xbox",Pc=pt+" "+Ye,Oc=Ye+" "+qi,Pi="Windows",Go=Pi+" Phone",qu="Nokia",Xo="Ouya",Fc="Generic",rd=Fc+" "+Ye.toLowerCase(),Dc=Fc+" "+ji.toLowerCase(),Jo="Konqueror",Re="(\\d+(\\.\\d+)?)",Eo=new RegExp("Version/"+Re),sd=new RegExp(Bn,"i"),od=new RegExp(Bi+" \\w+","i"),ad=new RegExp(Ui+" \\w+","i"),pa=new RegExp(zn+"|PlayBook|BB10","i"),ld={"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"},ud=function(n,e){return e&&H(e,kc)||function(t){return H(t,qi)&&!H(t,Wt)&&!H(t,pt)}(n)},Uu=function(n,e){return e=e||"",H(n," OPR/")&&H(n,"Mini")?id:H(n," OPR/")?ua:pa.test(n)?zn:H(n,"IE"+Ye)||H(n,"WPDesktop")?Ic:H(n,$c)?Cc:H(n,ca)||H(n,"Edg/")?Tc:H(n,"FBIOS")?"Facebook "+Ye:H(n,"UCWEB")||H(n,"UCBrowser")?"UC Browser":H(n,"CriOS")?Ac:H(n,"CrMo")?Wt:H(n,pt)&&H(n,qi)?Pc:H(n,Wt)?Wt:H(n,"FxiOS")?Rc:H(n.toLowerCase(),Jo.toLowerCase())?Jo:ud(n,e)?H(n,Ye)?Oc:qi:H(n,Un)?Un:H(n,"MSIE")||H(n,"Trident/")?la:H(n,"Gecko")?Un:""},cd=(y(Se={},Ic,[new RegExp("rv:"+Re)]),y(Se,Tc,[new RegExp(ca+"?\\/"+Re)]),y(Se,Wt,[new RegExp("("+Wt+"|CrMo)\\/"+Re)]),y(Se,Ac,[new RegExp("CriOS\\/"+Re)]),y(Se,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Re)]),y(Se,qi,[Eo]),y(Se,Oc,[Eo]),y(Se,ua,[new RegExp("(Opera|OPR)\\/"+Re)]),y(Se,Un,[new RegExp(Un+"\\/"+Re)]),y(Se,Rc,[new RegExp("FxiOS\\/"+Re)]),y(Se,Jo,[new RegExp("Konqueror[:/]?"+Re,"i")]),y(Se,zn,[new RegExp(zn+" "+Re),Eo]),y(Se,Pc,[new RegExp("android\\s"+Re,"i")]),y(Se,Cc,[new RegExp($c+"\\/"+Re)]),y(Se,la,[new RegExp("(rv:|MSIE )"+Re)]),y(Se,"Mozilla",[new RegExp("rv:"+Re)]),Se),Bu=[[new RegExp(Bn+"; "+Bn+" (.*?)[);]","i"),function(n){return[Bn,n&&n[1]||""]}],[new RegExp(Ui,"i"),[Ui,""]],[new RegExp(Bi,"i"),[Bi,""]],[pa,[zn,""]],[new RegExp(Pi,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Go,""];if(new RegExp(Ye).test(e)&&!/IEMobile\b/.test(e))return[Pi+" "+Ye,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=ld[i]||"";return/arm/i.test(e)&&(r="RT"),[Pi,r]}return[Pi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[ss,e.join(".")]}return[ss,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=M(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+pt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+pt+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[pt,e.join(".")]}return[pt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(n){var e=["Mac OS X",""];if(n&&n[1]){var t=[n[1],n[2],n[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[nd,""]],[/Linux|debian/i,["Linux",""]]],Hu=function(n){return ad.test(n)?Ui:od.test(n)?Bi:sd.test(n)?Bn:new RegExp(Xo,"i").test(n)?Xo:new RegExp("("+Go+"|WPDesktop)","i").test(n)?Go:/iPad/.test(n)?xc:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?Sc:pa.test(n)?zn:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(qu,"i").test(n)?qu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(Ye).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?pt:wc:pt:new RegExp("(pda|"+Ye+")","i").test(n)?rd:new RegExp(ji,"i").test(n)&&!new RegExp(ji+" pc","i").test(n)?Dc:""},zr="https?://(.*)",pd=["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"],xe={campaignParams:function(n){return P?this._campaignParamsFromUrl(P.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=pd.concat(e||[]),i={};return Q(t,function(r){var s=ju(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(zr+"google.([^/?]*)")===0?"google":n.search(zr+"bing.com")===0?"bing":n.search(zr+"yahoo.com")===0?"yahoo":n.search(zr+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=xe._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!$t(e)){i.$search_engine=e;var r=P?ju(P.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=P?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:Uu,browserVersion:function(n,e){var t=Uu(n,e),i=cd[t];if(M(i))return null;for(var r=0;r<i.length;r++){var s=i[r],o=n.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(var e=0;e<Bu.length;e++){var t=Pe(Bu[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(rt(r)?r(s,n):r);if(o)return o}return["",""]},device:Hu,deviceType:function(n){var e=Hu(n);return e===xc||e===wc||e==="Kobo"||e==="Kindle Fire"||e===Dc?ji:e===Ui||e===Bn||e===Bi||e===Xo?"Console":e===Sc?"Wearable":e?Ye:"Desktop"},referrer:function(){return P?.referrer||"$direct"},referringDomain:function(){var n;return P!=null&&P.referrer&&((n=Fi(P.referrer))===null||n===void 0?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:Ne?.href}},initialPersonPropsFromInfo:function(n){var e,t=n.r,i=n.u,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Fi(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=Fi(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,Q(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+Lo(a)]=o})}return t&&Q(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+Lo(a)]=o}),r},properties:function(){if(!le)return{};var n=Pe(xe.os(le),2),e=n[0],t=n[1];return Oe(Mo({$os:e,$os_version:t,$browser:xe.browser(le,navigator.vendor),$device:xe.device(le),$device_type:xe.deviceType(le)}),{$current_url:Ne?.href,$host:Ne?.host,$pathname:Ne?.pathname,$raw_user_agent:le.length>1e3?le.substring(0,997)+"...":le,$browser_version:xe.browserVersion(le,navigator.vendor),$browser_language:xe.browserLanguage(),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:"web",$lib_version:ct.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:mc()/1e3})},people_properties:function(){if(!le)return{};var n=Pe(xe.os(le),2),e=n[0],t=n[1];return Oe(Mo({$os:e,$os_version:t,$browser:xe.browser(le,navigator.vendor)}),{$browser_version:xe.browserVersion(le,navigator.vendor)})}},fd=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],$o=function(){function n(e){J(this,n),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(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(),this.update_config(e,e),this.save()}return Y(n,[{key:"buildStorage",value:function(e){fd.indexOf(e.persistence.toLowerCase())===-1&&(b.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&ve.is_supported()?ve:t==="localstorage+cookie"&&Br.is_supported()?Br:t==="sessionstorage"&&Ee.is_supported()?Ee:t==="memory"?Zf:t==="cookie"?Et:Br.is_supported()?Br:Et}},{key:"properties",value:function(){var e={};return Q(this.props,function(t,i){if(i===Nn&&Fe(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else a=i,l=!1,($t(o=Hf)?l:wu&&o.indexOf===wu?o.indexOf(a)!=-1:(Q(o,function(c){if(l||(l=c===a))return es}),l))||(e[i]=t);var o,a,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Oe({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,i){var r=this;if(Fe(e)){M(t)&&(t="None"),this.expire_days=M(i)?this.default_expiry:i;var s=!1;if(Q(e,function(o,a){r.props.hasOwnProperty(a)&&r.props[a]!==t||(r.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(Fe(e)){this.expire_days=M(t)?this.default_expiry:t;var r=!1;if(Q(e,function(s,o){e.hasOwnProperty(o)&&i.props[o]!==s&&(i.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(xe.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(xe.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(xe.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[zo]||this.props[Wo]||this.register_once(y({},Ou,xe.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Mo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Q([Wo,zo],function(s){var o=e.props[s];o&&Q(o,function(a,l){t["$initial_"+Lo(l)]=a})});var i=this.props[Ou];if(i){var r=xe.initialPersonPropsFromInfo(i);Oe(t,r)}return t}},{key:"safe_merge",value:function(e){return Q(this.props,function(t,i){i in e||(e[i]=t)}),e}},{key:"update_config",value:function(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),r=this.props;this.clear(),this.storage=i,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var i=this.props[Ri]||{};i[e]=t,this.props[Ri]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Ri]||{})[e];return M(t)||(delete this.props[Ri][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),n}(),dd=2,hd=4,Kr=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(Kr||{}),_t=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(_t||{});function fa(n){return n?hs(n).split(/\s+/):[]}function os(n){var e="";switch(Ni(n.className)){case"string":e=n.className;break;case"object":e=("baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return fa(e)}function Mc(n){return st(n)?null:hs(n).split(/(\s+)/).filter(function(e){return Hn(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function as(n){var e="";return Ko(n)&&!qc(n)&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;Lc(t)&&t.textContent&&(e+=(i=Mc(t.textContent))!==null&&i!==void 0?i:"")}),hs(e)}function da(n){return!!n&&n.nodeType===1}function Vt(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function Lc(n){return!!n&&n.nodeType===3}function Nc(n){return!!n&&n.nodeType===11}var Yo=["a","button","form","input","select","textarea","label"];function jc(n){var e=n.parentNode;return!(!e||!da(e))&&e}function gd(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!m||!n||Vt(n,"html")||!da(n))return!1;if(t!=null&&t.url_allowlist){var s=m.location.href,o=t.url_allowlist;if(o&&!o.some(function(v){return s.match(v)}))return!1}if(t!=null&&t.dom_event_allowlist){var a=t.dom_event_allowlist;if(a&&!a.some(function(v){return e.type===v}))return!1}for(var l=!1,c=[n],p=!0,u=n;u.parentNode&&!Vt(u,"body");)if(Nc(u.parentNode))c.push(u.parentNode.host),u=u.parentNode.host;else{if(!(p=jc(u)))break;if(i||Yo.indexOf(p.tagName.toLowerCase())>-1)l=!0;else{var d=m.getComputedStyle(p);d&&d.getPropertyValue("cursor")==="pointer"&&(l=!0)}c.push(p),u=p}if(!function(v,_){var $=_?.element_allowlist;if(M($))return!0;var S,O=ot(v);try{var j=function(){var G=S.value;if($.some(function(V){return G.tagName.toLowerCase()===V}))return{v:!0}};for(O.s();!(S=O.n()).done;){var U=j();if(Ni(U)==="object")return U.v}}catch(G){O.e(G)}finally{O.f()}return!1}(c,t)||!function(v,_){var $=_?.css_selector_allowlist;if(M($))return!0;var S,O=ot(v);try{var j=function(){var G=S.value;if($.some(function(V){return G.matches(V)}))return{v:!0}};for(O.s();!(S=O.n()).done;){var U=j();if(Ni(U)==="object")return U.v}}catch(G){O.e(G)}finally{O.f()}return!1}(c,t))return!1;var f=m.getComputedStyle(n);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=n.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return l?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Yo.indexOf(g)>-1||n.getAttribute("contenteditable")==="true")}}function Ko(n){for(var e=n;e.parentNode&&!Vt(e,"body");e=e.parentNode){var t=os(e);if(H(t,"ph-sensitive")||H(t,"ph-no-capture"))return!1}if(H(os(n),"ph-include"))return!0;var i=n.type||"";if(Ie(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Ie(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function qc(n){return!!(Vt(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||Vt(n,"select")||Vt(n,"textarea")||n.getAttribute("contenteditable")==="true")}var Uc="(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})",vd=new RegExp("^(?:".concat(Uc,")$")),md=new RegExp(Uc),Bc="\\d{3}-?\\d{2}-?\\d{4}",yd=new RegExp("^(".concat(Bc,")$")),_d=new RegExp("(".concat(Bc,")"));function Hn(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(st(n)||Ie(n)&&(n=hs(n),(e?vd:md).test((n||"").replace(/[- ]/g,""))||(e?yd:_d).test(n)))}function zu(n){var e=as(n);return Hn(e="".concat(e," ").concat(Hc(n)).trim())?e:""}function Hc(n){var e="";return n&&n.childNodes&&n.childNodes.length&&Q(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=as(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(Hc(t)).trim())}catch(s){b.error(s)}}),e}function bd(n){return function(e){var t=e.map(function(i){var r,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class){i.attr_class.sort();var a,l=ot(i.attr_class);try{for(l.s();!(a=l.n()).done;){var c=a.value;o+=".".concat(c.replace(/"/g,""))}}catch(d){l.e(d)}finally{l.f()}}var p=I(I(I(I({},i.text?{text:i.text}:{}),{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r: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),u={};return Yr(p).sort(function(d,f){var g=Pe(d,1)[0],v=Pe(f,1)[0];return g.localeCompare(v)}).forEach(function(d){var f=Pe(d,2),g=f[0],v=f[1];return u[Wu(g.toString())]=Wu(v.toString())}),o+=":",o+=Yr(p).map(function(d){var f=Pe(d,2),g=f[0],v=f[1];return"".concat(g,'="').concat(v,'"')}).join("")});return t.join(";")}(function(e){return e.map(function(t){var i,r,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:wd(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Yr(t).filter(function(o){return Pe(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Pe(o,2),l=a[0],c=a[1];return s.attributes[l]=c}),s})}(n))}function Wu(n){return n.replace(/"|\\"/g,'\\"')}function wd(n){var e=n.attr__class;return e?me(e)?e:fa(e):void 0}var Qo="[SessionRecording]",Zo="redacted",Wr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(n){return n},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},xd=["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"],kd=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Sd=["/s/","/e/","/i/"];function Vu(n,e,t,i){if(st(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Ie(r)&&(r=parseInt(r)),r>t?Qo+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function Gu(n,e){if(st(n))return n;var t=n;return Hn(t,!1)||(t=Qo+" "+e+" body "+Zo),Q(kd,function(i){var r,s;(r=t)!==null&&r!==void 0&&r.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=Qo+" "+e+" body "+Zo+" as might contain: "+i)}),t}var Ed=function(n,e){var t,i,r,s={payloadSizeLimitBytes:Wr.payloadSizeLimitBytes,performanceEntryTypeToObserve:St(Wr.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(St(e.payloadHostDenyList||[]),St(Wr.payloadHostDenyList))},o=n.session_recording.recordHeaders!==!1&&e.recordHeaders,a=n.session_recording.recordBody!==!1&&e.recordBody,l=n.capture_performance!==!1&&e.recordPerformance,c=(t=s,r=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(d){return d!=null&&d.requestBody&&(d.requestBody=Vu(d.requestBody,d.requestHeaders,r,"Request")),d!=null&&d.responseBody&&(d.responseBody=Vu(d.responseBody,d.responseHeaders,r,"Response")),d}),p=function(d){return c(function(v){var _=Fi(v.name);if(!(_&&_.pathname&&Sd.some(function($){return _.pathname.indexOf($)===0})))return v}((g=(f=d).requestHeaders,st(g)||Q(Object.keys(g??{}),function(v){xd.includes(v.toLowerCase())&&(g[v]=Zo)}),f)));var f,g},u=rt(n.session_recording.maskNetworkRequestFn);return u&&rt(n.session_recording.maskCapturedNetworkRequestFn)&&b.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(n.session_recording.maskCapturedNetworkRequestFn=function(d){var f=n.session_recording.maskNetworkRequestFn({url:d.name});return I(I({},d),{},{name:f?.url})}),s.maskRequestFn=rt(n.session_recording.maskCapturedNetworkRequestFn)?function(d){var f,g,v,_=p(d);return _&&(f=(g=(v=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(v,_))!==null&&f!==void 0?f:void 0}:function(d){return function(f){if(!M(f))return f.requestBody=Gu(f.requestBody,"Request"),f.responseBody=Gu(f.responseBody,"Response"),f}(p(d))},I(I(I({},Wr),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},$d=Y(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};J(this,n),y(this,"bucketSize",100),y(this,"refillRate",10),y(this,"mutationBuckets",{}),y(this,"loggedTracker",{}),y(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(o){r.mutationBuckets[o]=r.mutationBuckets[o]+r.refillRate,r.mutationBuckets[o]>=r.bucketSize&&delete r.mutationBuckets[o]})}),y(this,"getNodeOrRelevantParent",function(o){var a=r.rrweb.mirror.getNode(o);if(a?.nodeName!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[r.rrweb.mirror.getId(l),l]}return[o,a]}),y(this,"numberOfChanges",function(o){var a,l,c,p,u,d,f,g;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((c=(p=o.attributes)===null||p===void 0?void 0:p.length)!==null&&c!==void 0?c:0)+((u=(d=o.texts)===null||d===void 0?void 0:d.length)!==null&&u!==void 0?u:0)+((f=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&f!==void 0?f:0)}),y(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var a=o.data,l=r.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(p){var u,d,f,g=Pe(r.getNodeOrRelevantParent(p.id),2),v=g[0],_=g[1];return r.mutationBuckets[v]===0?!1:(r.mutationBuckets[v]=(u=r.mutationBuckets[v])!==null&&u!==void 0?u:r.bucketSize,r.mutationBuckets[v]=Math.max(r.mutationBuckets[v]-1,0),r.mutationBuckets[v]===0&&(r.loggedTracker[v]||(r.loggedTracker[v]=!0,(d=(f=r.options).onBlockedNode)===null||d===void 0||d.call(f,v,_))),p)}));var c=r.numberOfChanges(a);return c!==0||l===c?o:void 0}),this.rrweb=e,this.options=s,this.refillRate=(t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),Cd=3e5,Ad=[_t.MouseMove,_t.MouseInteraction,_t.Scroll,_t.ViewportResize,_t.Input,_t.TouchMove,_t.MediaInteraction,_t.Drag],Xu=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Je="[SessionRecording]";function Id(n){return JSON.stringify(n,(e=[],function(t,i){if(Fe(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i})).length;var e}var wt,Td=function(){function n(e){var t=this;if(J(this,n),y(this,"queuedRRWebEvents",[]),y(this,"isIdle",!1),y(this,"_linkedFlagSeen",!1),y(this,"_lastActivityTimestamp",Date.now()),y(this,"_linkedFlag",null),y(this,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,m?.addEventListener("beforeunload",function(){t._flushBuffer()}),m?.addEventListener("offline",function(){t._tryAddCustomEvent("browser offline",{})}),m?.addEventListener("online",function(){t._tryAddCustomEvent("browser online",{})}),m?.addEventListener("visibilitychange",function(){if(P!=null&&P.visibilityState){var o="window "+P.visibilityState;t._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw b.error(Je+" started without valid sessionManager"),new Error(Je+" started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,s=i.windowId;this.sessionId=r,this.windowId=s,this.buffer=this.clearBuffer(),this._setupSampling()}return Y(n,[{key:"rrwebRecord",get:function(){var e;return pe==null||(e=pe.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Je+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.full_snapshot_interval_millis)||Cd}},{key:"isSampled",get:function(){var e=this.instance.get_property(Oi);return Ln(e)?e:null}},{key:"sessionDuration",get:function(){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],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(jo),t=!this.instance.config.disable_session_recording;return m&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Au),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(Tu);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(Iu),r={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=r?.recordHeaders||i?.recordHeaders,o=r?.recordBody||i?.recordBody,a=Fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,l=!!(Ln(a)?a:i?.capturePerformance);return s||o||l?{recordHeaders:s,recordBody:o,recordPerformance:l}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(Ru);return nt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(Pu);return nt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?st(this._linkedFlag)||this._linkedFlagSeen?Ln(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),b.info(Je+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,b.info(Je+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(nt(r)){var s,o=this.isSampled,a=i||!Ln(o);a?s=Math.random()<r:s=o,!s&&a&&b.warn(Je+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),(t=this.instance.persistence)===null||t===void 0||t.register(y({},Oi,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},Oi,null))}}},{key:"afterDecideResponse",value:function(e){var t,i,r,s=this;if(this._persistDecideResponse(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=(r=e.sessionRecording)===null||r===void 0?void 0:r.endpoint),this._setupSampling(),!st(this._linkedFlag)){var o=Ie(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Ie(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,c){var p=Fe(c)&&o in c,u=a?c[o]===a:p;if(u){var d={linkedFlag:o,linkedVariant:a},f="linked flag matched";b.info(Je+" "+f,d),s._tryAddCustomEvent(f,d)}s._linkedFlagSeen=u})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;nt(this.sampleRate)&&$t(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,i=function(){var r,s,o,a,l,c,p,u,d=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate,f=st(d)?null:parseFloat(d),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(u={},jo,!!e.sessionRecording),y(u,Au,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(u,Iu,I({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(u,Tu,{enabled:(l=e.sessionRecording)===null||l===void 0?void 0:l.recordCanvas,fps:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasFps,quality:(p=e.sessionRecording)===null||p===void 0?void 0:p.canvasQuality}),y(u,Ru,f),y(u,Pu,M(g)?null:g),u))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(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:mc()})}},{key:"_startCapture",value:function(){var e=this;M(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(ct.LIB_VERSION),function(t){if(t)return b.error(Je+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&Ad.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),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 r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=r.windowId,o=r.sessionId,a=this.sessionId!==o,l=this.windowId!==s;this.windowId=s,this.sessionId=o,(i||[dd,hd].indexOf(e.type)===-1&&(l||a||M(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(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}):b.warn(Je+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(Xu(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Xu(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording,s=0,o=Object.entries(r||{});s<o.length;s++){var a=Pe(o[s],2),l=a[0],c=a[1];l in i&&(i[l]=c)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new $d(this.rrwebRecord,{onBlockedNode:function(u,d){var f="Too many mutations on node '".concat(u,"'. Rate limiting. This could be due to SVG animations or something similar");b.info(f,{node:d}),t.log(Je+" "+f,"warn")}});var p=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(I({emit:function(u){t.onRRwebEmit(u)},plugins:p},i)),this.instance._addCaptureHook(function(u){try{if(u==="$pageview"){var d=m?t._maskUrl(m.location.href):"";if(!d)return;t._tryAddCustomEvent("$pageview",{href:d})}}catch(f){b.error("Could not add $pageview to rrweb session",f)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:p.map(function(u){return u?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else b.error(Je+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return pe.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(pe.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&rt(pe.getRecordNetworkPlugin)&&(!ed.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(pe.getRecordNetworkPlugin(Ed(this.instance.config,this.networkPayloadCapture))):b.info(Je+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Fe(e)){if(e.type===Kr.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Kr.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&Fe(l)&&l.type===6&&Fe(l.data)&&l.data.plugin==="rrweb/console@1"){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var c=[],p=0;p<l.data.payload.payload.length;p++)l.data.payload.payload[p]&&l.data.payload.payload[p].length>2e3?c.push(l.data.payload.payload[p].slice(0,2e3)+"...[truncated]"):c.push(l.data.payload.payload[p]);return l.data.payload.payload=c,a}return a}(i),s=Id(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Kr.Custom){var o={$snapshot_bytes:s,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){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)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=St(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt<=2e3&&e._tryRRWebMethod(i)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,r={url:e};return(i=r=t.maskNetworkRequestFn(r))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=nt(i)&&i>=0,s=nt(t)&&r&&i<t;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);(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.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),n}(),Rd=function(){function n(e){J(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Y(n,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(jn),group_properties:this.instance.get_property(Ut),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:it.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(i){return e.parseDecideResponse(i.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var i=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},i),i)b.error("Failed to fetch feature flags from PostHog.");else{if(!P||!P.body)return b.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r,s=ot(e.siteApps);try{var o=function(){var a=r.value,l=a.id,c=a.url,p=t.instance.requestRouter.endpointFor("api",c);pe["__$$ph_site_app_".concat(l)]=t.instance,t.instance.requestRouter.loadScript(p,function(u){u&&b.error("Error while initializing PostHog app with config id ".concat(l),u)})};for(s.s();!(r=s.n()).done;)o()}catch(a){s.e(a)}finally{s.f()}}else e.siteApps.length>0&&b.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),Pd=m!=null&&m.location?rs(m.location.hash,"__posthog")||rs(location.hash,"state"):null,Ju="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(wt||(wt={}));var Od=function(){function n(e){J(this,n),this.instance=e}return Y(n,[{key:"setToolbarState",value:function(e){pe.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=pe.ph_toolbar_state)!==null&&e!==void 0?e:wt.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=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||!P)return!1;i=(e=i)!==null&&e!==void 0?e:m.location,s=(t=s)!==null&&t!==void 0?t:m.history;try{if(!r){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}r=m?.localStorage}var o,a=Pd||rs(i.hash,"__posthog")||rs(i.hash,"state"),l=a?Su(function(){return JSON.parse(atob(decodeURIComponent(a)))})||Su(function(){return JSON.parse(decodeURIComponent(a))}):null;return l&&l.action==="ph_authorize"?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(r.getItem(Ju)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(pe.ph_load_toolbar||pe.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(P==null||!P.getElementById(Vo));if(!m||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=I(I({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(m.localStorage.setItem(Ju,JSON.stringify(I(I({},s),{},{source:void 0}))),this.getToolbarState()===wt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===wt.UNINITIALIZED){this.setToolbarState(wt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(a),function(l){if(l)return b.error("Failed to load toolbar",l),void t.setToolbarState(wt.UNINITIALIZED);t.setToolbarState(wt.LOADED),t._callLoadToolbar(s)}),xt(m,"turbolinks:load",function(){t.setToolbarState(wt.UNINITIALIZED),t.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){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)}}]),n}(),Fd=function(){function n(e){J(this,n),y(this,"isPaused",!0),y(this,"queue",[]),y(this,"flushTimeoutMs",3e3),this.sendRequest=e}return Y(n,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},i=Object.values(t),r=[].concat(St(i.filter(function(s){return s.url.indexOf("/e")===0})),St(i.filter(function(s){return s.url.indexOf("/e")!==0})));r.map(function(s){e.sendRequest(I(I({},s),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),i=function(s){var o=t[s],a=new Date().getTime();o.data&&me(o.data)&&Q(o.data,function(l){l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.sendRequest(o)};for(var r in t)i(r)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Q(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;M(e[s])&&(e[s]=I(I({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),He=Uint8Array,De=Uint16Array,Wn=Uint32Array,ha=new He([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]),ga=new He([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]),Yu=new He([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zc=function(n,e){for(var t=new De(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new Wn(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},Wc=zc(ha,2),Dd=Wc[0],ea=Wc[1];Dd[28]=258,ea[258]=28;for(ta=zc(ga,0)[1],ls=new De(32768),ee=0;ee<32768;++ee)qt=(43690&ee)>>>1|(21845&ee)<<1,qt=(61680&(qt=(52428&qt)>>>2|(13107&qt)<<2))>>>4|(3855&qt)<<4,ls[ee]=((65280&qt)>>>8|(255&qt)<<8)>>>1;var qt,ta,ls,ee,Di=function(n,e,t){for(var i=n.length,r=0,s=new De(e);r<i;++r)++s[n[r]-1];var o,a=new De(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new De(1<<e);var l=15-e;for(r=0;r<i;++r)if(n[r])for(var c=r<<4|n[r],p=e-n[r],u=a[n[r]-1]++<<p,d=u|(1<<p)-1;u<=d;++u)o[ls[u]>>>l]=c}else for(o=new De(i),r=0;r<i;++r)o[r]=ls[a[n[r]-1]++]>>>15-n[r];return o},fn=new He(288);for(ee=0;ee<144;++ee)fn[ee]=8;for(ee=144;ee<256;++ee)fn[ee]=9;for(ee=256;ee<280;++ee)fn[ee]=7;for(ee=280;ee<288;++ee)fn[ee]=8;var us=new He(32);for(ee=0;ee<32;++ee)us[ee]=5;var Md=Di(fn,9,0),Ld=Di(us,5,0),Vc=function(n){return(n/8>>0)+(7&n&&1)},Gc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof De?De:n instanceof Wn?Wn:He)(t-e);return i.set(n.subarray(e,t)),i},yt=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},Ci=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},Co=function(n,e){for(var t=[],i=0;i<n.length;++i)n[i]&&t.push({s:i,f:n[i]});var r=t.length,s=t.slice();if(!r)return[new He(0),0];if(r==1){var o=new He(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(U,G){return U.f-G.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],c=0,p=1,u=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};p!=r-1;)a=t[t[c].f<t[u].f?c++:u++],l=t[c!=p&&t[c].f<t[u].f?c++:u++],t[p++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;i<r;++i)s[i].s>d&&(d=s[i].s);var f=new De(d+1),g=Nd(t[p-1],f,0);if(g>e){i=0;var v=0,_=g-e,$=1<<_;for(s.sort(function(U,G){return f[G.s]-f[U.s]||U.f-G.f});i<r;++i){var S=s[i].s;if(!(f[S]>e))break;v+=$-(1<<g-f[S]),f[S]=e}for(v>>>=_;v>0;){var O=s[i].s;f[O]<e?v-=1<<e-f[O]++-1:++i}for(;i>=0&&v;--i){var j=s[i].s;f[j]==e&&(--f[j],++v)}g=e}return[new He(f),g]},Nd=function n(e,t,i){return e.s==-1?Math.max(n(e.l,t,i+1),n(e.r,t,i+1)):t[e.s]=i},Ku=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new De(++e),i=0,r=n[0],s=1,o=function(l){t[i++]=l},a=1;a<=e;++a)if(n[a]==r&&a!=e)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=n[a]}return[t.subarray(0,i),e]},Ai=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},Qr=function(n,e,t){var i=t.length,r=Vc(e+2);n[r]=255&i,n[r+1]=i>>>8,n[r+2]=255^n[r],n[r+3]=255^n[r+1];for(var s=0;s<i;++s)n[r+s+4]=t[s];return 8*(r+4+i)},Qu=function(n,e,t,i,r,s,o,a,l,c,p){yt(e,p++,t),++r[256];for(var u=Co(r,15),d=u[0],f=u[1],g=Co(s,15),v=g[0],_=g[1],$=Ku(d),S=$[0],O=$[1],j=Ku(v),U=j[0],G=j[1],V=new De(19),C=0;C<S.length;++C)V[31&S[C]]++;for(C=0;C<U.length;++C)V[31&U[C]]++;for(var B=Co(V,7),X=B[0],dt=B[1],ye=19;ye>4&&!X[Yu[ye-1]];--ye);var ze,K,te,ce,Me=c+5<<3,qe=Ai(r,fn)+Ai(s,us)+o,oe=Ai(r,d)+Ai(s,v)+o+14+3*ye+Ai(V,X)+(2*V[16]+3*V[17]+7*V[18]);if(Me<=qe&&Me<=oe)return Qr(e,p,n.subarray(l,l+c));if(yt(e,p,1+(oe<qe)),p+=2,oe<qe){ze=Di(d,f,0),K=d,te=Di(v,_,0),ce=v;var $e=Di(X,dt,0);for(yt(e,p,O-257),yt(e,p+5,G-1),yt(e,p+10,ye-4),p+=14,C=0;C<ye;++C)yt(e,p+3*C,X[Yu[C]]);p+=3*ye;for(var Ce=[S,U],ne=0;ne<2;++ne){var _e=Ce[ne];for(C=0;C<_e.length;++C){var Te=31&_e[C];yt(e,p,$e[Te]),p+=X[Te],Te>15&&(yt(e,p,_e[C]>>>5&127),p+=_e[C]>>>12)}}}else ze=Md,K=fn,te=Ld,ce=us;for(C=0;C<a;++C)if(i[C]>255){Te=i[C]>>>18&31,Ci(e,p,ze[Te+257]),p+=K[Te+257],Te>7&&(yt(e,p,i[C]>>>23&31),p+=ha[Te]);var hn=31&i[C];Ci(e,p,te[hn]),p+=ce[hn],hn>3&&(Ci(e,p,i[C]>>>5&8191),p+=ga[hn])}else Ci(e,p,ze[i[C]]),p+=K[i[C]];return Ci(e,p,ze[256]),p+K[256]},jd=new Wn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),qd=new He(0),Ud=function(){for(var n=new Wn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),Bd=function(n,e,t,i,r){return function(s,o,a,l,c,p){var u=s.length,d=new He(l+u+5*(1+Math.floor(u/7e3))+c),f=d.subarray(l,d.length-c),g=0;if(!o||u<8)for(var v=0;v<=u;v+=65535){var _=v+65535;_<u?g=Qr(f,g,s.subarray(v,_)):(f[v]=p,g=Qr(f,g,s.subarray(v,u)))}else{for(var $=jd[o-1],S=$>>>13,O=8191&$,j=(1<<a)-1,U=new De(32768),G=new De(j+1),V=Math.ceil(a/3),C=2*V,B=function(Es){return(s[Es]^s[Es+1]<<V^s[Es+2]<<C)&j},X=new Wn(25e3),dt=new De(288),ye=new De(32),ze=0,K=0,te=(v=0,0),ce=0,Me=0;v<u;++v){var qe=B(v),oe=32767&v,$e=G[qe];if(U[oe]=$e,G[qe]=oe,ce<=v){var Ce=u-v;if((ze>7e3||te>24576)&&Ce>423){g=Qu(s,f,0,X,dt,ye,K,te,Me,v-Me,g),te=ze=K=0,Me=v;for(var ne=0;ne<286;++ne)dt[ne]=0;for(ne=0;ne<30;++ne)ye[ne]=0}var _e=2,Te=0,hn=O,Ct=oe-$e&32767;if(Ce>2&&qe==B(v-Ct))for(var _p=Math.min(S,Ce)-1,bp=Math.min(32767,v),wp=Math.min(258,Ce);Ct<=bp&&--hn&&oe!=$e;){if(s[v+_e]==s[v+_e-Ct]){for(var At=0;At<wp&&s[v+At]==s[v+At-Ct];++At);if(At>_e){if(_e=At,Te=Ct,At>_p)break;var xp=Math.min(Ct,At-2),Sa=0;for(ne=0;ne<xp;++ne){var Ss=v-Ct+ne+32768&32767,Ea=Ss-U[Ss]+32768&32767;Ea>Sa&&(Sa=Ea,$e=Ss)}}}Ct+=(oe=$e)-($e=U[oe])+32768&32767}if(Te){X[te++]=268435456|ea[_e]<<18|ta[Te];var $a=31&ea[_e],Ca=31&ta[Te];K+=ha[$a]+ga[Ca],++dt[257+$a],++ye[Ca],ce=v+_e,++ze}else X[te++]=s[v],++dt[s[v]]}}g=Qu(s,f,p,X,dt,ye,K,te,Me,v-Me,g),p||(g=Qr(f,g,qd))}return Gc(d,0,l+Vc(g)+c)}(n,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+e.mem,t,i,!r)},Ao=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function Hd(n,e){e===void 0&&(e={});var t=function(){var o=4294967295;return{p:function(a){for(var l=o,c=0;c<a.length;++c)l=Ud[255&l^a[c]]^l>>>8;o=l},d:function(){return 4294967295^o}}}(),i=n.length;t.p(n);var r=Bd(n,e,function(o){return 10+(o.filename&&o.filename.length+1||0)}(e),8),s=r.length;return function(o,a){var l=a.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=a.level<2?4:a.level==9?2:0,o[9]=3,a.mtime!=0&&Ao(o,4,Math.floor(new Date(a.mtime||Date.now())/1e3)),l){o[3]=8;for(var c=0;c<=l.length;++c)o[c+10]=l.charCodeAt(c)}}(r,e),Ao(r,s-8,t.d()),Ao(r,s-4,i),r}var zd=!!Do||!!Fo,Zu="text/plain",cs=function(n,e){var t=Pe(n.split("?"),2),i=t[0],r=t[1],s=I({},e);r?.split("&").forEach(function(a){var l=Pe(a.split("="),1)[0];delete s[l]});var o=td(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},Wd=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},Io=function(n){var e=n.data,t=n.compression;if(e){if(t===it.GZipJS){var i=Hd(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new He(s.length+(s.length>>>1)),c=0,p=function(g){l[c++]=g},u=0;u<a;++u){if(c+5>l.length){var d=new He(c+8+(a-u<<1));d.set(l),l=d}var f=s.charCodeAt(u);f<128||o?p(f):f<2048?(p(192|f>>>6),p(128|63&f)):f>55295&&f<57344?(p(240|(f=65536+(1047552&f)|1023&s.charCodeAt(++u))>>>18),p(128|f>>>12&63),p(128|f>>>6&63),p(128|63&f)):(p(224|f>>>12),p(128|f>>>6&63),p(128|63&f))}return Gc(l,0,c)}(JSON.stringify(e)),{mtime:0});return{contentType:Zu,body:new Blob([i],{type:Zu})}}if(t===it.Base64){var r=function(s){var o,a,l,c,p,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,f=0,g="",v=[];if(!s)return s;s=Bf(s);do o=(p=s.charCodeAt(d++)<<16|s.charCodeAt(d++)<<8|s.charCodeAt(d++))>>18&63,a=p>>12&63,l=p>>6&63,c=63&p,v[f++]=u.charAt(o)+u.charAt(a)+u.charAt(l)+u.charAt(c);while(d<s.length);switch(g=v.join(""),s.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:Wd(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Mi=[];Do&&Mi.push({transport:"XHR",method:function(n){var e,t=new Do;t.open(n.method||"GET",n.url,!0);var i=(e=Io(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;Q(n.headers,function(o,a){t.setRequestHeader(a,o)}),r&&t.setRequestHeader("Content-Type",r),n.timeout&&(t.timeout=n.timeout),t.withCredentials=!0,t.onreadystatechange=function(){if(t.readyState===4){var o,a={statusCode:t.status,text:t.responseText};if(t.status===200)try{a.json=JSON.parse(t.responseText)}catch{}(o=n.callback)===null||o===void 0||o.call(n,a)}},t.send(s)}}),Fo&&Mi.push({transport:"fetch",method:function(n){var e,t,i=(e=Io(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;Q(o,function(p,u){o.append(u,p)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(xu){var c=new xu;l={signal:c.signal,timeout:setTimeout(function(){return c.abort()},n.timeout)}}Fo(a,{method:n?.method||"GET",headers:o,keepalive:n.method==="POST",body:s,signal:(t=l)===null||t===void 0?void 0:t.signal}).then(function(p){return p.text().then(function(u){var d,f={statusCode:p.status,text:u};if(p.status===200)try{f.json=JSON.parse(u)}catch(g){b.error(g)}(d=n.callback)===null||d===void 0||d.call(n,f)})}).catch(function(p){var u;b.error(p),(u=n.callback)===null||u===void 0||u.call(n,{statusCode:0,text:p})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),kt!=null&&kt.sendBeacon&&Mi.push({transport:"sendBeacon",method:function(n){var e=cs(n.url,{beacon:"1"});try{var t,i=(t=Io(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;kt.sendBeacon(e,o)}catch{}}});var Vd=["retriesPerformedSoFar"],pn,Gd=function(){function n(e){var t=this;J(this,n),y(this,"isPolling",!1),y(this,"pollIntervalMs",3e3),y(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!M(m)&&"onLine"in m.navigator&&(this.areWeOnline=m.navigator.onLine,m.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),m.addEventListener("offline",function(){t.areWeOnline=!1}))}return Y(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=Lf(e,Vd);nt(i)&&i>0&&(r.url=cs(r.url,{retry_count:i})),this.instance._send_request(I(I({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(I({retriesPerformedSoFar:i},r)):(o=r.callback)===null||o===void 0||o.call(r,s)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),p=(Math.random()-.5)*(c-l);return Math.ceil(c+p)}(t),r=Date.now()+i;this.queue.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),b.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],i=this.queue.filter(function(a){return a.retryAt<e||(t.push(a),!1)});if(this.queue=t,i.length>0){var r,s=ot(i);try{for(s.s();!(r=s.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(a){s.e(a)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=ot(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(I(I({},i),{},{transport:"sendBeacon"}))}catch(r){b.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),Vr=1800,Xd=function(){function n(e,t,i,r){var s;J(this,n),y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||Ht,this._windowIdGenerator=r||Ht;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Vr;if(nt(a)?a>Vr?b.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&b.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(b.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Vr),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),Vr),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var l=Ee.parse(this._window_id_storage_key),c=Ee.parse(this._primary_window_exists_storage_key);l&&!c?this._windowId=l:Ee.remove(this._window_id_storage_key),Ee.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var p=function(u){var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),p)}catch(u){b.error("Invalid sessionID in bootstrap",u)}this._listenToReloadWindow()}return Y(n,[{key:"onSessionId",value:function(e){var t=this;return M(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ee.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ee.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ee.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(y({},ts,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[ts];return me(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;m?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&Ee.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){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=Pe(this._getSessionId(),3),r=i[0],s=i[1],o=i[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(t-o)>864e5,c=!1,p=!s,u=!e&&Math.abs(t-r)>this._sessionTimeoutMs;p||u||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),b.info("[SessionId] new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:p,activityTimeout:u,sessionPastMaximumLength:l}}),o=t,c=!0):a||(a=this._windowIdGenerator(),c=!0);var d=r===0||!e||l?t:r,f=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,d,f),c&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:f}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(pn||(pn={}));var ec="i.posthog.com",Jd=function(){function n(e){J(this,n),y(this,"_regionCache",{}),this.instance=e}return Y(n,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=pn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=pn.EU:this._regionCache[this.apiHost]=pn.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(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||this.apiHost.replace(".".concat(ec),".posthog.com"))+t;if(this.region===pn.CUSTOM)return this.apiHost+t;var i=ec+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return b.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var i=e[0]==="/"?this.endpointFor("assets",e):e,r=function(){if(!P)return t("document not found");var s=P.createElement("script");s.type="text/javascript",s.src=i,s.onload=function(l){return t(void 0,l)},s.onerror=function(l){return t(l)};var o,a=P.querySelectorAll("body > script");a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(s,a[0]):P.body.appendChild(s)};P!=null&&P.body?r():P?.addEventListener("DOMContentLoaded",r)}}]),n}(),Xc="posthog-js";function Jc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.organization,i=e.projectId,r=e.prefix,s=e.severityAllowList,o=s===void 0?["error"]:s;return function(a){var l,c,p,u,d;if(!(o==="*"||o.includes(a.level))||!n.__loaded)return a;a.tags||(a.tags={});var f=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=f,n.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));var g=((l=a.exception)===null||l===void 0?void 0:l.values)||[],v={$exception_message:((c=g[0])===null||c===void 0?void 0:c.value)||a.message,$exception_type:(p=g[0])===null||p===void 0?void 0:p.type,$exception_personURL:f,$exception_level:a.level,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((u=g[0])===null||u===void 0?void 0:u.value)||a.message,$sentry_exception_type:(d=g[0])===null||d===void 0?void 0:d.type,$sentry_tags:a.tags,$level:a.level};return t&&i&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.capture("$exception",v),a}}var Yd=Y(function n(e,t,i,r,s){J(this,n),this.name=Xc,this.setupOnce=function(o){o(Jc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function Kd(n,e){var t=n.config.segment;if(!t)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var o=function(l){var c=function(){return l.anonymousId()||Ht()};i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(bt,"identified")),r()},a=s.user();"then"in a&&rt(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||b.warn("This browser does not have Promise support, and can not use the segment integration");var r=function(s,o){var a;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||i.reset(),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(i.register({distinct_id:s.event.userId}),i.reloadFeatureFlags());var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{});return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return r(s,s.event.event)},page:function(s){return r(s,"$pageview")},identify:function(s){return r(s,"$identify")},screen:function(s){return r(s,"$screen")}}}(n)).then(function(){e()})})}var tc,ps,tt,Qd=function(){function n(e){J(this,n),this._instance=e}return Y(n,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=(e=m?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var i=t.maxScrollHeight,r=t.lastScrollY,s=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,l=t.maxContentY;return M(i)||M(r)||M(s)||M(o)||M(a)||M(l)?{}:(i=Math.ceil(i),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:i<=1?1:Gr(r/i,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:i<=1?1:Gr(s/i,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Gr(a/o,0,1),$prev_pageview_max_content:l,$prev_pageview_max_content_percentage:o<=1?1:Gr(l/o,0,1)})}}]),n}();function Gr(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(tc||(tc={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(ps||(ps={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(tt||(tt={}));var na=function(){function n(e){J(this,n),this.persistence=e,this.eventRegistry=new Map}return Y(n,[{key:"register",value:function(e){var t=this;e.forEach(function(i){var r,s,o,a,l;(r=i.conditions)!==null&&r!==void 0&&r.events&&(s=i.conditions)!==null&&s!==void 0&&(o=s.events)!==null&&o!==void 0&&o.values&&((a=i.conditions)===null||a===void 0?void 0:a.events.values.length)>0&&t.eventRegistry.set(i.id,(l=i.conditions)===null||l===void 0?void 0:l.events.values.map(function(c){return c.name}))})}},{key:"on",value:function(e,t){var i,r=[],s=((i=this.persistence)===null||i===void 0?void 0:i.props[xo])||[];if(n.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,a=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(a){var l=s.indexOf(a);l>=0&&s.splice(l,1)}}else this.eventRegistry.forEach(function(p,u){p.includes(e)&&r.push(u)});var c=s.concat(r);this._saveSurveysToStorage(c)}},{key:"getSurveys",value:function(){var e,t=(e=this.persistence)===null||e===void 0?void 0:e.props[xo];return t||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.register(y({},xo,St(new Set(e))))}}]),n}();y(na,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Yc,se,Kc,cn,nc,Qc,ia,Zc,ra={},ep=[],Zd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,va=Array.isArray;function zt(n,e){for(var t in e)n[t]=e[t];return n}function tp(n){var e=n.parentNode;e&&e.removeChild(n)}function To(n,e,t,i,r){var s={type:n,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++Kc,__i:-1,__u:0};return r==null&&se.vnode!=null&&se.vnode(s),s}function ma(n){return n.children}function Zr(n,e){this.props=n,this.context=e}function Vn(n,e){if(e==null)return n.__?Vn(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Vn(n):null}function np(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return np(n)}}function sa(n){(!n.__d&&(n.__d=!0)&&cn.push(n)&&!fs.__r++||nc!==se.debounceRendering)&&((nc=se.debounceRendering)||Qc)(fs)}function fs(){var n,e,t,i,r,s,o,a,l;for(cn.sort(ia);n=cn.shift();)n.__d&&(e=cn.length,i=void 0,s=(r=(t=n).__v).__e,a=[],l=[],(o=t.__P)&&((i=zt({},r)).__v=r.__v+1,se.vnode&&se.vnode(i),sp(o,i,r,t.__n,o.ownerSVGElement!==void 0,32&r.__u?[s]:null,a,s??Vn(r),!!(32&r.__u),l),i.__.__k[i.__i]=i,nh(a,i,l),i.__e!=s&&np(i)),cn.length>e&&cn.sort(ia));fs.__r=0}function ip(n,e,t,i,r,s,o,a,l,c,p){var u,d,f,g,v,_=i&&i.__k||ep,$=e.length;for(t.__d=l,eh(t,e,_),l=t.__d,u=0;u<$;u++)(f=t.__k[u])!=null&&typeof f!="boolean"&&typeof f!="function"&&(d=f.__i===-1?ra:_[f.__i]||ra,f.__i=u,sp(n,f,d,r,s,o,a,l,c,p),g=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&ya(d.ref,null,f),p.push(f.ref,f.__c||g,f)),v==null&&g!=null&&(v=g),65536&f.__u||d.__k===f.__k?l=rp(f,l,n):typeof f.type=="function"&&f.__d!==void 0?l=f.__d:g&&(l=g.nextSibling),f.__d=void 0,f.__u&=-196609);t.__d=l,t.__e=v}function eh(n,e,t){var i,r,s,o,a,l=e.length,c=t.length,p=c,u=0;for(n.__k=[],i=0;i<l;i++)(r=n.__k[i]=(r=e[i])==null||typeof r=="boolean"||typeof r=="function"?null:typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?To(null,r,null,null,r):va(r)?To(ma,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?To(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=n,r.__b=n.__b+1,a=th(r,t,o=i+u,p),r.__i=a,s=null,a!==-1&&(p--,(s=t[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&u--,typeof r.type!="function"&&(r.__u|=65536)):a!==o&&(a===o+1?u++:a>o?p>l-o?u+=a-o:u--:u=a<o&&a==o-1?a-o:0,a!==i+u&&(r.__u|=65536))):(s=t[i])&&s.key==null&&s.__e&&(s.__e==n.__d&&(n.__d=Vn(s)),oa(s,s,!1),t[i]=null,p--);if(p)for(i=0;i<c;i++)(s=t[i])!=null&&!(131072&s.__u)&&(s.__e==n.__d&&(n.__d=Vn(s)),oa(s,s))}function rp(n,e,t){var i,r;if(typeof n.type=="function"){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,e=rp(i[r],e,t));return e}return n.__e!=e&&(t.insertBefore(n.__e,e||null),e=n.__e),e&&e.nextSibling}function th(n,e,t,i){var r=n.key,s=n.type,o=t-1,a=t+1,l=e[t];if(l===null||l&&r==l.key&&s===l.type)return t;if(i>(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a<e.length;){if(o>=0){if((l=e[o])&&!(131072&l.__u)&&r==l.key&&s===l.type)return o;o--}if(a<e.length){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&s===l.type)return a;a++}}return-1}function ic(n,e,t){e[0]==="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||Zd.test(e)?t:t+"px"}function Xr(n,e,t,i,r){var s;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof i=="string"&&(n.style.cssText=i=""),i)for(e in i)t&&e in t||ic(n.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||ic(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+s]=t,t?i?t.u=i.u:(t.u=Date.now(),n.addEventListener(e,s?sc:rc,s)):n.removeEventListener(e,s?sc:rc,s);else{if(r)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 n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?n.removeAttribute(e):n.setAttribute(e,t))}}function rc(n){var e=this.l[n.type+!1];if(n.t){if(n.t<=e.u)return}else n.t=Date.now();return e(se.event?se.event(n):n)}function sc(n){return this.l[n.type+!0](se.event?se.event(n):n)}function sp(n,e,t,i,r,s,o,a,l,c){var p,u,d,f,g,v,_,$,S,O,j,U,G,V,C,B=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),s=[a=e.__e=t.__e]),(p=se.__b)&&p(e);e:if(typeof B=="function")try{if($=e.props,S=(p=B.contextType)&&i[p.__c],O=p?S?S.props.value:p.__:i,t.__c?_=(u=e.__c=t.__c).__=u.__E:("prototype"in B&&B.prototype.render?e.__c=u=new B($,O):(e.__c=u=new Zr($,O),u.constructor=B,u.render=rh),S&&S.sub(u),u.props=$,u.state||(u.state={}),u.context=O,u.__n=i,d=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($,u.__s))),f=u.props,g=u.state,u.__v=e,d)B.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(B.getDerivedStateFromProps==null&&$!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps($,O),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate($,u.__s,O)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(u.props=$,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(X){X&&(X.__=e)}),j=0;j<u._sb.length;j++)u.__h.push(u._sb[j]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate($,u.__s,O),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,g,v)})}if(u.context=O,u.props=$,u.__P=n,u.__e=!1,U=se.__r,G=0,"prototype"in B&&B.prototype.render){for(u.state=u.__s,u.__d=!1,U&&U(e),p=u.render(u.props,u.state,u.context),V=0;V<u._sb.length;V++)u.__h.push(u._sb[V]);u._sb=[]}else do u.__d=!1,U&&U(e),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++G<25);u.state=u.__s,u.getChildContext!=null&&(i=zt(zt({},i),u.getChildContext())),d||u.getSnapshotBeforeUpdate==null||(v=u.getSnapshotBeforeUpdate(f,g)),ip(n,va(C=p!=null&&p.type===ma&&p.key==null?p.props.children:p)?C:[C],e,t,i,r,s,o,a,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&o.push(u),_&&(u.__E=u.__=null)}catch(X){e.__v=null,l||s!=null?(e.__e=a,e.__u|=l?160:32,s[s.indexOf(a)]=null):(e.__e=t.__e,e.__k=t.__k),se.__e(X,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=ih(t.__e,e,t,i,r,s,o,l,c);(p=se.diffed)&&p(e)}function nh(n,e,t){e.__d=void 0;for(var i=0;i<t.length;i++)ya(t[i],t[++i],t[++i]);se.__c&&se.__c(e,n),n.some(function(r){try{n=r.__h,r.__h=[],n.some(function(s){s.call(r)})}catch(s){se.__e(s,r.__v)}})}function ih(n,e,t,i,r,s,o,a,l){var c,p,u,d,f,g,v,_=t.props,$=e.props,S=e.type;if(S==="svg"&&(r=!0),s!=null){for(c=0;c<s.length;c++)if((f=s[c])&&"setAttribute"in f==!!S&&(S?f.localName===S:f.nodeType===3)){n=f,s[c]=null;break}}if(n==null){if(S===null)return document.createTextNode($);n=r?document.createElementNS("http://www.w3.org/2000/svg",S):document.createElement(S,$.is&&$),s=null,a=!1}if(S===null)_===$||a&&n.data===$||(n.data=$);else{if(s=s&&Yc.call(n.childNodes),_=t.props||ra,!a&&s!=null)for(_={},c=0;c<n.attributes.length;c++)_[(f=n.attributes[c]).name]=f.value;for(c in _)f=_[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=f:c==="key"||c in $||Xr(n,c,null,f,r));for(c in $)f=$[c],c=="children"?d=f:c=="dangerouslySetInnerHTML"?p=f:c=="value"?g=f:c=="checked"?v=f:c==="key"||a&&typeof f!="function"||_[c]===f||Xr(n,c,f,_[c],r);if(p)a||u&&(p.__html===u.__html||p.__html===n.innerHTML)||(n.innerHTML=p.__html),e.__k=[];else if(u&&(n.innerHTML=""),ip(n,va(d)?d:[d],e,t,i,r&&S!=="foreignObject",s,o,s?s[0]:t.__k&&Vn(t,0),a,l),s!=null)for(c=s.length;c--;)s[c]!=null&&tp(s[c]);a||(c="value",g!==void 0&&(g!==n[c]||S==="progress"&&!g||S==="option"&&g!==_[c])&&Xr(n,c,g,_[c],!1),c="checked",v!==void 0&&v!==n[c]&&Xr(n,c,v,_[c],!1))}return n}function ya(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(i){se.__e(i,t)}}function oa(n,e,t){var i,r;if(se.unmount&&se.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||ya(i,null,e)),(i=n.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){se.__e(s,e)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&oa(i[r],e,t||typeof n.type!="function");t||n.__e==null||tp(n.__e),n.__=n.__e=n.__d=void 0}function rh(n,e,t){return this.constructor(n,t)}Yc=ep.slice,se={__e:function(n,e,t,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(n)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(n,i||{}),o=r.__d),o)return r.__E=r}catch(a){n=a}throw n}},Kc=0,Zr.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=zt({},this.state),typeof n=="function"&&(n=n(zt({},t),this.props)),n&&zt(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),sa(this))},Zr.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),sa(this))},Zr.prototype.render=ma,cn=[],Qc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ia=function(n,e){return n.__v.__b-e.__v.__b},fs.__r=0,Zc=0;var oc=function(n){var e,t,i,r,s,o;return((e=n.conditions)===null||e===void 0||(t=e.events)===null||t===void 0||(i=t.values)===null||i===void 0?void 0:i.length)!=null&&((r=n.conditions)===null||r===void 0||(s=r.events)===null||s===void 0||(o=s.values)===null||o===void 0?void 0:o.length)>0};(function(n,e){var t={__c:e="__cC"+Zc++,__:n,Consumer:function(i,r){return i.children(r)},Provider:function(i){var r,s;return this.getChildContext||(r=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&r.some(function(a){a.__e=!0,sa(a)})},this.sub=function(o){r.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){r.splice(r.indexOf(o),1),a&&a.call(o)}}),i.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:function(){}});var sh={icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!m&&Nu(m.location.href,n)},not_regex:function(n){return!!m&&!Nu(m.location.href,n)},exact:function(n){return m?.location.href===n},is_not:function(n){return m?.location.href!==n}},oh=function(){function n(e){J(this,n),this.instance=e,this._surveyEventReceiver=null}return Y(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=pe?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new na(this.instance.persistence)),this.instance.requestRouter.loadScript("/static/surveys.js",function(i){if(i)return b.error("Could not load surveys script",i);pe.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new na(this.instance.persistence));var r=this.instance.get_property(Uo);if(r&&!i)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:function(s){var o;if(s.statusCode!==200||!s.json)return e([]);var a=s.json.surveys||[],l=a.filter(function(p){var u,d,f,g,v,_;return((u=p.conditions)===null||u===void 0?void 0:u.events)&&((d=p.conditions)===null||d===void 0||(f=d.events)===null||f===void 0?void 0:f.values)&&((g=p.conditions)===null||g===void 0||(v=g.events)===null||v===void 0||(_=v.values)===null||_===void 0?void 0:_.length)>0});if(l.length>0&&!M(t.instance._addCaptureHook)){var c;(c=t._surveyEventReceiver)===null||c===void 0||c.register(l),t.instance._addCaptureHook(function(p,u){var d;(d=t._surveyEventReceiver)===null||d===void 0||d.on(p,u)})}return(o=t.instance.persistence)===null||o===void 0||o.register(y({},Uo,a)),e(a)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(r){var s,o=r.filter(function(c){return!(!c.start_date||c.end_date)}).filter(function(c){var p,u,d,f;if(!c.conditions)return!0;var g=(p=c.conditions)===null||p===void 0||!p.url||sh[(u=(d=c.conditions)===null||d===void 0?void 0:d.urlMatchType)!==null&&u!==void 0?u:"icontains"](c.conditions.url),v=(f=c.conditions)===null||f===void 0||!f.selector||P?.querySelector(c.conditions.selector);return g&&v}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(c){if(!c.linked_flag_key&&!c.targeting_flag_key&&!c.internal_targeting_flag_key)return!0;var p=!c.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(c.linked_flag_key),u=!c.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(c.targeting_flag_key),d=!oc(c)||a?.includes(c.id),f=function(v){var _,$;return!((_=v.conditions)===null||_===void 0||($=_.events)===null||$===void 0||!$.repeatedActivation||!oc(v))}(c),g=!(c.internal_targeting_flag_key&&!f)||t.instance.featureFlags.isFeatureEnabled(c.internal_targeting_flag_key);return p&&u&&g&&d});return e(l)},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var r,s=e.questions[t],o=t+1;if((r=s.branching)===null||r===void 0||!r.type)return t===e.questions.length-1?tt.End:o;if(s.branching.type===tt.End)return tt.End;if(s.branching.type===tt.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===tt.ResponseBased){if(s.type===ps.SingleChoice){var a,l,c=s.choices.indexOf("".concat(i));if((a=s.branching)!==null&&a!==void 0&&(l=a.responseValues)!==null&&l!==void 0&&l.hasOwnProperty(c)){var p=s.branching.responseValues[c];return Number.isInteger(p)?p:p===tt.End?tt.End:o}}else if(s.type===ps.Rating){var u,d;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var f=function(v,_){if(_===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(_===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(_===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, 10")}(i,s.scale);if((u=s.branching)!==null&&u!==void 0&&(d=u.responseValues)!==null&&d!==void 0&&d.hasOwnProperty(f)){var g=s.branching.responseValues[f];return Number.isInteger(g)?g:g===tt.End?tt.End:o}}return o}return console.warn("Falling back to next question index due to unexpected branching type"),o}}]),n}(),ah=function(){function n(e){var t,i,r=this;J(this,n),y(this,"serverLimits",{}),y(this,"lastEventRateLimited",!1),y(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(a){b.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void b.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:o})}}),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}return Y(n,[{key:"clientRateLimitContext",value:function(){var e,t,i,r=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(Ho))!==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 a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||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=a,(i=this.instance.persistence)===null||i===void 0||i.set_property(Ho,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}]),n}(),lh=function(){return I({initialPathName:Ne?.pathname||"",referringDomain:xe.referringDomain()},xe.campaignParams())},uh=function(){function n(e,t,i){var r=this;J(this,n),y(this,"_onSessionIdCallback",function(s){var o=r._getStoredProps();if(!o||o.sessionId!==s){var a={sessionId:s,props:r._sessionSourceParamGenerator()};r._persistence.register(y({},Bo,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||lh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return Y(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[Bo]}},{key:"getSessionProps",value:function(){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}:{}}}]),n}(),ch=["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","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],ac=function(n,e){if(!n)return!1;var t=n.toLowerCase();return ch.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},op=function(){function n(){J(this,n),this.clicks=[]}return Y(n,[{key:"isRageClick",value:function(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.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}}]),n}();function lc(n){var e;return n.id===Vo||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+Vo))}var ph=function(){function n(e){var t;J(this,n),y(this,"rageclicks",new op),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[No])}return Y(n,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(b.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return M(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},No,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;m&&P&&(xt(P,"click",function(t){return e._onClick(t||m?.event)},!1,!0),xt(P,"mousemove",function(t){return e._onMouseMove(t||m?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,l,c){for(var p=a;p&&!Vt(p,"body");){if(p===c)return!1;if(H(l,m?.getComputedStyle(p).position))return!0;p=jc(p)}return!1}(e.target,["fixed","sticky"],s);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!lc(e.target)){var i=this._getProperties(e,"click");(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(I(I({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;lc(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(m){var t=m.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),n}(),fh=function(){function n(e){var t=this;J(this,n),y(this,"_updateScrollData",function(){var i,r,s,o;t.context||(t.context={});var a=t.scrollElement(),l=t.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,p=l+(a?.clientHeight||0),u=a?.scrollHeight||0;t.context.lastScrollY=Math.ceil(l),t.context.maxScrollY=Math.max(l,(i=t.context.maxScrollY)!==null&&i!==void 0?i:0),t.context.maxScrollHeight=Math.max(c,(r=t.context.maxScrollHeight)!==null&&r!==void 0?r:0),t.context.lastContentY=p,t.context.maxContentY=Math.max(p,(s=t.context.maxContentY)!==null&&s!==void 0?s:0),t.context.maxContentHeight=Math.max(u,(o=t.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=e}return Y(n,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){m?.addEventListener("scroll",this._updateScrollData,!0),m?.addEventListener("scrollend",this._updateScrollData,!0),m?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return m?.document.documentElement;var e,t=ot(me(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var i=e.value,r=m?.document.querySelector(i);if(r)return r}}catch(s){t.e(s)}finally{t.f()}}},{key:"scrollY",value:function(){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}},{key:"scrollX",value:function(){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}}]),n}(),dh=function(){function n(){J(this,n),y(this,"events",{}),this.events={}}return Y(n,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(r){return r!==t})}}},{key:"emit",value:function(e,t){var i,r=ot(this.events[e]||[]);try{for(r.s();!(i=r.n()).done;)(0,i.value)(t)}catch(a){r.e(a)}finally{r.f()}var s,o=ot(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),Ro="$copy_autocapture";function Po(n,e){return e.length>n?e.slice(0,n)+"...":e}var Bt,hh=function(){function n(e){J(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new op),y(this,"_elementsChainAsString",!1),this.instance=e}return Y(n,[{key:"config",get:function(){var e,t=Fe(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(e=t.url_allowlist)===null||e===void 0?void 0:e.map(function(i){return new RegExp(i)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(m&&P){var t=function(r){r=r||m?.event;try{e._captureEvent(r)}catch(s){b.error("Failed to capture event",s)}},i=function(r){r=r||m?.event,e._captureEvent(r,Ro)};xt(P,"submit",t,!1,!0),xt(P,"change",t,!1,!0),xt(P,"click",t,!1,!0),this.config.capture_copied_text&&(xt(P,"copy",i,!1,!0),xt(P,"cut",i,!1,!0))}}else b.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(y({},Eu,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Eu],r=this._isDisabledServerSide;if($t(r)&&!Ln(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}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!da(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Ko(e))return{};var t={};return Q(e.attributes,function(i){if(i.name&&i.name.indexOf("data-ph-capture-attribute")===0){var r=i.name.replace("data-ph-capture-attribute-",""),s=i.value;r&&s&&Hn(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Yo.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=Po(1024,zu(e)):o.$el_text=Po(1024,as(e)));var a=os(e);a.length>0&&(o.classes=a.filter(function(d){return d!==""}));var l=(r=this.config)===null||r===void 0?void 0:r.element_attribute_ignorelist;Q(e.attributes,function(d){var f;if((!qc(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(l==null||!l.includes(d.name))&&!t&&Hn(d.value)&&(f=d.name,!Ie(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var g=d.value;d.name==="class"&&(g=fa(g).join(" ")),o["attr__"+d.name]=Po(1024,g)}});for(var c=1,p=1,u=e;u=this._previousElementSibling(u);)c++,u.tagName===e.tagName&&p++;return o.nth_child=c,o.nth_of_type=p,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return M(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);Lc(s)&&(s=s.parentNode||null),i==="$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 o=i===Ro;if(s&&gd(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,c=[s],p=s;p.parentNode&&!Vt(p,"body");)Nc(p.parentNode)?(c.push(p.parentNode.host),p=p.parentNode.host):(c.push(p.parentNode),p=p.parentNode);var u,d,f=[],g={},v=!1;if(Q(c,function(C){var B=Ko(C);C.tagName.toLowerCase()==="a"&&(u=C.getAttribute("href"),u=B&&Hn(u)&&u),H(os(C),"ph-no-capture")&&(v=!0),f.push(t._getPropertiesFromElement(C,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var X=t._getAugmentPropertiesFromElement(C);Oe(g,X)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?f[0].$el_text=zu(s):f[0].$el_text=as(s)),u){var _,$;f[0].attr__href=u;var S=(_=Fi(u))===null||_===void 0?void 0:_.host,O=m==null||($=m.location)===null||$===void 0?void 0:$.host;S&&O&&S!==O&&(d=u)}if(v)return!1;var j=Oe(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:bd(f)}:{$elements:f},(a=f[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=f[0])===null||l===void 0?void 0:l.$el_text}:{},d&&e.type==="click"?{$external_click_url:d}:{},g);if(i===Ro){var U,G=Mc(m==null||(U=m.getSelection())===null||U===void 0?void 0:U.toString()),V=e.type||"clipboard";if(!G)return!1;j.$selected_content=G,j.$copy_type=V}return this.instance.capture(i,j),!0}}}},{key:"isBrowserSupported",value:function(){return rt(P?.querySelectorAll)}}]),n}(),gh=function(){function n(e){var t=this;J(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){M(t._restoreXHRPatch)&&pe.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),M(t._restoreFetchPatch)&&pe.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return Y(n,[{key:"_loadScript",value:function(e){pe.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(ct.LIB_VERSION),function(t){t&&b.error("[TRACING-HEADERS] failed to load script",t),e()})}},{key:"startIfEnabledOrStop",value:function(){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)}}]),n}();(function(n){n[n.PENDING=-1]="PENDING",n[n.DENIED=0]="DENIED",n[n.GRANTED=1]="GRANTED"})(Bt||(Bt={}));var vh=function(){function n(e){J(this,n),this.instance=e}return Y(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Bt.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Bt.DENIED||this.consent===Bt.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return e==="1"?Bt.GRANTED:e==="0"?Bt.DENIED:Bt.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?ve:Et;var t=e==="localStorage"?Et: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}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!yc([kt?.doNotTrack,kt?.msDoNotTrack,pe.doNotTrack],function(e){return H([!0,1,"1","yes"],e)})}}]),n}(),uc="/e/",Jr="[Exception Capture]",mh=function(){function n(e){var t,i=this;J(this,n),y(this,"_endpoint",uc),y(this,"originalOnUnhandledRejectionHandler",void 0),y(this,"startCapturing",function(){var r;if(m&&i.isEnabled&&!i.hasHandlers&&((r=m.onerror)===null||r===void 0||!r.__POSTHOG_INSTRUMENTED__)){var s=m.posthogErrorWrappingFunctions.wrapOnError,o=m.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(s&&o)try{i.unwrapOnError=s(i.captureException.bind(i)),i.unwrapUnhandledRejection=o(i.captureException.bind(i))}catch(a){b.error(Jr+" failed to start",a),i.stopCapturing()}else b.error(Jr+" failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[$u]),this.startIfEnabled()}return Y(n,[{key:"isEnabled",get:function(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}},{key:"isCapturing",get:function(){var e;return!(m==null||(e=m.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(b.info(Jr+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js?v=".concat(ct.LIB_VERSION)),function(t){t&&b.error(Jr+" failed to load script",t),e()})}},{key:"stopCapturing",value:function(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this._endpoint=Fe(t)&&t.endpoint||uc,this.instance.persistence&&(this.instance.persistence.register(y({},$u,this.remoteEnabled)),this.instance.persistence.register(y({},"$exception_capture_endpoint",this._endpoint))),this.startIfEnabled()}},{key:"captureException",value:function(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.sendExceptionEvent(e)}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0,_url:this._endpoint})}}]),n}(),Ii="[Web Vitals]",yh=function(){function n(e){var t,i=this;J(this,n),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),y(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),y(this,"_flushToCapture",function(){clearTimeout(i._delayedFlushTimer),i.buffer.metrics.length!==0&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce(function(r,s){var o;return I(I({},r),{},(y(o={},"$web_vitals_".concat(s.name,"_event"),I({},s)),y(o,"$web_vitals_".concat(s.name,"_value"),s.value),o))},{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),y(this,"_addToBuffer",function(r){var s,o=(s=i.instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0);if(M(o))b.error(Ii+"Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{};var a=i._currentURL();M(a)||(st(r?.name)||st(r?.value)?b.error(Ii+"Invalid metric received",r):(i.buffer.url!==a&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,8e3)),M(i.buffer.url)&&(i.buffer.url=a),i.buffer.firstMetricTimestamp=M(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,i.buffer.metrics.push(I(I({},r),{},{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),i.buffer.metrics.length===4&&i._flushToCapture()))}}),y(this,"_startCapturing",function(){var r=pe.postHogWebVitalsCallbacks,s=r.onLCP,o=r.onCLS,a=r.onFCP,l=r.onINP;s(i._addToBuffer),o(i._addToBuffer),a(i._addToBuffer),l(i._addToBuffer),i._initialized=!0}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Cu]),this.startIfEnabled()}return Y(n,[{key:"isEnabled",get:function(){var e=Fe(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Ln(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(b.info(Ii+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=Fe(e.capturePerformance)&&!!e.capturePerformance.web_vitals;this.instance.persistence&&this.instance.persistence.register(y({},Cu,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){m.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/web-vitals.js?v=".concat(ct.LIB_VERSION)),function(t){t&&b.error(Ii+" failed to load script",t),e()})}},{key:"_currentURL",value:function(){var e=m?m.location.href:void 0;return e||b.error(Ii+"Could not determine current URL"),e}}]),n}(),Li={},cc=function(){},Mn="posthog",ap=!zd&&le?.indexOf("MSIE")===-1&&le?.indexOf("Mozilla")===-1,pc=function(){var n,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=P?.location,t=e?.hostname,!!Ie(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:cc,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Ne&&Ie(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_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(m==null||(n=m.location)===null||n===void 0?void 0:n.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:function(i){var r="Bad HTTP status: "+i.statusCode+" "+i.text;b.error(r)},get_device_id:function(i){return i},_onCapture:cc,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},fc=function(n){var e={};M(n.process_person)||(e.person_profiles=n.process_person),M(n.xhr_headers)||(e.request_headers=n.xhr_headers),M(n.cookie_name)||(e.persistence_name=n.cookie_name),M(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Oe({},e,n);return me(n.property_blacklist)&&(M(n.property_denylist)?t.property_denylist=n.property_blacklist:me(n.property_denylist)?t.property_denylist=[].concat(St(n.property_blacklist),St(n.property_denylist)):b.error("Invalid value for property_denylist config: "+n.property_denylist)),t},_h=function(){function n(){J(this,n),y(this,"__forceAllowLocalhost",!1)}return Y(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){b.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),lp=function(){function n(){var e=this;J(this,n),y(this,"webPerformance",new _h),y(this,"_internalEventEmitter",new dh),this.config=pc(),this.decideEndpointWasHit=!1,this.SentryIntegration=Yd,this.sentryIntegration=function(t){return function(i,r){var s=Jc(i,r);return{name:Xc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new zf(this),this.toolbar=new Od(this),this.scrollManager=new fh(this),this.pageViewManager=new Qd(this),this.surveys=new oh(this),this.rateLimiter=new ah(this),this.requestRouter=new Jd(this),this.consent=new vh(this),this.people={set:function(t,i,r){var s=Ie(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Ie(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return b.info("send",t)})}return Y(n,[{key:"init",value:function(e,t,i){if(i&&i!==Mn){var r,s=(r=Li[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),Li[i]=s,Li[Mn][i]=s,s}return this._init(e,t,i)}},{key:"_init",value:function(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(M(e)||_u(e))return b.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return b.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Oe({},pc(),fc(s),{name:o,token:e})),this.compression=s.disable_compression?void 0:it.Base64,this.persistence=new $o(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new $o(I(I({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new Fd(function(_){return r._send_retriable_request(_)}),this._retryQueue=new Gd(this),this.__request_queue=[],this.sessionManager=new Xd(this.config,this.persistence),this.sessionPropsManager=new uh(this.sessionManager,this.persistence),new gh(this).startIfEnabledOrStop(),this.sessionRecording=new Td(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new hh(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ph(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new yh(this),this.exceptionObserver=new mh(this),this.exceptionObserver.startIfEnabled(),ct.DEBUG=ct.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,l,c=this.config.get_device_id(Ht()),p=(a=s.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?c:s.bootstrap.distinctID;this.persistence.set_property(bt,(l=s.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var u,d,f=Object.keys(((u=s.bootstrap)===null||u===void 0?void 0:u.featureFlags)||{}).filter(function(_){var $,S;return!(($=s.bootstrap)===null||$===void 0||(S=$.featureFlags)===null||S===void 0||!S[_])}).reduce(function(_,$){var S,O;return _[$]=((S=s.bootstrap)===null||S===void 0||(O=S.featureFlags)===null||O===void 0?void 0:O[$])||!1,_},{}),g=Object.keys(((d=s.bootstrap)===null||d===void 0?void 0:d.featureFlagPayloads)||{}).filter(function(_){return f[_]}).reduce(function(_,$){var S,O,j,U;return(S=s.bootstrap)!==null&&S!==void 0&&(O=S.featureFlagPayloads)!==null&&O!==void 0&&O[$]&&(_[$]=(j=s.bootstrap)===null||j===void 0||(U=j.featureFlagPayloads)===null||U===void 0?void 0:U[$]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:g})}if(!this.get_distinct_id()){var v=this.config.get_device_id(Ht());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(bt,"anonymous")}return m==null||(i=m.addEventListener)===null||i===void 0||i.call(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?Kd(this,function(){return r._loaded()}):this._loaded(),rt(this.config._onCapture)&&this.on("eventCaptured",function(_){return r.config._onCapture(_.event,_)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o,a,l;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=H(e.supportedCompression,it.GZipJS)?it.GZipJS:H(e.supportedCompression,it.Base64)?it.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(i=this.sessionRecording)===null||i===void 0||i.afterDecideResponse(e),(r=this.autocapture)===null||r===void 0||r.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.afterDecideResponse(e),(l=this.exceptionObserver)===null||l===void 0||l.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(i){b.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){P&&e.capture("$pageview",{title:P.title},{send_instantly:!0})},1),t||(new Rd(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||qn(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){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"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(ap?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=cs(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=I({},i);a.timeout=a.timeout||6e4,a.url=cs(a.url,{_:new Date().getTime().toString(),ver:ct.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",c=(s=(o=yc(Mi,function(p){return p.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Mi[0].method;if(!c)throw new Error("No available transport method");c(a)}(I(I({},e),{},{callback:function(i){var r,s,o;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&((s=(o=t.config).on_request_error)===null||s===void 0||s.call(o,i)),(r=e.callback)===null||r===void 0||r.call(e,i)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,i=this,r=[],s=[],o=[];qn(e,function(l){l&&(t=l[0],me(t)?o.push(l):rt(l)?l.call(i):me(l)&&t==="alias"?r.push(l):me(l)&&t.indexOf("capture")!==-1&&rt(i[t])?o.push(l):s.push(l))});var a=function(l,c){qn(l,function(p){if(me(p[0])){var u=c;Q(p,function(d){u=u[d[0]].apply(u,d.slice(1))})}else this[p[0]].apply(this,p.slice(1))},c)};a(r,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){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}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,i){var r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return b.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!M(e)&&Ie(e)){if(!le||this.config.opt_out_useragent_filter||!ac(le,this.config.custom_blocked_useragents)){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={uuid:Ht(),event:e,properties:this._calculate_event_properties(e,t||{},i)};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(o.$set=i?.$set);var a=this._calculate_set_once_properties(i?.$set_once);a&&(o.$set_once=a),(o=Uf(o,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i?.timestamp||new Date,M(i?.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var l=I(I({},o.properties.$set),o.$set);wo(l)||this.setPersonPropertiesForFlags(l),this._internalEventEmitter.emit("eventCaptured",o);var c={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,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(c):this._requestQueue.enqueue(c),o}b.critical("This capture call is ignored due to client rate limiting.")}}else b.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=I({},t);if(s.token=this.config.token,e==="$snapshot"){var o=I(I({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!Ie(s.distinct_id)&&!nt(s.distinct_id)||_u(s.distinct_id))&&b.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var a=xe.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),c=l.sessionId,p=l.windowId;s.$session_id=c,s.$window_id=p}if(this.requestRouter.region===pn.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 u=this.sessionPropsManager.getSessionProps();s=Oe(s,u)}if(!this.config.disable_scroll_properties){var d={};e==="$pageview"?d=this.pageViewManager.doPageView():e==="$pageleave"&&(d=this.pageViewManager.doPageLeave()),s=Oe(s,d)}if(e==="$pageview"&&P&&(s.title=P.title),!M(r)){var f=new Date().getTime()-r;s.$duration=parseFloat((f/1e3).toFixed(3))}if(le&&this.config.opt_out_useragent_filter&&(s.$browser_type=ac(le,this.config.custom_blocked_useragents)?"bot":"browser"),(s=Oe({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),i==null||!i._noHeatmaps){var g,v=(g=this.heatmaps)===null||g===void 0?void 0:g.getAndClearBuffer();v&&(s.$heatmap_data=v)}me(this.config.property_denylist)?Q(this.config.property_denylist,function($){delete s[$]}):b.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;return _&&(s=_(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Oe({},this.persistence.get_initial_props(),e||{});return wo(t)?void 0:t}},{key:"register",value:function(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,t,i)}},{key:"register_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}},{key:"unregister",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(y({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return b.uninitializedWarning("posthog.identify");if(nt(e)&&(e=e.toString(),b.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))b.critical('The string "'.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 r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(Ti)&&(this.unregister(Ti),this.register({distinct_id:e}));var o=(this.persistence.get_property(bt)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(bt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(ns))}}else b.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:I(I({},r),{},y({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(y({},e,i))),r[e]===t||i||this.reloadFeatureFlags()}}else b.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,i,r,s;if(!this.__loaded)return b.uninitializedWarning("posthog.reset");var o=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(),(r=this.persistence)===null||r===void 0||r.set_property(bt,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(Ht());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionId,r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(e!=null&&e.withTimestamp&&r){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);s+="?t=".concat(l)}return s}},{key:"alias",value:function(e,t){return e===this.get_property(_c)?(b.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(M(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ti,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(b.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,i,r,s,o=I({},this.config);Fe(e)&&(Oe(this.config,fc(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new $o(I(I({},this.config),{},{persistence:"sessionStorage"})),ve.is_supported()&&ve.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(ct.DEBUG=!0),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(e!=null&&e.sampling){var t,i,r=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId();(i=this.persistence)===null||i===void 0||i.register(y({},Oi,!0)),b.info("Session recording started with sampling override for session: ",r?.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Mn;return t!==Mn&&(t=Mn+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(bt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(bt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&wo(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[Ti])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[is]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(b.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(is,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,r,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==a&&((i=this.persistence)===null||i===void 0||i.set_disabled(a)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(M(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(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}))}}]),n}();(function(n,e){for(var t=0;t<e.length;t++)n.prototype[e[t]]=qf(n.prototype[e[t]])})(lp,["identify"]);var dc,up=(dc=Li[Mn]=new lp,function(){function n(){n.done||(n.done=!0,ap=!1,Q(Li,function(e){e._dom_loaded()}))}P!=null&&P.addEventListener&&(P.readyState==="complete"?n():P.addEventListener("DOMContentLoaded",n,!1)),m&&xt(m,"load",n,!0)}(),dc);var cp=up.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(n,e){if(!cp)throw new Error("Failed to initialize PostHog");cp.capture(n,e)}var vs,Wi,ms,Gt,fp,gs,Hi=class Hi extends W(q){constructor(){super();w(this,Gt);w(this,vs,new jt(this,{onError:console.error}));w(this,Wi);w(this,ms,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),fe("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>fe("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>fe("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>fe("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>fe("ShopAssistant: user clicked link",t),onUserSentInput:t=>fe("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return h(this,Wi)||h(this,vs).data}render(){return this.config?D`
321
321
  <!-- embed our chat component forwarding props -->
322
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,ps)}" ?show-close="${this.showClose}" @mw:close-click="${A(this,Vt,cp)}">
322
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,ms)}" ?show-close="${this.showClose}" @mw:close-click="${A(this,Gt,fp)}">
323
323
  <slot name="banner" slot="banner"></slot>
324
324
  </mw-chat>
325
- `:L}injectConfig(t){R(this,Bi,t),this.requestUpdate()}reloadConfig(){h(this,Vt,us)?.reloadConfig()}get conversationId(){return h(this,Vt,us)?.conversationId??""}get messages(){return h(this,Vt,us)?.messages??[]}};cs=new WeakMap,Bi=new WeakMap,ps=new WeakMap,Vt=new WeakSet,cp=function(){this.dispatchEvent(new fs.CloseClickEvent)},us=function(){return this.renderRoot.querySelector("mw-chat")||null},$(fs,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var Ui=fs;customElements.define("molin-shop-ai-chat",Ui);var ma;Ui.CloseClickEvent=(ma=class extends CustomEvent{constructor(e={}){super(Ui.CloseClickEvent.type,{...e})}},$(ma,"type","mw:close-click"),ma);var pp=n=>n??L;var hs,ds=class extends W(q){constructor(){super();w(this,hs,new Nt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return h(this,hs).data}render(){return this.config?D`
325
+ `:L}injectConfig(t){T(this,Wi,t),this.requestUpdate()}reloadConfig(){h(this,Gt,gs)?.reloadConfig()}get conversationId(){return h(this,Gt,gs)?.conversationId??""}get messages(){return h(this,Gt,gs)?.messages??[]}};vs=new WeakMap,Wi=new WeakMap,ms=new WeakMap,Gt=new WeakSet,fp=function(){this.dispatchEvent(new Hi.CloseClickEvent)},gs=function(){return this.renderRoot.querySelector("mw-chat")},E(Hi,"styles",ht`
326
+ :host {
327
+ all: initial; /* reset all properties that can pierce the shadow DOM */
328
+ }
329
+ `),E(Hi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var zi=Hi;customElements.define("molin-shop-ai-chat",zi);var _a;zi.CloseClickEvent=(_a=class extends CustomEvent{constructor(e={}){super(zi.CloseClickEvent.type,{...e})}},E(_a,"type","mw:close-click"),_a);var dp=n=>n??L;var ys,Vi=class extends W(q){constructor(){super();w(this,ys,new jt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return h(this,ys).data}render(){return this.config?D`
326
330
  <!-- embed our bubble component forwarding props -->
327
331
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
328
- <mw-bubble state="${this.state}" src="${pp(this.config?.bubble?.imageUrl)}"></mw-bubble>
329
- `:L}};hs=new WeakMap,$(ds,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",ds);var vs,Vn,Gn,fn,Hi,zi,gs=class{constructor(e,t,i,r=window.history){w(this,vs);w(this,Vn);w(this,Gn);w(this,fn);w(this,Hi,!1);w(this,zi,()=>{h(this,Vn).test(window.location.pathname)&&h(this,Gn).navigated()});R(this,vs,e),R(this,Vn,t),R(this,Gn,i),R(this,fn,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",h(this,zi));let e=h(this,fn).pushState;h(this,fn).pushState=(...t)=>{if(e.call(h(this,fn),...t),!h(this,Hi))try{let i=new URL(t[2],window.location.origin);h(this,Vn).test(i.pathname)&&h(this,Gn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",h(this,zi)),R(this,Hi,!0)}};vs=new WeakMap,Vn=new WeakMap,Gn=new WeakMap,fn=new WeakMap,Hi=new WeakMap,zi=new WeakMap;var Gt,ft,_a,Wi,ya=class{constructor(e=window.localStorage){w(this,ft);w(this,Gt);R(this,Gt,e)}setex(e,t,i){return h(this,Gt).setItem(e,A(this,ft,Wi).call(this,{value:A(this,ft,Wi).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return h(this,Gt).setItem(e,A(this,ft,Wi).call(this,{value:A(this,ft,Wi).call(this,t)})||"")}get(e){let t=h(this,Gt).getItem(e);if(!t)return;let i=A(this,ft,_a).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){h(this,Gt).removeItem(e);return}return A(this,ft,_a).call(this,i.value)}}};Gt=new WeakMap,ft=new WeakSet,_a=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Wi=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var ba=new ya;function ms(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var fp="molin-shop-ai-last-url",_s,wa,ve,bs,Ee,Vi,dp,hp,gp,vp,mp,ys=class extends W(q){constructor(){super();w(this,Ee);w(this,_s,new Nt(this,{onError:console.error}));w(this,wa,new gs(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=h(this,Ee,dp);t&&pe("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));w(this,ve,!1);w(this,bs,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),pe("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>pe("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>pe("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>pe("ShopAssistant: user canceled streaming",t),onUserClickedLink:A(this,Ee,mp),onUserSentInput:t=>pe("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return h(this,_s).data}render(){if(!this.config)return L;let t=[ms(this.config.bubble.position),ms(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),i=ms(this.config.bubble.position),r={bottom:"72px"},s=Object.entries(this.config.bubble.position).filter(([a,l])=>l).map(([a,l])=>{let c=`sm:${a}-[calc(${[r[a],l].filter(p=>!!p).join("+")})]`;return a==="left"&&(c+=" sm:right-auto"),a==="right"&&(c+=" sm:left-auto"),c}).join(" "),o=s;return this.config.hidden?L:D`
330
- <mw-bubble class="${t} fixed z-[2147483647]" @click=${A(this,Ee,gp)} state="${h(this,ve)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
332
+ <mw-bubble state="${this.state}" src="${dp(this.config?.bubble?.imageUrl)}"></mw-bubble>
333
+ `:L}};ys=new WeakMap,E(Vi,"styles",ht`
334
+ :host {
335
+ all: initial; /* reset all properties that can pierce the shadow DOM */
336
+ }
337
+ `),E(Vi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",Vi);var bs,Gn,Xn,dn,Gi,Xi,_s=class{constructor(e,t,i,r=window.history){w(this,bs);w(this,Gn);w(this,Xn);w(this,dn);w(this,Gi,!1);w(this,Xi,()=>{h(this,Gn).test(window.location.pathname)&&h(this,Xn).navigated()});T(this,bs,e),T(this,Gn,t),T(this,Xn,i),T(this,dn,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",h(this,Xi));let e=h(this,dn).pushState;h(this,dn).pushState=(...t)=>{if(e.call(h(this,dn),...t),!h(this,Gi))try{let i=new URL(t[2],window.location.origin);h(this,Gn).test(i.pathname)&&h(this,Xn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",h(this,Xi)),T(this,Gi,!0)}};bs=new WeakMap,Gn=new WeakMap,Xn=new WeakMap,dn=new WeakMap,Gi=new WeakMap,Xi=new WeakMap;var Xt,ft,wa,Ji,ba=class{constructor(e=window.localStorage){w(this,ft);w(this,Xt);T(this,Xt,e)}setex(e,t,i){return h(this,Xt).setItem(e,A(this,ft,Ji).call(this,{value:A(this,ft,Ji).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return h(this,Xt).setItem(e,A(this,ft,Ji).call(this,{value:A(this,ft,Ji).call(this,t)})||"")}get(e){let t=h(this,Xt).getItem(e);if(!t)return;let i=A(this,ft,wa).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){h(this,Xt).removeItem(e);return}return A(this,ft,wa).call(this,i.value)}}};Xt=new WeakMap,ft=new WeakSet,wa=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Ji=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var xa=new ba;function ws(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var hp="molin-shop-ai-widget-open",xs,Qi,ka,de,ks,ue,Ki,gp,vp,mp,yp,Jn,Yi=class extends W(q){constructor(){super();w(this,ue);w(this,xs,new jt(this,{onError:console.error}));w(this,Qi);w(this,ka,new _s(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=h(this,ue,gp);t&&fe("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));w(this,de,!1);w(this,ks,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),fe("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>fe("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>fe("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>fe("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>fe("ShopAssistant: user clicked link",t),onUserSentInput:t=>fe("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return h(this,Qi)||h(this,xs).data}render(){if(!this.config)return L;let t=[ws(this.config.bubble.position),ws(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),i=ws(this.config.bubble.position),r={bottom:"72px"},s=Object.entries(this.config.bubble.position).filter(([a,l])=>l).map(([a,l])=>{let c=`sm:${a}-[calc(${[r[a],l].filter(p=>!!p).join("+")})]`;return a==="left"&&(c+=" sm:right-auto"),a==="right"&&(c+=" sm:left-auto"),c}).join(" "),o=s;return this.config.hidden?L:D`
338
+ <mw-bubble class="${t} fixed z-[2147483647]" @click=${A(this,ue,mp)} state="${h(this,de)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
331
339
 
332
340
  <!-- only load the component if enabled on any platform -->
333
341
  ${this.isPopupEnabled?D`<mw-popup
@@ -335,20 +343,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
335
343
  delay="${this.config.popup?.delayMs||0}"
336
344
  sound="https://molin.ai/sounds/widget/popup.aac"
337
345
  .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}}}"
338
- @mw:click="${A(this,Ee,hp)}"></mw-popup>`:L}
346
+ @mw:click="${A(this,ue,vp)}"></mw-popup>`:L}
339
347
 
340
348
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
341
349
  ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?D`<mw-try-it-out class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}" position="${i}" text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:L}
342
350
 
343
351
  <!-- 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. -->
344
352
  ${this._dialogAlreadyShown?D`
345
- <div class="${h(this,ve)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${s} fixed inset-0 z-[2147483647] overflow-hidden bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:h-4/5 sm:max-h-[800px] sm:w-[calc(100dvh*0.45)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-2xl 2xl:max-w-[420px]">
346
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,bs)}" ?show-close="${!0}" @mw:close-click="${A(this,Ee,vp)}">
353
+ <div class="${h(this,de)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${s} fixed inset-0 z-[2147483647] overflow-hidden bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:h-4/5 sm:max-h-[800px] sm:w-[calc(100dvh*0.45)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-2xl 2xl:max-w-[420px]">
354
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,ks)}" ?show-close="${!0}" @mw:close-click="${A(this,ue,yp)}">
347
355
  <slot name="banner" slot="banner"></slot>
348
356
  </mw-chat>
349
357
  </div>
350
358
  `:L}
351
- `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){h(this,ve)&&h(this,Ee,Vi)?.hide()}firstUpdated(){let t=ba.get(fp);t?.url&&new URL(t.url).pathname===window.location.pathname&&this.openChat()}openChat(){h(this,ve)||(R(this,ve,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),h(this,Ee,Vi)?.hide(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,ve)?"open":"close"}))}closeChat(){h(this,ve)&&(R(this,ve,!1),this.requestUpdate(),h(this,Ee,Vi)?.hide(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,ve)?"open":"close"}))}};_s=new WeakMap,wa=new WeakMap,ve=new WeakMap,bs=new WeakMap,Ee=new WeakSet,Vi=function(){return this.renderRoot.querySelector("mw-popup")||null},dp=function(){return this.renderRoot.querySelector("mw-chat")||null},hp=function(){R(this,ve,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:h(this,ve)?"open":"close"})},gp=function(){R(this,ve,!h(this,ve)),this._dialogAlreadyShown=!0,this.requestUpdate(),h(this,Ee,Vi)?.hide(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:h(this,ve)?"open":"close"})},vp=function(){R(this,ve,!1),this.requestUpdate(),pe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:h(this,ve)?"open":"close"})},mp=function(t){pe("ShopAssistant: user clicked link",t);let i=new URL(t.url);if(i.hostname===window.location.hostname){let r={url:i.toString()};ba.setex(fp,r,30)}},$(ys,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",ys);
359
+ `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){h(this,de)&&h(this,ue,Ki)?.hide()}firstUpdated(){xa.get(hp)?.isOpen&&this.openChat()}openChat(){h(this,de)||(T(this,de,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),A(this,ue,Jn).call(this,!0),h(this,ue,Ki)?.hide(),fe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,de)?"open":"close"}))}closeChat(){h(this,de)&&(T(this,de,!1),this.requestUpdate(),A(this,ue,Jn).call(this,!1),h(this,ue,Ki)?.hide(),fe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,de)?"open":"close"}))}injectConfig(t){T(this,Qi,t),this.requestUpdate()}};xs=new WeakMap,Qi=new WeakMap,ka=new WeakMap,de=new WeakMap,ks=new WeakMap,ue=new WeakSet,Ki=function(){return this.renderRoot.querySelector("mw-popup")},gp=function(){return this.renderRoot.querySelector("mw-chat")},vp=function(){T(this,de,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),A(this,ue,Jn).call(this,!0),fe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:h(this,de)?"open":"close"})},mp=function(){T(this,de,!h(this,de)),this._dialogAlreadyShown=!0,this.requestUpdate(),A(this,ue,Jn).call(this,h(this,de)),h(this,ue,Ki)?.hide(),fe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:h(this,de)?"open":"close"})},yp=function(){T(this,de,!1),this.requestUpdate(),A(this,ue,Jn).call(this,!1),fe("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:h(this,de)?"open":"close"})},Jn=function(t){xa.set(hp,{isOpen:t})},E(Yi,"styles",ht`
360
+ :host {
361
+ all: initial; /* reset all properties that can pierce the shadow DOM */
362
+ }
363
+ `),E(Yi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",Yi);
352
364
  /*! Bundled license information:
353
365
 
354
366
  @lit/reactive-element/css-tag.js: